[
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    {one line to give the program's name and a brief idea of what it does.}\n    Copyright (C) {year}  {name of author}\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    {project}  Copyright (C) {year}  {fullname}\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# Freqtrade Strategies Repository\n\nThis repository is dedicated to sharing open-source trading strategies for the Freqtrade cryptocurrency trading bot. We encourage contributors to help keep these strategies up to date with the latest Freqtrade versions and to add new strategies to benefit the community.\n\n## About Freqtrade\n\n[Freqtrade](https://www.freqtrade.io/) is an open-source cryptocurrency trading bot that allows users to create, backtest, and execute trading strategies on various cryptocurrency exchanges.\n\n## Getting Started\n\n### Prerequisites\n\nBefore you start contributing to this project, ensure you have the following:\n\n- [Freqtrade](https://www.freqtrade.io/) installed on your machine.\n- Basic knowledge of Python and Freqtrade.\n- Familiarity with version control using Git.\n"
  },
  {
    "path": "strategies/ADXMomentum/ADXMomentum.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\n\n\n# --------------------------------\n\n\nclass ADXMomentum(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n        https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AdxMomentum.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 25) &\n                    (dataframe['mom'] > 0) &\n                    (dataframe['plus_di'] > 25) &\n                    (dataframe['plus_di'] > dataframe['minus_di'])\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 25) &\n                    (dataframe['mom'] < 0) &\n                    (dataframe['minus_di'] > 25) &\n                    (dataframe['plus_di'] < dataframe['minus_di'])\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/ADX_15M_USDT/ADX_15M_USDT.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass ADX_15M_USDT(IStrategy):\n    ticker_interval = '15m'\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.26552,\n        \"30\": 0.10255,\n        \"210\": 0.03545,\n        \"540\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.1255\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        dataframe['sell-adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['sell-plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['sell-minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sell-sar'] = ta.SAR(dataframe)\n        dataframe['sell-mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 16) &\n                    (dataframe['minus_di'] > 4) &\n                    (dataframe['plus_di'] > 20) &\n                    (qtpylib.crossed_above( dataframe['plus_di'],dataframe['minus_di']))\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 43) &\n                    (dataframe['minus_di'] > 22) &\n                    (dataframe['plus_di'] > 20) &\n                    (qtpylib.crossed_above(dataframe['sell-minus_di'], dataframe['sell-plus_di']))\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/ADX_15M_USDT2/ADX_15M_USDT2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass ADX_15M_USDT2(IStrategy):\n    ticker_interval = '15m'\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.10313,\n        \"102\": 0.07627,\n        \"275\": 0.04228,\n        \"588\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.31941\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        dataframe['sell-adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['sell-plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['sell-minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sell-sar'] = ta.SAR(dataframe)\n        dataframe['sell-mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    #(dataframe['adx'] > 45) &\n                    #(dataframe['minus_di'] > 26) &\n                    # (dataframe['plus_di'] > 33) &\n                    (qtpylib.crossed_above(dataframe['minus_di'], dataframe['plus_di']))\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 91) &\n                    # (dataframe['minus_di'] > 22) &\n                    (dataframe['sell-minus_di'] > 91) &\n                    #(dataframe['plus_di'] > 24) &\n                    (qtpylib.crossed_above(dataframe['sell-plus_di'], dataframe['sell-minus_di']))\n\n            ),\n            'sell'] = 1\n        return dataframe\n\n"
  },
  {
    "path": "strategies/ASDTSRockwellTrading/ASDTSRockwellTrading.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass ASDTSRockwellTrading(IStrategy):\n    \"\"\"\n    trading strategy based on the concept explained at https://www.youtube.com/watch?v=mmAWVmKN4J0\n    author@: Gert Wohlgemuth\n\n    idea:\n\n        uptrend definition:\n            MACD above 0 line AND above MACD signal\n\n\n        downtrend definition:\n            MACD below 0 line and below MACD signal\n\n        sell definition:\n            MACD below MACD signal\n\n    it's basically a very simple MACD based strategy and we ignore the definition of the entry and exit points in this case, since the trading bot, will take of this already\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.3\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['macd'] > 0) &\n                (dataframe['macd'] > dataframe['macdsignal'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['macd'] < dataframe['macdsignal'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/ActionZone/ActionZone.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\n\nclass ActionZone(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 100000\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -1.00\n    use_custom_stoploss = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1d'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Number of candles used for calculations in lowest price of period\n    min_price_period: int = 14\n\n    # max loss able for calculation position size\n    max_loss_per_trade = 10 # USD\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'fastMA': {\n                'color': 'red',\n                'fill_to': 'slowMA',\n                'fill_color': 'rgba(232, 232, 232,0.2)'\n            }, \n            'slowMA': {\n                'color': 'blue',\n            },\n        },\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        stoploss_price = last_candle['lowest']\n\n        # Convert absolute price to percentage relative to current_rate\n        if stoploss_price < current_rate:\n            return (stoploss_price / current_rate) - 1\n\n        # return maximum stoploss value, keeping current stoploss price unchanged\n        return 1\n    \n    def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float, proposed_stake: float, min_stake: float, max_stake: float, **kwargs) -> float:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        stop_price = last_candle['lowest']\n        volume_for_buy = self.max_loss_per_trade / (current_rate - stop_price)\n        use_money = volume_for_buy * current_rate\n\n        return use_money\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # MIN - Lowest value over a specified period\n        lowest = ta.MIN(dataframe, timeperiod=self.min_price_period)\n        dataframe['lowest'] = lowest\n\n        # EMA - Exponential Moving Average\n        fastEMA = ta.EMA(dataframe, timeperiod=12)\n        slowEMA = ta.EMA(dataframe, timeperiod=26)\n        dataframe['fastMA'] = fastEMA\n        dataframe['slowMA'] = slowEMA\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['fastMA'] > dataframe['slowMA']) &  # Bull\n                (dataframe['close'] > dataframe['fastMA'] ) & # Price Cross Up\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['fastMA'] < dataframe['slowMA']) & # Bear\n                (dataframe['close'] < dataframe['fastMA'] ) & # Price Cross Down\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    \n    \n\n"
  },
  {
    "path": "strategies/AdxSmas/AdxSmas.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass AdxSmas(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AdxSmas.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['short'] = ta.SMA(dataframe, timeperiod=3)\n        dataframe['long'] = ta.SMA(dataframe, timeperiod=6)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 25) &\n                    (qtpylib.crossed_above(dataframe['short'], dataframe['long']))\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] < 25) &\n                    (qtpylib.crossed_above(dataframe['long'], dataframe['short']))\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/AlligatorStrat/AlligatorStrat.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass AlligatorStrat(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n        buys and sells on crossovers - doesn't really perfom that well and its just a proof of concept\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.1\n        # \"53\": 0.06157,\n        # \"93\": 0.0518,\n        # \"187\": 0.03,\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.2\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        # CCIPeriod = 14\n        # T3Period = 5\n        # b = 0.618\n\n        dataframe['SMAShort'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['SMAMedium'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['SMALong'] = ta.SMA(dataframe, timeperiod=13)\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # b2 = b*b2b3 = b2 * b2c1 = -b3\n        # c2 = (3 * (b2+b3))\n        # c3 = -3 * (2*b2+b+b3)\n        # c4 = (1+3*b+b3+3*b2)\n\n        # nr = 1 + 0.5 * (T3period - 1)\n        # w1 = 2 / (nr + 1)\n        # w2 = 1 - w1\n\n        # xcci = ta.CCI(CCIPeriod)\n\n\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                #or cross above SMALong to be more conservative\n                (\n                qtpylib.crossed_above(dataframe['SMAShort'], dataframe['SMAMedium']) &\n                ((dataframe['macd'] > -0.00001)) &\n                (dataframe['macd'] > dataframe['macdsignal'])\n                )\n                |\n                qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal'])\n                # |\n                # (\n                # (dataframe['SMAShort'] > dataframe['SMAMedium']) &\n                # ((dataframe['macd'] > -0.00006)) &\n                # qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal'])\n                # )\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # qtpylib.crossed_below(dataframe['SMAShort'], dataframe['SMALong']) &\n                ((dataframe['close'] < dataframe['SMAMedium']) &\n                (dataframe['macd'] < dataframe['macdsignal'])\n                )\n                |\n                qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal'])\n                # (dataframe['cci'] >= 100.0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/AlligatorStrategy/AlligatorStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport ta\n\n\n# This class is a sample. Feel free to customize it.\nclass AlligatorStrategy(IStrategy):\n    \"\"\"\n    Sources\n    Crypto Robot : https://www.youtube.com/watch?v=tHYs5135jUA\n    Github : https://github.com/CryptoRobotFr/TrueStrategy/blob/main/AligatorStrategy/Aligator_Strategy_backtest.ipynb\n\n    freqtrade backtesting -s AlligatorStrategy --timerange=20200903-20210826 --stake-amount unlimited -p EGLD/USDT --config user_data/config_binance.json --enable-position-stacking\n    =============== SUMMARY METRICS ================\n    | Metric                 | Value               |\n    |------------------------+---------------------|\n    | Backtesting from       | 2020-09-11 11:00:00 |\n    | Backtesting to         | 2021-08-26 00:00:00 |\n    | Max open trades        | 1                   |\n    |                        |                     |\n    | Total/Daily Avg Trades | 258 / 0.74          |\n    | Starting balance       | 1000.000 USDT       |\n    | Final balance          | 14245.054 USDT      |\n    | Absolute profit        | 13245.054 USDT      |\n    | Total profit %         | 1324.51%            |\n    | Trades per day         | 0.74                |\n    | Avg. daily profit %    | 3.81%               |\n    | Avg. stake amount      | 829.268 USDT        |\n    | Total trade volume     | 213951.164 USDT     |\n    |                        |                     |\n    | Best Pair              | EGLD/USDT 4287.66%  |\n    | Worst Pair             | EGLD/USDT 4287.66%  |\n    | Best trade             | EGLD/USDT 305.28%   |\n    | Worst trade            | EGLD/USDT -10.69%   |\n    | Best day               | 7078.313 USDT       |\n    | Worst day              | -1052.860 USDT      |\n    | Days win/draw/lose     | 8 / 275 / 19        |\n    | Avg. Duration Winners  | 9 days, 18:58:00    |\n    | Avg. Duration Loser    | 2 days, 9:00:00     |\n    | Rejected Buy signals   | 3045                |\n    |                        |                     |\n    | Min balance            | 905.332 USDT        |\n    | Max balance            | 16789.797 USDT      |\n    | Drawdown               | 169.59%             |\n    | Drawdown               | 2544.743 USDT       |\n    | Drawdown high          | 15789.797 USDT      |\n    | Drawdown low           | 13245.054 USDT      |\n    | Drawdown Start         | 2021-08-12 18:00:00 |\n    | Drawdown End           | 2021-08-24 18:00:00 |\n    | Market change          | 497.97%             |\n    ================================================\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 100 # inactive\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.99 # inactive\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Hyperoptable parameters\n    buy_stoch_rsi = DecimalParameter(0.5, 1, decimals=3, default=0.82, space=\"buy\")\n    sell_stoch_rsi = DecimalParameter(0, 0.5, decimals=3, default=0.2, space=\"sell\")\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count = 200 # EMA200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'ema7':{},\n            'ema30':{},\n            'ema50':{},\n            'ema100':{},\n            'ema121':{},\n            'ema200':{}\n        },\n        'subplots': {\n            \"STOCH RSI\": {\n                'stoch_rsi': {}\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # # Stochastic RSI\n        dataframe['stoch_rsi'] = ta.momentum.stochrsi(close=dataframe['close'], window=14, smooth1=3, smooth2=3) #Non moyenné \n\n        # Overlap Studies\n        # ------------------------------------\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema7']=ta.trend.ema_indicator(close=dataframe['close'], window=7)\n        dataframe['ema30']=ta.trend.ema_indicator(close=dataframe['close'], window=30)\n        dataframe['ema50']=ta.trend.ema_indicator(close=dataframe['close'], window=50)\n        dataframe['ema100']=ta.trend.ema_indicator(close=dataframe['close'], window=100)\n        dataframe['ema121']=ta.trend.ema_indicator(close=dataframe['close'], window=121)\n        dataframe['ema200']=ta.trend.ema_indicator(close=dataframe['close'], window=200)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema7'] > dataframe['ema30']) &\n                (dataframe['ema30'] > dataframe['ema50']) &\n                (dataframe['ema50'] > dataframe['ema100']) &\n                (dataframe['ema100'] > dataframe['ema121']) &\n                (dataframe['ema121'] > dataframe['ema200']) &\n                (dataframe['stoch_rsi'] < self.buy_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema121'] > dataframe['ema7']) &\n                (dataframe['stoch_rsi'] > self.sell_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/AlwaysBuy/AlwaysBuy.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n\nclass AlwaysBuy(IStrategy):\n\n    INTERFACE_VERSION = 3\n\n    # ROI table:\n    # fmt: off\n    minimal_roi = {\n        \"0\": 1,\n        \"100\": 2,\n        \"200\": 3,\n        \"300\": -1\n        }\n    # fmt: on\n\n    # Stoploss:\n    stoploss = -0.2\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n    # Buy hypers\n    timeframe = \"5m\"\n    use_exit_signal = False\n    # #################### END OF RESULT PLACE ####################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        return dataframe\n\n    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[:, [\"enter_long\", \"enter_tag\"]] = (1, \"entry_reason\")\n\n        return dataframe\n\n    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Apollo11/Apollo11.py",
    "content": "from datetime import datetime\nfrom datetime import timedelta\nfrom functools import reduce\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import IStrategy\nfrom pandas import DataFrame\n\n\ndef to_minutes(**timdelta_kwargs):\n    return int(timedelta(**timdelta_kwargs).total_seconds() / 60)\n\n\nclass Apollo11(IStrategy):\n    # Strategy created by Shane Jones https://twitter.com/shanejones\n    #\n    # Assited by a number of contributors https://github.com/shanejones/goddard/graphs/contributors\n    #\n    # Original repo hosted at https://github.com/shanejones/goddard\n    timeframe = \"15m\"\n\n    # Stoploss\n    stoploss = -0.16\n    startup_candle_count: int = 480\n    trailing_stop = False\n    use_custom_stoploss = True\n    use_sell_signal = False\n\n    # signal controls\n    buy_signal_1 = True\n    buy_signal_2 = True\n    buy_signal_3 = True\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,  # This is 10000%, which basically disables ROI\n    }\n\n    # Indicator values:\n\n    # Signal 1\n    s1_ema_xs = 3\n    s1_ema_sm = 5\n    s1_ema_md = 10\n    s1_ema_xl = 50\n    s1_ema_xxl = 240\n\n    # Signal 2\n    s2_ema_input = 50\n    s2_ema_offset_input = -1\n\n    s2_bb_sma_length = 49\n    s2_bb_std_dev_length = 64\n    s2_bb_lower_offset = 3\n\n    s2_fib_sma_len = 50\n    s2_fib_atr_len = 14\n\n    s2_fib_lower_value = 4.236\n\n    s3_ema_long = 50\n    s3_ema_short = 20\n    s3_ma_fast = 10\n    s3_ma_slow = 20\n\n    @property\n    def protections(self):\n        return [\n            {\n                # Don't enter a trade right after selling a trade.\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration\": to_minutes(minutes=0),\n            },\n            {\n                # Stop trading if max-drawdown is reached.\n                \"method\": \"MaxDrawdown\",\n                \"lookback_period\": to_minutes(hours=12),\n                \"trade_limit\": 20,  # Considering all pairs that have a minimum of 20 trades\n                \"stop_duration\": to_minutes(hours=1),\n                \"max_allowed_drawdown\": 0.2,  # If max-drawdown is > 20% this will activate\n            },\n            {\n                # Stop trading if a certain amount of stoploss occurred within a certain time window.\n                \"method\": \"StoplossGuard\",\n                \"lookback_period\": to_minutes(hours=6),\n                \"trade_limit\": 4,  # Considering all pairs that have a minimum of 4 trades\n                \"stop_duration\": to_minutes(minutes=30),\n                \"only_per_pair\": False,  # Looks at all pairs\n            },\n            {\n                # Lock pairs with low profits\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period\": to_minutes(hours=1, minutes=30),\n                \"trade_limit\": 2,  # Considering all pairs that have a minimum of 2 trades\n                \"stop_duration\": to_minutes(hours=15),\n                \"required_profit\": 0.02,  # If profit < 2% this will activate for a pair\n            },\n            {\n                # Lock pairs with low profits\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period\": to_minutes(hours=6),\n                \"trade_limit\": 4,  # Considering all pairs that have a minimum of 4 trades\n                \"stop_duration\": to_minutes(minutes=30),\n                \"required_profit\": 0.01,  # If profit < 1% this will activate for a pair\n            },\n        ]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Adding EMA's into the dataframe\n        dataframe[\"s1_ema_xs\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_xs)\n        dataframe[\"s1_ema_sm\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_sm)\n        dataframe[\"s1_ema_md\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_md)\n        dataframe[\"s1_ema_xl\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_xl)\n        dataframe[\"s1_ema_xxl\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_xxl)\n\n        s2_ema_value = ta.EMA(dataframe, timeperiod=self.s2_ema_input)\n        s2_ema_xxl_value = ta.EMA(dataframe, timeperiod=200)\n        dataframe[\"s2_ema\"] = s2_ema_value - s2_ema_value * self.s2_ema_offset_input\n        dataframe[\"s2_ema_xxl_off\"] = s2_ema_xxl_value - s2_ema_xxl_value * self.s2_fib_lower_value\n        dataframe[\"s2_ema_xxl\"] = ta.EMA(dataframe, timeperiod=200)\n\n        s2_bb_sma_value = ta.SMA(dataframe, timeperiod=self.s2_bb_sma_length)\n        s2_bb_std_dev_value = ta.STDDEV(dataframe, self.s2_bb_std_dev_length)\n        dataframe[\"s2_bb_std_dev_value\"] = s2_bb_std_dev_value\n        dataframe[\"s2_bb_lower_band\"] = s2_bb_sma_value - (s2_bb_std_dev_value * self.s2_bb_lower_offset)\n\n        s2_fib_atr_value = ta.ATR(dataframe, timeframe=self.s2_fib_atr_len)\n        s2_fib_sma_value = ta.SMA(dataframe, timeperiod=self.s2_fib_sma_len)\n\n        dataframe[\"s2_fib_lower_band\"] = s2_fib_sma_value - s2_fib_atr_value * self.s2_fib_lower_value\n\n        s3_bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe[\"s3_bb_lowerband\"] = s3_bollinger[\"lower\"]\n\n        dataframe[\"s3_ema_long\"] = ta.EMA(dataframe, timeperiod=self.s3_ema_long)\n        dataframe[\"s3_ema_short\"] = ta.EMA(dataframe, timeperiod=self.s3_ema_short)\n        dataframe[\"s3_fast_ma\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], self.s3_ma_fast) / ta.EMA(\n            dataframe[\"volume\"], self.s3_ma_fast\n        )\n        dataframe[\"s3_slow_ma\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], self.s3_ma_slow) / ta.EMA(\n            dataframe[\"volume\"], self.s3_ma_slow\n        )\n\n        # Volume weighted MACD\n        dataframe[\"fastMA\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], 12) / ta.EMA(dataframe[\"volume\"], 12)\n        dataframe[\"slowMA\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], 26) / ta.EMA(dataframe[\"volume\"], 26)\n        dataframe[\"vwmacd\"] = dataframe[\"fastMA\"] - dataframe[\"slowMA\"]\n        dataframe[\"signal\"] = ta.EMA(dataframe[\"vwmacd\"], 9)\n        dataframe[\"hist\"] = dataframe[\"vwmacd\"] - dataframe[\"signal\"]\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # basic buy methods to keep the strategy simple\n\n        if self.buy_signal_1:\n            conditions = [\n                dataframe[\"vwmacd\"] < dataframe[\"signal\"],\n                dataframe[\"low\"] < dataframe[\"s1_ema_xxl\"],\n                dataframe[\"close\"] > dataframe[\"s1_ema_xxl\"],\n                qtpylib.crossed_above(dataframe[\"s1_ema_sm\"], dataframe[\"s1_ema_md\"]),\n                dataframe[\"s1_ema_xs\"] < dataframe[\"s1_ema_xl\"],\n                dataframe[\"volume\"] > 0,\n            ]\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"buy\", \"buy_tag\"]] = (1, \"buy_signal_1\")\n\n        if self.buy_signal_2:\n            conditions = [\n                qtpylib.crossed_above(dataframe[\"s2_fib_lower_band\"], dataframe[\"s2_bb_lower_band\"]),\n                dataframe[\"close\"] < dataframe[\"s2_ema\"],\n                dataframe[\"volume\"] > 0,\n            ]\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"buy\", \"buy_tag\"]] = (1, \"buy_signal_2\")\n\n        if self.buy_signal_3:\n            conditions = [\n                dataframe[\"low\"] < dataframe[\"s3_bb_lowerband\"],\n                dataframe[\"high\"] > dataframe[\"s3_slow_ma\"],\n                dataframe[\"high\"] < dataframe[\"s3_ema_long\"],\n                dataframe[\"volume\"] > 0,\n            ]\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"buy\", \"buy_tag\"]] = (1, \"buy_signal_3\")\n\n        if not all([self.buy_signal_1, self.buy_signal_2, self.buy_signal_3]):\n            dataframe.loc[(), \"buy\"] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # This is essentailly ignored as we're using strict ROI / Stoploss / TTP sale scenarios\n        dataframe.loc[(), \"sell\"] = 0\n        return dataframe\n\n    def custom_stoploss(\n        self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n\n        if current_profit > 0.2:\n            return 0.04\n        if current_profit > 0.1:\n            return 0.03\n        if current_profit > 0.06:\n            return 0.02\n        if current_profit > 0.03:\n            return 0.01\n\n        # Let's try to minimize the loss\n        if current_profit <= -0.10:\n            if trade.open_date_utc + timedelta(hours=60) < current_time:\n                # After 60H since buy\n                return current_profit / 1.75\n\n        if current_profit <= -0.08:\n            if trade.open_date_utc + timedelta(hours=120) < current_time:\n                # After 120H since buy\n                return current_profit / 1.70\n\n        return -1\n"
  },
  {
    "path": "strategies/AverageStrategy/AverageStrategy.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass AverageStrategy(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n        buys and sells on crossovers - doesn't really perfom that well and its just a proof of concept\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.5\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.2\n\n    # Optimal timeframe for the strategy\n    timeframe = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['maShort'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['maMedium'] = ta.EMA(dataframe, timeperiod=21)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['maShort'], dataframe['maMedium'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['maMedium'], dataframe['maShort'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/AwesomeMacd/AwesomeMacd.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass AwesomeMacd(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AwesomeMacd.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['macd'] > 0) &\n                    (dataframe['ao'] > 0) &\n                    (dataframe['ao'].shift() < 0)\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['macd'] < 0) &\n                    (dataframe['ao'] < 0) &\n                    (dataframe['ao'].shift() > 0)\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BBMod1/BBMod1.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nfrom datetime import datetime\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, VIDYA\n\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n    \"\"\"\n    Rolling Percentage Change Maximum across interval.\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param method: High to Low / Open to Close\n    :param length: int The length to look back\n    \"\"\"\n    if method == 'HL':\n        return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe[\n            'low'].rolling(length).min()\n    elif method == 'OC':\n        return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe[\n            'close'].rolling(length).min()\n    else:\n        raise ValueError(f\"Method {method} not defined!\")\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the\n       high and low of the past N days (for a given N). It was developed by a publisher and promoter of trading\n       materials, Larry Williams.Its purpose is to tell whether a stock or commodity market is trading near the high or\n       the low, or somewhere in between,of its recent trading range.The oscillator is on a negative scale, from\n       âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    wr = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return wr * -100\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (\n                dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\ndef vmap_b(dataframe, window_size=20, num_of_std=1):\n    df = dataframe.copy()\n    df['vwap'] = qtpylib.rolling_vwap(df, window=window_size)\n    rolling_std = df['vwap'].rolling(window=window_size).std()\n    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)\n    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)\n    return df['vwap_low'], df['vwap'], df['vwap_high']\n\n\ndef top_percent_change(dataframe: DataFrame, length: int) -> float:\n    \"\"\"\n    Percentage change of the current close from the range maximum Open price\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param length: int The length to look back\n    \"\"\"\n    if length == 0:\n        return (dataframe['open'] - dataframe['close']) / dataframe['close']\n    else:\n        return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n\nclass BBMod1(IStrategy):\n    \"\"\"\n        BBMod1 modified from BB_RPB_TSL ( https://github.com/jilv220/BB_RPB_TSL )\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade\n        -notes.html )RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff\n        /blob/main/user_data/strategies/TheRealPullbackV2.py )The trailing custom stoploss taken from BigZ04_TSL from\n        Perkmeister ( modded by ilya )I modified it to better suit my taste and added Hyperopt for this strategy.\n    \"\"\"\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        # rng\n        \"buy_closedelta\": 12.148,\n        # rng\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        \"buy_ewo_high_2\": 4.179,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.01889,\n        \"buy_clucha_bbdelta_tail\": 0.72235,\n        \"buy_clucha_close_bblower\": 0.0127,\n        \"buy_clucha_closedelta_close\": 0.00916,\n        \"buy_clucha_rocr_1h\": 0.79492,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_39_ema\": 0.912,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n\n        \"high_offset_2\": 0.997,\n\n        \"pHSL\": -0.99,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.05,\n        \"pSL_1\": 0.017,\n        \"pSL_2\": 0.045,\n    }\n\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n    startup_candle_count = 120\n\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'emergencysell': 'limit',\n        'forcebuy': \"limit\",\n        'forcesell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    lower_trailing_list = [\"vwap\", \"clucHA\", \"clucHA2\", \"nfi_38\", \"nfi7_33\", \"nfi7_37\", \"cofi\"]\n\n    ############################################################################\n\n    # Buy params\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize=is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize=is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize=is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize=is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize=is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize=is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize=is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize=is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize=False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize=is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize=is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942, optimize=is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize=is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize=is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize=False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize=is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize=is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize=is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942, optimize=is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084, optimize=is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize=is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize=is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970, optimize=is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087, optimize=is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize=is_optimize_ewo_2)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087, optimize=is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05, optimize=is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0, optimize=is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0, optimize=is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5, optimize=is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60, optimize=is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01, 0.05, default=0.02206, optimize=is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize=is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize=is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize=is_optimize_clucha)\n    buy_clucha_close_bblower = DecimalParameter(0.0005, 0.02, default=0.00799, optimize=is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97, optimize=is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize=is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize=is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize=is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize=is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5, optimize=is_optimize_cofi_protection)\n    buy_cofi_r14 = DecimalParameter(-100, -44, default=-60, optimize=is_optimize_cofi_protection)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97, optimize=is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize=is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5, optimize=is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60, optimize=is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97, optimize=is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12, 12, default=0, optimize=is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50, optimize=is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_39 = True\n    buy_nfix_39_ema = DecimalParameter(0.9, 1.2, default=0.97, optimize=is_optimize_nfix_39)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5, optimize=is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60, optimize=is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize=is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize=is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize=is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize=is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize=is_optimize_check)\n\n    # Sell params\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize=False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize=is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default=0.024, optimize=is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987, optimize=is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05, optimize=is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05, optimize=is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0, optimize=is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0, optimize=is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5, optimize=is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60, optimize=is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0, optimize=is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5, optimize=is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20, optimize=is_optimize_cti_r)\n\n    # rng sell\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] = (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) +\n                                  ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) /\n                                      informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = t3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = (\n                    (informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (\n                        informative_1h['close'] > informative_1h['open']))\n\n        return informative_1h\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        stoploss = self.pHSL.value\n        pf_1 = self.pPF_1.value\n        sl_1 = self.pSL_1.value\n        pf_2 = self.pPF_2.value\n        sl_2 = self.pSL_2.value\n\n        buy_tag = ''\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        if len(buy_tags) == 1:\n            for i in self.lower_trailing_list:\n                if i in buy_tags:\n                    if current_profit >= 0.019:\n                        break\n                    elif current_profit >= 0.01:\n                        return 0.009\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if current_profit > pf_2:\n            sl_profit = sl_2 + (current_profit - pf_2)\n        elif current_profit > pf_1:\n            sl_profit = sl_1 + ((current_profit - pf_1) * (sl_2 - sl_1) / (pf_2 - pf_1))\n        else:\n            sl_profit = stoploss\n\n        # Only for hyperopt invalid return\n        if sl_profit >= current_profit:\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n\n        buy_tag = ''\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        if current_profit >= 0.01 and len(buy_tags) == 1:\n            for i in self.lower_trailing_list:\n                if i in buy_tags:\n                    return None\n\n        if current_profit >= 0.019:\n            return None\n\n        if 0.019 > current_profit >= 0.0:\n            if (last_candle['cti'] > self.sell_cti_r_cti.value) and (last_candle['r_14'] > self.sell_cti_r_r.value):\n                return f\"sell_profit_cti_r_0_1( {buy_tag})\"\n\n            elif buy_tag in ['nfix_39 ']:   # handle nfix_39 buy condition\n                if (\n                        (last_candle['fisher'] > 0.39075)\n                        and (last_candle['ha_high'] <= previous_candle_1['ha_high'])\n                        and (previous_candle_1['ha_high'] <= previous_candle_2['ha_high'])\n                        and (last_candle['ha_close'] <= previous_candle_1['ha_close'])\n                        and (last_candle['ema_4'] > last_candle['ha_close'])\n                        and (last_candle['ha_close'] * 0.99754 > last_candle['bb_middleband2'])\n                ):\n                    return f\"sell_scalp( {buy_tag})\"\n\n        # when loss is -,use sell signal.\n        if (\n                (current_profit < 0.0)\n                and (last_candle['close'] > last_candle['sma_9'])\n                and (last_candle['close'] > last_candle['ema_24'] * self.high_offset_2.value)\n                and (last_candle['rsi'] > 50)\n                and (last_candle['rsi_fast'] > last_candle['rsi_slow'])\n        ):\n            return f\"sell_offset( {buy_tag})\"\n\n        if (\n                (current_profit < 0.0)\n                and (last_candle['close'] > last_candle['ema_49'] * 1.006)\n        ):\n            return f\"sell_offset2( {buy_tag})\"\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame) -> DataFrame:\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # Other BB checks\n        dataframe['bb_width'] = (\n                    (dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] = (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(\n            dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_24'] = ta.EMA(dataframe, timeperiod=24)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_49'] = ta.EMA(dataframe, timeperiod=49)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        # BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, ma_type=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = t3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] = (dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2']) / dataframe[\n            'bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # vmap indicators\n        vwap_low, vwap, vwap_high = vmap_b(dataframe, 20, 1)\n        dataframe['vwap_low'] = vwap_low\n        dataframe['tcp_percent_4'] = top_percent_change(dataframe, 4)\n\n        return dataframe\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        # is_sqz_off = (\n        #         (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n        #         (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n        #     )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * 17.922 / 1000) &  # use origin bb_rpb_tsl value\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                              # from NFI next gen, credit goes to @iterativ\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000)\n            )\n\n        is_local_uptrend2 = (  # use origin bb_rpb_tsl value\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * 0.026) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * 17.922 / 1000)\n        )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000)\n            )\n\n        is_ewo = (                                                                                    # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        # is_ewo_2 = (\n        #         (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n        #         (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n        #         (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n        #         (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n        #         (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n        #     )\n\n        # is_r_deadfish = (                                                                             # reverse deadfish\n        #         (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n        #         (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n        #         (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n        #         (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n        #         (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n        #         (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n        #     )\n\n        is_clucha = (\n                (dataframe['rocr_1h'].gt(self.buy_clucha_rocr_1h.value)) &\n                (dataframe['bb_lowerband2_40'].shift().gt(0)) &\n                (dataframe['bb_delta_cluc'].gt(dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value)) &\n                (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.buy_clucha_closedelta_close.value)) &\n                (dataframe['tail'].lt(dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value)) &\n                (dataframe['ha_close'].lt(dataframe['bb_lowerband2_40'].shift())) &\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n        )\n\n        is_clucha2 = (\n                (dataframe['rocr_1h'].gt(self.buy_clucha_rocr_1h.value)) &\n                (dataframe['ha_close'] < dataframe['ema_slow']) &\n                (dataframe['ha_close'] < self.buy_clucha_close_bblower.value * dataframe['bb_lowerband2_40'])\n        )\n\n        is_cofi = (                           # Modified from cofi, credit goes to original author \"slack user CofiBit\"\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_r14.value)\n            )\n\n        # is_gumbo = (                                     # Modified from gumbo1, creadit goes to original author @raph92\n        #         (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n        #         (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n        #         (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n        #         (dataframe['cti'] < self.buy_gumbo_cti.value) &\n        #         (dataframe['r_14'] < self.buy_gumbo_r14.value)\n        #     )\n\n        # is_sqzmom = (          # Modified from squeezeMomentum, credit goes to original author @LazyBear of TradingView\n        #         is_sqz_off &\n        #         (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n        #         (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n        #         (dataframe['linreg_val_20'] < 0) &\n        #         (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n        #         (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n        #         (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n        #     )\n\n        # NFI quick mode, credit goes to @iterativ\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_39 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb_lowerband2_40'].shift().gt(0)) &\n                (dataframe['bb_delta_cluc'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb_delta_cluc'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb_lowerband2_40'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_13'] * self.buy_nfix_39_ema.value)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_33 = (\n                (dataframe['moderi_96']) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.988)) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi'] < 32.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfi7_37 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n\n        is_vwap = (\n                (dataframe['close'] < dataframe['vwap_low']) &\n                (dataframe['tcp_percent_4'] > 0.04) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi'] < 35) &\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60) &\n                (dataframe['volume'] > 0)\n        )\n\n        # Additional Check\n        is_bb_checked = is_dip & is_break\n\n        # Condition Append\n        conditions.append(is_bb_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_bb_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        # conditions.append(is_ewo_2)                                                 # ~2.86 / 91.5% / 33.31%     D\n        # dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        # conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        # dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucha)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_clucha, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_clucha2)\n        dataframe.loc[is_clucha2, 'buy_tag'] += 'clucHA2 '\n\n        conditions.append(is_cofi)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        # conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        # dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        # conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        # dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_39)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_39, 'buy_tag'] += 'nfix_39 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_33)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfi7_33, 'buy_tag'] += 'nfi7_33 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n\n        conditions.append(is_vwap)\n        dataframe.loc[is_vwap, 'buy_tag'] += 'vwap '\n\n        conditions.append(is_local_uptrend2)\n        dataframe.loc[is_local_uptrend2, 'buy_tag'] += 'local_uptrend2 '\n\n        if conditions:\n            dataframe.loc[\n                            reduce(lambda x, y: x | y, conditions),\n                            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[(dataframe['volume'] > 0), 'sell'] = 0\n        return dataframe\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, ma_type, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    ma_type = int(ma_type)\n    src = int(src)\n\n    mavalue = f'MA_{ma_type}_{length}'\n    atr = f'ATR_{period}'\n\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if ma_type == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif ma_type == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif ma_type == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif ma_type == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif ma_type == 5:\n        mavalue = VIDYA(df, length=length)\n    elif ma_type == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif ma_type == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif ma_type == 8:\n        mavalue = vwma(df, length)\n    elif ma_type == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                            and mavalue[i] <= final_ub[i])\n            else final_lb[i] if (\n                    pm_arr[i - 1] == final_ub[i - 1]\n                    and mavalue[i] > final_ub[i]) else final_lb[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] >= final_lb[i]) else final_ub[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0,\n           lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, ma_type=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\n\ndef t3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n"
  },
  {
    "path": "strategies/BBRSI/BBRSI.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass bbrsi(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.21547444718127343,\n        \"21\": 0.054918778723794665,\n        \"48\": 0.013037720775643222,\n        \"125\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.3603667187598833\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '4h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # plot_config = {\n    #     'main_plot': {\n    #         'tema': {},\n    #         'sar': {'color': 'white'},\n    #     },\n    #     'subplots': {\n    #         \"MACD\": {\n    #             'macd': {'color': 'blue'},\n    #             'macdsignal': {'color': 'orange'},\n    #         },\n    #         \"RSI\": {\n    #             'rsi': {'color': 'red'},\n    #         }\n    #     }\n    # }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger bands\n        bollinger_1sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_upperband_1sd'] = bollinger_1sd['upper']\n        dataframe['bb_lowerband_1sd'] = bollinger_1sd['lower']\n\n        bollinger_4sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband_4sd'] = bollinger_4sd['lower']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 25) &\n                (dataframe['close'] < dataframe['bb_lowerband_1sd'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 95) &\n                (dataframe['close'] > dataframe['bb_upperband_1sd'])\n            ),\n            'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/BBRSI2/BBRSI2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BBRSI2(IStrategy):\n    minimal_roi = {\n        \"0\": 0.30,\n        \"120\": 0.20,\n        \"360\": 0.15,\n        \"720\": 0\n    }\n\n    stoploss = -0.20\n\n    timeframe = '1m'\n\n    trailing_stop = True\n\n    order_types = {\n        \"buy\": \"limit\",\n        \"sell\": \"limit\",\n        \"emergencysell\": \"market\",\n        \"forcebuy\": \"market\",\n        \"forcesell\": \"market\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": True,\n        \"stoploss_on_exchange_interval\": 60,\n        \"stoploss_on_exchange_limit_ratio\": 0.99,\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        # dataframe['bb_upperband'] = bollinger['upper']\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 35)\n                & (dataframe['close'] < dataframe['bb_lowerband'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 75)\n                & (dataframe['close'] > dataframe['bb_middleband'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSI21/BBRSI21.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass BBRSI21(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/BbandRsi.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.22766,\n        \"31\": 0.06155,\n        \"78\": 0.03227,\n        \"105\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.17832\n    trailing_stop_positive_offset = 0.24807\n    trailing_only_offset_is_reached = True\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.30054\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators.\n        Can be a copy of the corresponding method from the strategy,\n        or will be loaded from the strategy.\n        Must align to populate_indicators used (either from this File, or from the strategy)\n        Only used when --spaces does not include buy\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n             #   (dataframe['mfi'] > 16) &\n              #  (dataframe['adx'] > 25) &\n                (dataframe['rsi'] < 21)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators.\n        Can be a copy of the corresponding method from the strategy,\n        or will be loaded from the strategy.\n        Must align to populate_indicators used (either from this File, or from the strategy)\n        Only used when --spaces does not include sell\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['rsi'] > 99)\n                \n                \n                \n          #      (qtpylib.crossed_above(\n           #         dataframe['macdsignal'], dataframe['macd']\n          #      )) &\n          #      (dataframe['fastd'] > 54)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/BBRSI3366/BBRSI3366.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass BBRSI3366(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/BbandRsi.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.09521,\n        \"13\": 0.07341,\n        \"30\": 0.01468,\n        \"85\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.05069\n    trailing_stop_positive_offset = 0.06189\n    trailing_only_offset_is_reached = False\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.33233\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators.\n        Can be a copy of the corresponding method from the strategy,\n        or will be loaded from the strategy.\n        Must align to populate_indicators used (either from this File, or from the strategy)\n        Only used when --spaces does not include buy\n        \"\"\"\n        dataframe.loc[\n            (\n              #  (qtpylib.crossed_above(\n              #          dataframe['close'], dataframe['bb_lowerband'] \n           #     )) &\n              #  (dataframe['close'] < dataframe['bb_lowerband']) &\n             #   (dataframe['mfi'] < 16) &\n              #  (dataframe['adx'] > 25) &\n                (dataframe['rsi'] < 33)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators.\n        Can be a copy of the corresponding method from the strategy,\n        or will be loaded from the strategy.\n        Must align to populate_indicators used (either from this File, or from the strategy)\n        Only used when --spaces does not include sell\n        \"\"\"\n        dataframe.loc[\n            (\n              #  (qtpylib.crossed_above(\n              #          dataframe['close'], dataframe['bb_upperband'] \n             #   )) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['rsi'] > 66) #&\n              #  (qtpylib.crossed_above(\n              #          dataframe['sar'], dataframe['close']\n              #  ))\n                \n                \n          #      (qtpylib.crossed_above(\n           #         dataframe['macdsignal'], dataframe['macd']\n          #      )) &\n          #      (dataframe['fastd'] > 54)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSI4cust/BBRSI4cust.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass BBRSI4cust(IStrategy):\n\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 3\n\n    # Can this strategy go short?\n    can_short: bool = False\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        # \"60\": 0.01,\n        # \"30\": 0.02,\n        \"0\": 0.003\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.1\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the config.\n    use_exit_signal = True\n    exit_profit_only = False\n    ignore_roi_if_entry_signal = False\n\n    # Hyperoptable parameters\n    # buy_rsi = IntParameter(low=25, high=35, default=35, space='buy', optimize=True, load=True)\n    buy_bb = IntParameter(low=1, high=4, default=1, space='buy', optimize=True, load=True)\n    buy_di = IntParameter(low=10, high=20, default=20, space='buy', optimize=True, load=True)\n\n    sell_bb = IntParameter(low=1, high=4, default=1, space='sell', optimize=True, load=True)\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'entry': 'limit',\n        'exit': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'entry': 'gtc',\n        'exit': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'bb_lowerband': {'color': 'blue'},\n            'bb_middleband': {'color': 'orange'},            \n            'bb_upperband': {'color': 'blue'},\n        },\n        'subplots': {\n            \"DI\": {\n                'plus_di': {'color': 'green'},\n                'di_overbought': {'color': 'black'},\n                \n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # Plus Directional Indicator / Movement\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n        dataframe['di_overbought'] = 20\n        \n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=self.buy_bb.value)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=self.sell_bb.value)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n\n\n        return dataframe\n\n    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 30\n                (dataframe['plus_di'] > self.buy_di.value) &  \n                (qtpylib.crossed_below(dataframe['low'], dataframe['bb_lowerband'])) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'enter_long'] = 1\n\n        return dataframe\n\n    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 70\n                (qtpylib.crossed_above(dataframe['high'], dataframe['bb_middleband1'])) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n\n            'exit_long'] = 1\n\n        return dataframe\n\n\n    def custom_exit(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):\n        \"\"\"\n        Sell only when matching some criteria other than those used to generate the sell signal\n        :return: str sell_reason, if any, otherwise None\n        \"\"\"\n        # get dataframe\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n        \n        # get the current candle\n        current_candle = dataframe.iloc[-1].squeeze()\n        \n        # if (qtpylib.crossed_above(current_candle['high'], dataframe['bb_middleband1'])) == True:\n\n        if (qtpylib.crossed_above(current_rate, current_candle['bb_middleband1'])):\n\n            return \"bb_profit_sell\"\n\n        # else, hold\n        return None"
  },
  {
    "path": "strategies/BBRSINaiveStrategy/BBRSINaiveStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BBRSINaiveStrategy(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.1\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'bb_upperband': {'color': 'green'},\n            'bb_midband': {'color': 'orange'},\n            'bb_lowerband': {'color': 'red'},\n        },\n        'subplots': {\n            \"RSI\": {\n                'rsi': {'color': 'yellow'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_midband'] = bollinger['mid']\n        dataframe['bb_lowerband'] = bollinger['lower']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 25) &  # Signal: RSI is greater 25\n                # Signal: price is less than lower bb\n                (dataframe['close'] < dataframe['bb_lowerband'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 70) &  # Signal: RSI is greater 70\n                # Signal: price is greater than mid bb\n                (dataframe['close'] > dataframe['bb_midband'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIOptim2020Strategy/BBRSIOptim2020Strategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass BBRSIOptim2020Strategy(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.336,\n        \"40\": 0.072,\n        \"218\": 0.021,\n        \"459\": 0\n    }\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.331\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger_1sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_middleband_1sd'] = bollinger_1sd['mid']\n\n        bollinger_3sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband_3sd'] = bollinger_3sd['lower']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] > 12) & \n                (dataframe['close'] < dataframe['bb_lowerband_3sd'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] > 96) & \n                (dataframe['close'] > dataframe['bb_middleband_1sd'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIOptimStrategy/BBRSIOptimStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass BBRSIOptimStrategy(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.323,\n        \"107\": 0.097,\n        \"150\": 0.019,\n        \"238\": 0\n    }\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.344\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger_1sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband_1sd'] = bollinger_1sd['lower']\n\n        bollinger_2sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband_2sd'] = bollinger_2sd['lower']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 12) & \n                (dataframe['close'] < dataframe['bb_lowerband_2sd'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 96) & \n                (dataframe['close'] > dataframe['bb_lowerband_1sd'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIOptimizedStrategy/BBRSIOptimizedStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n# Based on the Hyperopt results when running against BBRISHyperopt\nclass BBRSIOptimizedStrategy(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.186,\n        \"37\": 0.074,\n        \"89\": 0.033,\n        \"195\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.295\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'bb_upperband': {'color': 'green'},\n            'bb_midband': {'color': 'orange'},\n            'bb_lowerband': {'color': 'red'},\n        },\n        'subplots': {\n            \"RSI\": {\n                'rsi': {'color': 'yellow'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger bands\n        bollinger_1sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_midband_1sd'] = bollinger_1sd['mid']\n\n        bollinger_3sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband_3sd'] = bollinger_3sd['lower']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] > 38) &  # Signal: RSI is greater 38\n                (dataframe['close'] < dataframe['bb_lowerband_3sd']) # Signal: price is less than lower bb 2sd\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'] > 64) &  # Signal: RSI is greater 88\n                    (dataframe['close'] > dataframe['bb_midband_1sd']) # Signal: price is greater than mid bb\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIS/BBRSIS.py",
    "content": "import talib.abstract as ta\nfrom pandas import DataFrame\nfrom technical.util import resample_to_interval, resampled_merge\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\n\n\nclass BBRSIS(IStrategy):\n    \"\"\"\n    Default Strategy provided by freqtrade bot.\n    You can override it with your own strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy\n    minimal_roi = {\n\t\"0\": 0.30,\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.99\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '5m'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional time in force for orders\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n    \n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicator\n        # ------------------------------------\n        # RSIs\n        dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma200'] = ta.SMA(dataframe, timeperiod=200)\n        \n        dataframe_short = resample_to_interval(dataframe, self.get_ticker_indicator() * 3)\n        dataframe_medium = resample_to_interval(dataframe, self.get_ticker_indicator() * 6)\n        dataframe_long = resample_to_interval(dataframe, self.get_ticker_indicator() * 10)\n        \n        dataframe_short['rsi'] = ta.RSI(dataframe_short, timeperiod=20)\n        dataframe_medium['rsi'] = ta.RSI(dataframe_medium, timeperiod=20)\n        dataframe_long['rsi'] = ta.RSI(dataframe_long, timeperiod=20)\n        \n        dataframe = resampled_merge(dataframe, dataframe_short)\n        dataframe = resampled_merge(dataframe, dataframe_medium)\n        dataframe = resampled_merge(dataframe, dataframe_long)\n        \n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=20)\n        \n        dataframe.fillna(method='ffill', inplace = True)\n        \n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['sma5'] >= dataframe['sma75']) &\n                (dataframe['sma75'] >= dataframe['sma200']) &\n                (dataframe['rsi'] < (dataframe['resample_{}_rsi'.format(self.get_ticker_indicator() * 3)] - 5)) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['rsi'] > dataframe['resample_{}_rsi'.format(self.get_ticker_indicator()*3)] + 5) &\n                (dataframe['rsi'] > dataframe['resample_{}_rsi'.format(self.get_ticker_indicator()*6)]) &\n                (dataframe['rsi'] > dataframe['resample_{}_rsi'.format(self.get_ticker_indicator()*10)]) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIStrategy/BBRSIStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass BBRSIStrategy(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.21547444718127343,\n        \"21\": 0.054918778723794665,\n        \"48\": 0.013037720775643222,\n        \"125\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.3603667187598833\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # plot_config = {\n    #     'main_plot': {\n    #         'tema': {},\n    #         'sar': {'color': 'white'},\n    #     },\n    #     'subplots': {\n    #         \"MACD\": {\n    #             'macd': {'color': 'blue'},\n    #             'macdsignal': {'color': 'orange'},\n    #         },\n    #         \"RSI\": {\n    #             'rsi': {'color': 'red'},\n    #         }\n    #     }\n    # }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger bands\n        bollinger_1sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_upperband_1sd'] = bollinger_1sd['upper']\n        dataframe['bb_lowerband_1sd'] = bollinger_1sd['lower']\n\n        bollinger_4sd = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband_4sd'] = bollinger_4sd['lower']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 25) &\n                (dataframe['close'] < dataframe['bb_lowerband_1sd'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 95) &\n                (dataframe['close'] > dataframe['bb_upperband_1sd'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSITV/BBRSITV.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nfrom freqtrade.strategy import DecimalParameter, IntParameter, stoploss_from_open\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\nclass BBRSITV(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"ewo_high\": 4.86,\n        \"for_ma_length\": 22,\n        \"for_sigma\": 1.74,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"for_ma_length_sell\": 65,\n        \"for_sigma_sell\": 1.895,\n        \"rsi_high\": 72,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.25  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = False  # value loaded from strategy\n    trailing_stop_positive = 0.005  # value loaded from strategy\n    trailing_stop_positive_offset = 0.025  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    protections = [\n        #   {\n        #       \"method\": \"StoplossGuard\",\n        #       \"lookback_period_candles\": 12,\n        #       \"trade_limit\": 1,\n        #       \"stop_duration_candles\": 6,\n        #       \"only_per_pair\": True\n        #   },\n        #   {\n        #       \"method\": \"StoplossGuard\",\n        #       \"lookback_period_candles\": 12,\n        #       \"trade_limit\": 2,\n        #       \"stop_duration_candles\": 6,\n        #       \"only_per_pair\": False\n        #   },\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"MaxDrawdown\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 1,\n            \"stop_duration_candles\": 12,\n            \"max_allowed_drawdown\": 0.2\n        },\n    ]\n\n    ewo_high = DecimalParameter(0, 7.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    for_sigma = DecimalParameter(0, 10.0, default=buy_params['for_sigma'], space='buy', optimize=True)\n    for_sigma_sell = DecimalParameter(0, 10.0, default=sell_params['for_sigma_sell'], space='sell', optimize=True)\n    rsi_high = IntParameter(60, 100, default=sell_params['rsi_high'], space='sell', optimize=True)\n    for_ma_length = IntParameter(5, 80, default=buy_params['for_ma_length'], space='buy', optimize=True)\n    for_ma_length_sell = IntParameter(5, 80, default=sell_params['for_ma_length_sell'], space='sell', optimize=True)\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # //@version=3\n        # study(\" RSI + BB (EMA) + Dispersion (2.0)\", overlay=false)\n        #\n        # // Инициализация параметров\n        # src = input(title=\"Source\", type=source, defval=close) // Устанавливаем тип цены для расчетов\n        src = 'close'\n        # for_rsi = input(title=\"RSI_period\", type=integer, defval=14) // Период для RSI\n        for_rsi = 14\n        # for_ma = input(title=\"Basis_BB\", type=integer, defval=20) // Период для MA внутри BB\n        # for_ma = 20\n        # for_mult = input(title=\"Stdev\", type=integer, defval=2, minval=1, maxval=5) // Число стандартных отклонений для BB\n        for_mult = 2\n        # for_sigma = input(title=\"Dispersion\", type=float, defval=0.1, minval=0.01, maxval=1) // Дисперсия вокруг MA\n        for_sigma = 0.1\n        #\n        # // Условия работы скрипта\n        # current_rsi = rsi(src, for_rsi) // Текущее положение индикатора RSI\n        dataframe['rsi'] = ta.RSI(dataframe[src], for_rsi)\n        dataframe['rsi_4'] = ta.RSI(dataframe[src], 4)\n        if self.config['runmode'].value == 'hyperopt':\n            for for_ma in range(5, 81):\n                # basis = ema(current_rsi, for_ma)\n                dataframe[f'basis_{for_ma}'] = ta.EMA(dataframe['rsi'], for_ma)\n                # dev = for_mult * stdev(current_rsi, for_ma)\n                dataframe[f'dev_{for_ma}'] = ta.STDDEV(dataframe['rsi'], for_ma)\n                # upper = basis + dev\n                #dataframe[f'upper_{for_ma}'] = (dataframe[f'basis_{for_ma}'] + (dataframe[f'dev_{for_ma}'] * for_mult))\n                # lower = basis - dev\n                #dataframe[f'lower_{for_ma}'] = dataframe[f'basis_{for_ma}'] - (dataframe[f'dev_{for_ma}'] * for_mult)\n                # disp_up = basis + ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (сверху)\n                # dataframe[f'disp_up_{for_ma}'] = dataframe[f'basis_{for_ma}'] + ((dataframe[f'upper_{for_ma}'] - dataframe[f'lower_{for_ma}']) * for_sigma)\n                # disp_down = basis - ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (снизу)\n                # dataframe[f'disp_down_{for_ma}'] = dataframe[f'basis_{for_ma}'] - ((dataframe[f'upper_{for_ma}'] - dataframe[f'lower_{for_ma}']) * for_sigma)\n                # color_rsi = current_rsi >= disp_up ? lime : current_rsi <= disp_down ? red : #ffea00 // Текущий цвет RSI, в зависимости от его местоположения внутри BB\n        else:\n            dataframe[f'basis_{self.for_ma_length.value}'] = ta.EMA(dataframe['rsi'], self.for_ma_length.value)\n            dataframe[f'basis_{self.for_ma_length_sell.value}'] = ta.EMA(dataframe['rsi'], self.for_ma_length_sell.value)\n            # dev = for_mult * stdev(current_rsi, for_ma)\n            dataframe[f'dev_{self.for_ma_length.value}'] = ta.STDDEV(dataframe['rsi'], self.for_ma_length.value)\n            dataframe[f'dev_{self.for_ma_length_sell.value}'] = ta.STDDEV(dataframe['rsi'], self.for_ma_length_sell.value)\n\n        #\n        # // Дополнительные линии и заливка для областей для RSI\n        # h1 = hline(70, color=#d4d4d4, linestyle=dotted, linewidth=1)\n        h1 = 70\n        # h2 = hline(30, color=#d4d4d4, linestyle=dotted, linewidth=1)\n        h2 = 30\n        # fill (h1, h2, transp=95)\n        #\n        # // Алерты и условия срабатывания\n        # rsi_Green = crossover(current_rsi, disp_up)\n        # rsi_Red = crossunder(current_rsi, disp_down)\n\n        # alertcondition(condition=rsi_Green,\n        #      title=\"RSI cross Above Dispersion Area\",\n        #      message=\"The RSI line closing crossed above the Dispersion area.\")\n        #\n        # alertcondition(condition=rsi_Red,\n        #      title=\"RSI cross Under Dispersion Area\",\n        #      message=\"The RSI line closing crossed below the Dispersion area\")\n        #\n        # // Результаты и покраска\n        # plot(basis, color=black)\n        # plot(upper, color=#00fff0, linewidth=2)\n        # plot(lower, color=#00fff0, linewidth=2)\n        # s1 = plot(disp_up, color=white)\n        # s2 = plot(disp_down, color=white)\n        # fill(s1, s2, color=white, transp=80)\n        # plot(current_rsi, color=color_rsi, linewidth=2)\n\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # upper = basis + dev\n                # lower = basis - dev\n                # disp_up = basis + ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (сверху)\n                # disp_up = basis + ((basis + dev * for_mult) - (basis - dev * for_mult)) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (сверху)\n                # disp_up = basis + (basis + dev * for_mult - basis + dev * for_mult)) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (сверху)\n                # disp_up = basis + (2 * dev * for_sigma * for_mult) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (сверху)\n                (dataframe['rsi'] < (dataframe[f'basis_{self.for_ma_length.value}'] - (dataframe[f'dev_{self.for_ma_length.value}'] * self.for_sigma.value))) &\n                (dataframe['EWO'] >  self.ewo_high.value) &\n                (dataframe['volume'] > 0)\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    (dataframe['rsi'] > self.rsi_high.value) |\n                    # upper = basis + dev\n                    # lower = basis - dev\n                    # disp_down = basis - ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (снизу)\n                    # disp_down = basis - ((2* dev * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (снизу)\n                    (dataframe['rsi'] > dataframe[f'basis_{self.for_ma_length_sell.value}'] + ((dataframe[f'dev_{self.for_ma_length_sell.value}'] * self.for_sigma_sell.value)))\n                ) &\n                (dataframe['volume'] > 0)\n\n            ),\n            'sell'] = 1\n        return dataframe\n\nclass BBRSITV4(BBRSITV):\n    minimal_roi = {\n        \"0\": 0.07\n    }\n    ignore_roi_if_buy_signal = True\n    startup_candle_count = 400\n\n    stoploss = -0.3  # value loaded from strategy\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < (dataframe[f'basis_{self.for_ma_length.value}'] - (dataframe[f'dev_{self.for_ma_length.value}'] * self.for_sigma.value)))\n                &\n                (\n                    (\n                        (dataframe['EWO'] > self.ewo_high.value)\n                        &\n                        (dataframe['EWO'] < 10)\n                    )\n                    |\n                    (\n                        (dataframe['EWO'] >= 10)\n                        &\n                        (dataframe['rsi'] < 40)\n                    )\n                )\n                &\n                (dataframe['rsi_4'] < 25)\n                &\n                (dataframe['volume'] > 0)\n                # &\n                # (dataframe[\"roc_bbwidth_max\"] < 70)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\nclass BBRSITV1(BBRSITV):\n    \"\"\"\n    2021-07-01 00:00:00 -> 2021-09-28 00:00:00 | Max open trades : 4\n============================================================================= STRATEGY SUMMARY =============================================================================\n|              Strategy |   Buys |   Avg Profit % |   Cum Profit % |   Tot Profit USDT |   Tot Profit % |   Avg Duration |   Win  Draw  Loss  Win% |              Drawdown |\n|-----------------------+--------+----------------+----------------+-------------------+----------------+----------------+-------------------------+-----------------------|\n|         Elliotv8_08SL |    906 |           0.92 |         832.19 |         19770.304 |         659.01 |        0:38:00 |   717     0   189  79.1 | 2020.917 USDT  79.84% |\n| SMAOffsetProtectOptV1 |    417 |           1.33 |         555.91 |          8423.809 |         280.79 |        1:44:00 |   300     0   117  71.9 | 1056.072 USDT  61.08% |\n|               BBRSITV |    309 |           1.10 |         340.17 |          3869.800 |         128.99 |        2:53:00 |   223     0    86  72.2 |  261.984 USDT  25.84% |\n============================================================================================================================================================================\n    \"\"\"\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"ewo_high\": 4.964,\n        \"for_ma_length\": 12,\n        \"for_sigma\": 2.313,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"for_ma_length_sell\": 78,\n        \"for_sigma_sell\": 1.67,\n        \"rsi_high\": 60,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.25  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = False  # value loaded from strategy\n    trailing_stop_positive = 0.005  # value loaded from strategy\n    trailing_stop_positive_offset = 0.025  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\nclass BBRSITV2(BBRSITV):\n    \"\"\"\n    2021-07-01 00:00:00 -> 2021-09-28 00:00:00 | Max open trades : 4\n============================================================================= STRATEGY SUMMARY =============================================================================\n|              Strategy |   Buys |   Avg Profit % |   Cum Profit % |   Tot Profit USDT |   Tot Profit % |   Avg Duration |   Win  Draw  Loss  Win% |              Drawdown |\n|-----------------------+--------+----------------+----------------+-------------------+----------------+----------------+-------------------------+-----------------------|\n|         Elliotv8_08SL |    906 |           0.92 |         832.19 |         19770.304 |         659.01 |        0:38:00 |   717     0   189  79.1 | 2020.917 USDT  79.84% |\n| SMAOffsetProtectOptV1 |    417 |           1.33 |         555.91 |          8423.809 |         280.79 |        1:44:00 |   300     0   117  71.9 | 1056.072 USDT  61.08% |\n|               BBRSITV |    486 |           1.11 |         537.58 |          7689.862 |         256.33 |        5:01:00 |   287     0   199  59.1 | 1279.461 USDT  75.45% |\n============================================================================================================================================================================\n    \"\"\"\n    # Buy hyperspace params:\n    buy_params = {\n        \"ewo_high\": 4.85,\n        \"for_ma_length\": 11,\n        \"for_sigma\": 2.066,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"for_ma_length_sell\": 61,\n        \"for_sigma_sell\": 1.612,\n        \"rsi_high\": 87,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.25  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = False  # value loaded from strategy\n    trailing_stop_positive = 0.005  # value loaded from strategy\n    trailing_stop_positive_offset = 0.025  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\n\nclass BBRSITV3(BBRSITV):\n    \"\"\"\n\n    2021-07-01 00:00:00 -> 2021-09-28 00:00:00 | Max open trades : 4\n    ============================================================================== STRATEGY SUMMARY =============================================================================\n    |              Strategy |   Buys |   Avg Profit % |   Cum Profit % |   Tot Profit USDT |   Tot Profit % |   Avg Duration |   Win  Draw  Loss  Win% |               Drawdown |\n    |-----------------------+--------+----------------+----------------+-------------------+----------------+----------------+-------------------------+------------------------|\n    |         Elliotv8_08SL |    906 |           0.92 |         832.19 |         19770.304 |         659.01 |        0:38:00 |   717     0   189  79.1 | 2020.917 USDT   79.84% |\n    | SMAOffsetProtectOptV1 |    417 |           1.33 |         555.91 |          8423.809 |         280.79 |        1:44:00 |   300     0   117  71.9 | 1056.072 USDT   61.08% |\n    |               BBRSITV |    627 |           1.14 |         715.85 |         12998.605 |         433.29 |        5:35:00 |   374     0   253  59.6 | 2294.408 USDT  100.60% |\n    =============================================================================================================================================================================\"\"\"\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"ewo_high\": 4.86,\n        \"for_ma_length\": 22,\n        \"for_sigma\": 1.74,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"for_ma_length_sell\": 65,\n        \"for_sigma_sell\": 1.895,\n        \"rsi_high\": 72,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.25  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.078\n    trailing_stop_positive_offset = 0.095\n    trailing_only_offset_is_reached = False\n    \nclass BBRSITV5(BBRSITV):\n    minimal_roi = {\n        \"0\": 0.04\n    }\n    ignore_roi_if_buy_signal = True\n    startup_candle_count = 400\n    use_custom_stoploss = True\n\n    stoploss = -0.3  # value loaded from strategy\n    sell_params = {\n        ##\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.01,\n        \"pPF_2\": 0.048,\n        \"pSL_1\": 0.009,\n        \"pSL_2\": 0.043,\n    }\n    \n    is_optimize_trailing = True\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < (dataframe[f'basis_{self.for_ma_length.value}'] - (dataframe[f'dev_{self.for_ma_length.value}'] * self.for_sigma.value)))\n                &\n                (\n                    (\n                        (dataframe['EWO'] > self.ewo_high.value)\n                        &\n                        (dataframe['EWO'] < 10)\n                    )\n                    |\n                    (\n                        (dataframe['EWO'] >= 10)\n                        &\n                        (dataframe['rsi'] < 40)\n                    )\n                )\n                &\n                (dataframe['rsi_4'] < 25)\n                &\n                (dataframe['volume'] > 0)\n                # &\n                # (dataframe[\"roc_bbwidth_max\"] < 70)\n            ),\n            'buy'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIoriginal/BBRSIoriginal.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\nimport talib.abstract as ta\nimport pandas\nfrom pandas import DataFrame\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\npandas.set_option(\"display.precision\",8)\n\nclass BBRSIoriginal(IStrategy):\n    \"\"\"\n    Default Strategy provided by freqtrade bot.\n    You can override it with your own strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy\n    minimal_roi = {\n    \"0\": 0.09638,\n    \"19\": 0.03643,\n    \"69\": 0.01923,\n    \"120\": 0\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.36828\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional time in force for orders\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicator\n        # ------------------------------------\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n\n                #(dataframe['rsi'] > 12) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband3'] )\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 75) &\n                (dataframe[\"close\"] > dataframe['bb_middleband'] )\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBRSIv2/BBRSIv2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n#\n\n\nclass BBRSIv2(IStrategy):\n    \"\"\"\n    author@: Gert Wohlgemuth\n    converted from:\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/BbandRsi.cs\n    Customized by StrongManBR\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.3\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.99\n    \n    process_only_new_candles = True  \n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset= 0.01\n    ignore_roi_if_buy_signal = False    \n    use_custom_stoploss = True\n  \n\n    startup_candle_count: int = 144\n\n    # Optimal timeframe for the strategy\n    timeframe = '15m'\n\n    plot_config = {\n        'main_plot': {\n            'bb_lowerband': {},\n            'bb_middleband': {},\n            'bb_upperband': {},\n            'tema': {}\n        },\n        'subplots': {\n            \"RSI\": {\n                'rsi': {'color': 'blue'}\n            },\n             \"MARKET\": {\n                'close_max': {'color': 'green', 'type': 'bar'},\n                'close_min': {'color': 'red','type': 'bar'},\n                'dropped_by_percent': {'color': 'blue','type': 'bar'},\n                'pumped_by_percent': {'color': 'orange','type': 'bar'}\n            }            \n       \n            \n        }\n    }\n    \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            sl_new = 0.001\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.01\n\n        return sl_new\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # Custom\n        # TEMA - Triple Exponential Moving Average\n        dataframe[\"tema\"] = ta.TEMA(dataframe, timeperiod=9, price=\"close\")\n        \n        \n        dataframe['close_max'] = dataframe['close'].rolling(window=60).max() #5h        \n        dataframe['dropped_by_percent'] = (1 - (dataframe['close'] / dataframe['close_max']))        \n        dataframe['close_min'] = dataframe['close'].rolling(window=60).min() #5h                        \n        dataframe['pumped_by_percent'] =   (dataframe['high'] - dataframe['close_min'])/ dataframe['high']\n\n        return dataframe \n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'buy_tag'] = ''\n        conditions = []\n#        dont_buy_conditions = []     \n        \n        RB1 = ( \n               \n                (qtpylib.crossed_above(dataframe['rsi'], 35)) &  # Signal: RSI crosses above 35\n                (dataframe['close'] < dataframe['bb_lowerband']) \n                )\n        dataframe.loc[RB1, 'buy_tag'] += 'RB1:BB_LOWER '        \n        conditions.append(RB1)\n        \n        RB2 = ( \n                (dataframe['rsi'] < 23) &\n                (dataframe[\"tema\"] < dataframe[\"bb_lowerband\"]) &  \n                (dataframe[\"tema\"] > dataframe[\"tema\"].shift(1)) &  \n                (dataframe[\"volume\"] > 0)  # Make sure Volume is not 0 \n                \n                )\n        dataframe.loc[RB2, 'buy_tag'] += 'RB2:RSI<23_ '        \n        conditions.append(RB2)\n        \n        \n        \n        if conditions:\n\n            dataframe.loc[ \n                           #is_bull &                    \n                           #is_additional_check & \n                           #can_buy &\n                           #is_live_data & \n                           reduce(lambda x, y: x | y, conditions),'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'exit_tag'] = ''\n        #sell_now = []     \n        \n        RS1 = ( dataframe['rsi'] >70 )\n        dataframe.loc[RS1, 'exit_tag'] += 'RS1:RSI>70 '                \n        conditions.append(RS1)\n        \n        RS2 = ( dataframe[\"high\"] >  dataframe[\"close_max\"])                                  \n        dataframe.loc[RS2, 'exit_tag'] += 'RS2:>CLOSE_MAX '        \n        conditions.append(RS2)\n        \n        if conditions:\n\n            dataframe.loc[ \n                          \n                           #can_sell &\n                           #is_live_data & \n                           reduce(lambda x, y: x | y, conditions),'sell'] = 1\n\n        \n\n        return dataframe"
  },
  {
    "path": "strategies/BB_RPB_TSL/BB_RPB_TSL.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, ichimoku\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.983,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        \"buy_ewo_high_2\": 4.179,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.049,\n        \"buy_clucha_bbdelta_tail\": 1.146,\n        \"buy_clucha_close_bblower\": 0.018,\n        \"buy_clucha_closedelta_close\": 0.017,\n        \"buy_clucha_rocr_1h\": 0.526,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_39_ema\": 0.912,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n    }\n\n    minimal_roi = {\n        \"0\": 0.205,\n        \"81\": 0.038,\n        \"292\": 0.005,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize = is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12 , 12, default= 0 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50 , optimize = is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_39 = True\n    buy_nfix_39_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_nfix_39)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    ## Slippage params\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 1.00, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5 , optimize = is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20 , optimize = is_optimize_cti_r)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        # Pump protections\n        #informative_1h['hl_pct_change_48'] = range_percent_change(informative_1h, 'HL', length=48)\n        #informative_1h['hl_pct_change_36'] = range_percent_change(informative_1h, 'HL', length=36)\n        #informative_1h['hl_pct_change_24'] = range_percent_change(informative_1h, 'HL', length=24)\n        #informative_1h['hl_pct_change_12'] = range_percent_change(informative_1h, 'HL', length=12)\n        #informative_1h['hl_pct_change_6'] = range_percent_change(informative_1h, 'HL', length=6)\n\n        return informative_1h\n\n    ############################################################################\n\n    ### Custom functions\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        # sell trail\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi'] < 46.0):\n                return f\"sell_profit_t_0_1( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 32.0):\n                return f\"sell_profit_t_0_2( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi'] < 48.0):\n                return f\"sell_profit_t_0_3( {buy_tag})\"\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 39.0):\n                return f\"sell_profit_t_1_1( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return f\"sell_profit_t_1_2( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return f\"sell_profit_t_1_4( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return f\"sell_profit_t_1_5( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return f\"sell_profit_t_1_7( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_1h'] < 50.0):\n                return f\"sell_profit_t_1_9( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return f\"sell_profit_t_1_10( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 42.0):\n                return f\"sell_profit_t_1_11( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return f\"sell_profit_t_1_12( {buy_tag})\"\n\n        # sell cti_r\n        if 0.012 > current_profit >= 0.0 :\n            if (last_candle['cti'] > self.sell_cti_r_cti.value) and (last_candle['r_14'] > self.sell_cti_r_r.value):\n                return f\"sell_profit_t_cti_r_0_1( {buy_tag})\"\n\n        # main sell\n        if current_profit > 0.02:\n            if (last_candle['momdiv_sell_1h'] == True):\n                return f\"signal_profit_q_momdiv_1h( {buy_tag})\"\n            if (last_candle['momdiv_sell'] == True):\n                return f\"signal_profit_q_momdiv( {buy_tag})\"\n            if (last_candle['momdiv_coh'] == True):\n                return f\"signal_profit_q_momdiv_coh( {buy_tag})\"\n\n        # sell bear\n        if last_candle['close'] < last_candle['ema_200']:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi'] < 34.0) and (last_candle['cmf'] < 0.0):\n                    return f\"sell_profit_u_bear_1_1( {buy_tag})\"\n                elif (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.4):\n                    return f\"sell_profit_u_bear_1_2( {buy_tag})\"\n\n        # sell quick\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi'] > 80.0):\n            return f\"signal_profit_q_1( {buy_tag})\"\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return f\"signal_profit_q_2( {buy_tag})\"\n\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return f\"signal_profit_q_pmax_bull( {buy_tag})\"\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return f\"signal_profit_q_pmax_bear( {buy_tag})\"\n\n        # sell scalp\n        if (current_profit > 0 and buy_tag in [ 'nfix_39 ']):\n            if (\n                    (current_profit > 0)\n                    and (last_candle['fisher'] > 0.39075)\n                    and (last_candle['ha_high'] <= previous_candle_1['ha_high'])\n                    and (previous_candle_1['ha_high'] <= previous_candle_2['ha_high'])\n                    and (last_candle['ha_close'] <= previous_candle_1['ha_close'])\n                    and (last_candle['ema_4'] > last_candle['ha_close'])\n                    and (last_candle['ha_close'] * 0.99754 > last_candle['bb_middleband2'])\n                ):\n                return f\"sell_scalp( {buy_tag})\"\n\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * 0.988)\n                and (last_candle['cmf'] < -0.046)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.022)\n                and last_candle['rsi'] > previous_candle_1['rsi']\n                and (last_candle['rsi'] > (last_candle['rsi_1h'] + 10.0))\n            ):\n            return f\"sell_stoploss_u_e_1( {buy_tag})\"\n\n        # stoploss - deadfish\n        if (    (current_profit < self.sell_deadfish_profit.value)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['bb_width'] < self.sell_deadfish_bb_width.value)\n                and (last_candle['close'] > last_candle['bb_middleband2'] * self.sell_deadfish_bb_factor.value)\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_deadfish_volume_factor.value)\n            ):\n            return f\"sell_stoploss_deadfish( {buy_tag})\"\n\n        # stoploss - bleeding\n        #if (    (current_profit < -0.05)\n                #and (last_candle['close'] < last_candle['ema_200'])\n                #and (last_candle['cti_mean_24'] < self.sell_bleeding_cti.value)\n                #and (last_candle['r_14_mean_24'] < self.sell_bleeding_r14.value)\n                #and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_bleeding_volume_factor.value)\n            #):\n            #return f\"sell_stoploss_bleeding( {buy_tag})\"\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        return dataframe\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_sqzOff = (\n                (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n                (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen, credit goes to @iterativ\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                )\n            )\n\n        is_cofi = (                                                                         # Modified from cofi, credit goes to original author \"slack user CofiBit\"\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_r14.value)\n            )\n\n        is_gumbo = (                                                                        # Modified from gumbo1, creadit goes to original author @raph92\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value)\n            )\n\n        is_sqzmom = (                                                                       # Modified from squeezeMomentum, credit goes to original author @LazyBear of TradingView\n                (is_sqzOff) &\n                (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n                (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n                (dataframe['linreg_val_20'] < 0) &\n                (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n                (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n                (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n            )\n\n        # NFI quick mode, credit goes to @iterativ\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_39 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb_lowerband2_40'].shift().gt(0)) &\n                (dataframe['bb_delta_cluc'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb_delta_cluc'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb_lowerband2_40'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_13'] * self.buy_nfix_39_ema.value)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_33 = (\n                (dataframe['moderi_96']) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.988)) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi'] < 32.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfi7_37 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                 # ~2.86 / 91.5% / 33.31%     D\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_39)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_39, 'buy_tag'] += 'nfix_39 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_33)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfi7_33, 'buy_tag'] += 'nfi7_33 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[ (dataframe['volume'] > 0), 'sell' ] = 0\n\n        return dataframe\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_2/BB_RPB_TSL_2.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, ichimoku\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL_2(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.668,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        \"buy_ewo_high_2\": 4.179,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.049,\n        \"buy_clucha_bbdelta_tail\": 1.146,\n        \"buy_clucha_close_bblower\": 0.018,\n        \"buy_clucha_closedelta_close\": 0.017,\n        \"buy_clucha_rocr_1h\": 0.526,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_39_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_nfix_39_cti\": -0.105,\n        \"buy_nfix_39_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.05,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37\n    }\n\n    minimal_roi = {\n        \"0\": 0.205,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '3m'\n    inf_5m = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.15\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    is_optimize_ewo2_protection = False\n    buy_ewo2_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_ewo2_protection)\n    buy_ewo2_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_ewo2_protection)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize=is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize=is_optimize_clucha)\n    buy_clucha_close_bblower = DecimalParameter(0.001, 0.05, default=0.03669, optimize=is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize=is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize=is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_39_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_nfix_39_protection = False\n    buy_nfix_39_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_39_protection)\n    buy_nfix_39_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_39_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    ## Slippage params\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 0.80, default=0.33, decimals=3, optimize=is_optimize_slip , load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = True)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    ############################################################################\n\n    def informative_pairs(self):\n        informative_pairs = []\n    \n\n        pairs = self.dp.current_whitelist()\n        informative_pairs += [(pair, self.inf_5m) for pair in pairs]\n        informative_pairs += [(pair, self.inf_1h) for pair in pairs]\n\n        return informative_pairs\n\n\n\n    ############################################################################\n\n    ### Custom functions\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # sell trail\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi'] < 46.0):\n                return 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 32.0):\n                return 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi'] < 48.0):\n                return 'sell_profit_t_0_3'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 39.0):\n                return 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_1h'] < 50.0):\n                return 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 42.0):\n                return 'sell_profit_t_1_11'\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return 'sell_profit_t_1_12'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv_coh'\n\n        # sell bear\n        if last_candle['close'] < last_candle['ema_200']:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi'] < 34.0) and (last_candle['cmf'] < 0.0):\n                    return 'sell_profit_u_bear_1_1'\n                elif (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.4):\n                    return 'sell_profit_u_bear_1_2'\n\n        # sell quick\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi'] > 80.0):\n            return 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return 'signal_profit_q_2'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return 'signal_profit_q_pmax_bull'\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return 'signal_profit_q_pmax_bear'\n\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * 0.988)\n                and (last_candle['cmf'] < -0.046)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.022)\n                and last_candle['rsi'] > previous_candle_1['rsi']\n                and (last_candle['rsi'] > (last_candle['rsi_1h'] + 10.0))\n        ):\n            return 'sell_stoploss_u_e_1'\n\n        # stoploss - deadfish\n        if (    (current_profit < self.sell_deadfish_profit.value)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['bb_width'] < self.sell_deadfish_bb_width.value)\n                and (last_candle['close'] > last_candle['bb_middleband2'] * self.sell_deadfish_bb_factor.value)\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_deadfish_volume_factor.value)\n            ):\n            return 'sell_stoploss_deadfish'\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            #print(\"open rate is : \" + str(rate))\n            #print(\"last candle close is : \" + str(dataframe['close']))\n            #print(\"slippage is : \" + str(slippage) )\n            #print(\"############################################################################\")\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # Pump protections\n        #informative_1h['hl_pct_change_48'] = range_percent_change(informative_1h, 'HL', length=48)\n        #informative_1h['hl_pct_change_36'] = range_percent_change(informative_1h, 'HL', length=36)\n        #informative_1h['hl_pct_change_24'] = range_percent_change(informative_1h, 'HL', length=24)\n        #informative_1h['hl_pct_change_12'] = range_percent_change(informative_1h, 'HL', length=12)\n        #informative_1h['hl_pct_change_6'] = range_percent_change(informative_1h, 'HL', length=6)\n\n        return informative_1h\n\n    def informative_5m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_5m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_5m)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_5m), window=20, stds=2)\n        informative_5m['bb_lowerband2'] = bollinger2['lower']\n        informative_5m['bb_middleband2'] = bollinger2['mid']\n        informative_5m['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_5m), window=20, stds=3)\n        informative_5m['bb_lowerband3'] = bollinger3['lower']\n        informative_5m['bb_middleband3'] = bollinger3['mid']\n        informative_5m['bb_upperband3'] = bollinger3['upper']\n\n        ### Other BB checks\n        informative_5m['bb_width'] = ((informative_5m['bb_upperband2'] - informative_5m['bb_lowerband2']) / informative_5m['bb_middleband2'])\n        informative_5m['bb_delta'] = ((informative_5m['bb_lowerband2'] - informative_5m['bb_lowerband3']) / informative_5m['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            informative_5m[f'cci_length_{val}'] = ta.CCI(informative_5m, val)\n\n        informative_5m['cci'] = ta.CCI(informative_5m, 26)\n        informative_5m['cci_long'] = ta.CCI(informative_5m, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            informative_5m[f'rmi_length_{val}'] = RMI(informative_5m, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(informative_5m, 15, 20, 2, 2)\n        informative_5m['srsi_fk'] = stoch['fastk']\n        informative_5m['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        informative_5m['closedelta'] = (informative_5m['close'] - informative_5m['close'].shift()).abs()\n\n        # SMA\n        informative_5m['sma_9'] = ta.SMA(informative_5m, timeperiod=9)\n        informative_5m['sma_15'] = ta.SMA(informative_5m, timeperiod=15)\n        informative_5m['sma_21'] = ta.SMA(informative_5m, timeperiod=21)\n        informative_5m['sma_30'] = ta.SMA(informative_5m, timeperiod=30)\n        informative_5m['sma_75'] = ta.SMA(informative_5m, timeperiod=75)\n\n        # CTI\n        informative_5m['cti'] = pta.cti(informative_5m[\"close\"], length=20)\n\n        # CMF\n        informative_5m['cmf'] = chaikin_money_flow(informative_5m, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_5m['close'] / informative_5m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_5m['crsi'] =  (ta.RSI(informative_5m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_5m['close'], 100)) / 3\n\n        # EMA\n        informative_5m['ema_8'] = ta.EMA(informative_5m, timeperiod=8)\n        informative_5m['ema_12'] = ta.EMA(informative_5m, timeperiod=12)\n        informative_5m['ema_13'] = ta.EMA(informative_5m, timeperiod=13)\n        informative_5m['ema_16'] = ta.EMA(informative_5m, timeperiod=16)\n        informative_5m['ema_20'] = ta.EMA(informative_5m, timeperiod=20)\n        informative_5m['ema_26'] = ta.EMA(informative_5m, timeperiod=26)\n        informative_5m['ema_50'] = ta.EMA(informative_5m, timeperiod=50)\n        informative_5m['ema_100'] = ta.EMA(informative_5m, timeperiod=100)\n        informative_5m['ema_200'] = ta.EMA(informative_5m, timeperiod=200)\n\n        # RSI\n        informative_5m['rsi'] = ta.RSI(informative_5m, timeperiod=14)\n        informative_5m['rsi_fast'] = ta.RSI(informative_5m, timeperiod=4)\n        informative_5m['rsi_slow'] = ta.RSI(informative_5m, timeperiod=20)\n\n        # Elliot\n        informative_5m['EWO'] = EWO(informative_5m, 50, 200)\n\n        # Williams %R\n        informative_5m['r_14'] = williams_r(informative_5m, period=14)\n        informative_5m['r_32'] = williams_r(informative_5m, period=32)\n        informative_5m['r_64'] = williams_r(informative_5m, period=64)\n        informative_5m['r_96'] = williams_r(informative_5m, period=96)\n        informative_5m['r_480'] = williams_r(informative_5m, period=480)\n\n        # Volume\n        informative_5m['volume_mean_4'] = informative_5m['volume'].rolling(4).mean().shift(1)\n        informative_5m['volume_mean_12'] = informative_5m['volume'].rolling(12).mean().shift(1)\n        informative_5m['volume_mean_24'] = informative_5m['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        informative_5m['mfi'] = ta.MFI(informative_5m)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(informative_5m)\n        informative_5m['ha_open'] = heikinashi['open']\n        informative_5m['ha_close'] = heikinashi['close']\n        informative_5m['ha_high'] = heikinashi['high']\n        informative_5m['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(informative_5m), window=40, stds=2)\n        informative_5m['bb_lowerband2_40'] = bollinger2_40['lower']\n        informative_5m['bb_middleband2_40'] = bollinger2_40['mid']\n        informative_5m['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        informative_5m['bb_delta_cluc'] = (informative_5m['bb_middleband2_40'] - informative_5m['bb_lowerband2_40']).abs()\n        informative_5m['ha_closedelta'] = (informative_5m['ha_close'] - informative_5m['ha_close'].shift()).abs()\n        informative_5m['tail'] = (informative_5m['ha_close'] - informative_5m['ha_low']).abs()\n        informative_5m['ema_slow'] = ta.EMA(informative_5m['ha_close'], timeperiod=50)\n        informative_5m['rocr'] = ta.ROCR(informative_5m['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(informative_5m, 5, 3, 0, 3, 0)\n        informative_5m['fastd'] = stoch_fast['fastd']\n        informative_5m['fastk'] = stoch_fast['fastk']\n        informative_5m['adx'] = ta.ADX(informative_5m)\n\n        # Profit Maximizer - PMAX\n        informative_5m['pm'], informative_5m['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        informative_5m['source'] = (informative_5m['high'] + informative_5m['low'] + informative_5m['open'] + informative_5m['close'])/4\n        informative_5m['pmax_thresh'] = ta.EMA(informative_5m['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_5m)\n        informative_5m['momdiv_buy'] = mom['momdiv_buy']\n        informative_5m['momdiv_sell'] = mom['momdiv_sell']\n        informative_5m['momdiv_coh'] = mom['momdiv_coh']\n        informative_5m['momdiv_col'] = mom['momdiv_col']\n\n        return informative_5m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        return dataframe\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        informative_5m = self.informative_5m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_5m, self.timeframe, self.inf_5m, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                    (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                    )\n                    |\n                    (\n                        (dataframe['ha_close'] < dataframe['ema_slow']) &\n                        (dataframe['ha_close'] < self.buy_clucha_close_bblower.value * dataframe['bb_lowerband2'])\n                    )\n                )\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_39_r14.value)\n            )\n\n        # NFI quick mode\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_39_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_39_r14.value)\n            )\n\n        # --------------------\n        \n        is_dip_5m = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}_5m'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}_5m'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk_5m'] < self.buy_srsi_fk.value)\n            )\n\n        is_break_5m = (\n\n                (dataframe['bb_delta_5m'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width_5m'] > self.buy_bb_width.value) &\n                (dataframe['closedelta_5m'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3_5m'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend_5m = (                                                                            # from NFI next gen\n                (dataframe['ema_26_5m'] > dataframe['ema_12_5m']) &\n                (dataframe['ema_26_5m'] - dataframe['ema_12_5m'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26_5m'].shift() - dataframe['ema_12_5m'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2_5m'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta_5m'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip_5m = (\n                (dataframe['ema_26_5m'] > dataframe['ema_12_5m']) &\n                (dataframe['ema_26_5m'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26_5m'].shift() - dataframe['ema_12_5m'].shift() > dataframe['open'] / 100) &\n                (dataframe['close_5m'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi_5m'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi_5m'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta_5m'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo_5m = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast_5m'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8_5m'] * self.buy_ema_low.value) &\n                (dataframe['EWO_5m'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16_5m'] * self.buy_ema_high.value) &\n                (dataframe['rsi_5m'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2_5m = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast_5m'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8_5m'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO_5m'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16_5m'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi_5m'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish_5m = (                                                                               # reverse deadfish\n                (dataframe['ema_100_5m'] < dataframe['ema_200_5m'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width_5m'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2_5m'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12_5m'] > dataframe['volume_mean_24_5m'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti_5m'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14_5m'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA_5m = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                    (\n                        (dataframe['bb_lowerband2_40_5m'].shift() > 0) &\n                        (dataframe['bb_delta_cluc_5m'] > dataframe['ha_close_5m'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta_5m'] > dataframe['ha_close_5m'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc_5m'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close_5m'] < dataframe['bb_lowerband2_40_5m'].shift()) &\n                        (dataframe['ha_close_5m'] < dataframe['ha_close_5m'].shift())\n                    )\n                    |\n                    (\n                        (dataframe['ha_close_5m'] < dataframe['ema_slow_5m']) &\n                        (dataframe['ha_close_5m'] < self.buy_clucha_close_bblower.value * dataframe['bb_lowerband2_5m'])\n                    )\n                )\n            )\n\n        is_cofi_5m = (\n                (dataframe['open'] < dataframe['ema_8_5m'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk_5m'], dataframe['fastd_5m'])) &\n                (dataframe['fastk_5m'] < self.buy_fastk.value) &\n                (dataframe['fastd_5m'] < self.buy_fastd.value) &\n                (dataframe['adx_5m'] > self.buy_adx.value) &\n                (dataframe['EWO_5m'] > self.buy_ewo_high.value) &\n                (dataframe['cti_5m'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14_5m'] < self.buy_cofi_39_r14.value)\n            )\n\n        # NFI quick mode\n        is_nfi_13_5m = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30_5m'] * 0.99) &\n                (dataframe['cti_5m'] < -0.92) &\n                (dataframe['EWO_5m'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32_5m = (  # NFIX 26\n                (dataframe['rsi_slow_5m'] < dataframe['rsi_slow_5m'].shift(1)) &\n                (dataframe['rsi_fast_5m'] < 46) &\n                (dataframe['rsi_5m'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15_5m'] * 0.93) &\n                (dataframe['cti_5m'] < -0.9)\n            )\n\n        is_nfi_33_5m = (\n                (dataframe['close'] < (dataframe['ema_13_5m'] * 0.978)) &\n                (dataframe['EWO_5m'] > 8) &\n                (dataframe['cti_5m'] < -0.88) &\n                (dataframe['rsi_5m'] < 32) &\n                (dataframe['r_14_5m'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4_5m'] * 2.5))\n            )\n\n        is_nfi_38_5m = (\n                (dataframe['pm_5m'] > dataframe['pmax_thresh_5m']) &\n                (dataframe['close'] < dataframe['sma_75_5m'] * 0.98) &\n                (dataframe['EWO_5m'] < -4.4) &\n                (dataframe['cti_5m'] < -0.95) &\n                (dataframe['r_14_5m'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5_5m = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75_5m'] * 0.932) &\n                (dataframe['EWO_5m'] > 3.6) &\n                (dataframe['cti_5m'] < -0.9) &\n                (dataframe['r_14_5m'] < -97.0)\n            )\n\n        is_nfix_49_5m = (\n                (dataframe['ema_26_5m'].shift(3) > dataframe['ema_12_5m'].shift(3)) &\n                (dataframe['ema_26_5m'].shift(3) - dataframe['ema_12_5m'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26_5m'].shift(9) - dataframe['ema_12_5m'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20_5m'].shift(3) * 0.916) &\n                (dataframe['rsi_5m'].shift(3) < 32.5) &\n                (dataframe['crsi_5m'].shift(3) > 18.0) &\n                (dataframe['cti_5m'] < self.buy_nfix_39_cti.value) &\n                (dataframe['r_14_5m'] < self.buy_nfix_39_r14.value)\n            )\n        \n        # --------------------\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                # ~2.5 / 89.6% / 33.31%       D\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~7.34 / 86.6% / 100.11%     F\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.07 / 83.2% / 70.22%      F\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        # ----------\n        ## Additional Check\n        is_BB_checked_5m = is_dip_5m & is_break_5m\n\n        ## Condition Append\n        conditions.append(is_BB_checked_5m)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked_5m, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend_5m)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend_5m, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip_5m)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip_5m, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo_5m)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo_5m, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2_5m)                                                # ~2.5 / 89.6% / 33.31%       D\n        dataframe.loc[is_ewo_2_5m, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_r_deadfish_5m)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish_5m, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA_5m)                                               # ~7.34 / 86.6% / 100.11%     F\n        dataframe.loc[is_clucHA_5m, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi_5m)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi_5m, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_13_5m)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13_5m, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32_5m)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32_5m, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33_5m)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33_5m, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38_5m)                                               # ~1.07 / 83.2% / 70.22%      F\n        dataframe.loc[is_nfi_38_5m, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5_5m)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5_5m, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_49_5m)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49_5m, 'buy_tag'] += 'nfix_49 '        \n        # ----------\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[ (dataframe['volume'] > 0), 'sell' ] = 0\n\n        return dataframe\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_BI/BB_RPB_TSL_BI.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, ichimoku\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL_BI(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.668,\n        ##\n        \"buy_bb_width_1h\": 1.074,\n        \"buy_roc_1h\": 4,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 13.494,\n        \"buy_ema_diff\": 0.024,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.092,\n        \"buy_ema_low_2\": 1.164,\n        \"buy_ewo_high_2\": 4.072,\n        \"buy_rsi_ewo_2\": 42,\n        \"buy_rsi_fast_ewo_2\": 48,\n        ##\n        \"buy_closedelta_local_dip\": 13.717,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.084,\n        \"buy_rsi_local_dip\": 20,\n        ##\n        \"buy_r_deadfish_bb_factor\": 0.911,\n        \"buy_r_deadfish_bb_width\": 0.091,\n        \"buy_r_deadfish_ema\": 0.972,\n        \"buy_r_deadfish_volume_factor\": 1.008,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.04,\n        \"buy_clucha_bbdelta_tail\": 0.913,\n        \"buy_clucha_close_bblower\": 0.04,\n        \"buy_clucha_closedelta_close\": 0.05,\n        \"buy_clucha_rocr_1h\": 0.416,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_39_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_nfix_39_cti\": -0.105,\n        \"buy_nfix_39_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.05,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.205,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    is_optimize_ewo2_protection = False\n    buy_ewo2_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_ewo2_protection)\n    buy_ewo2_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_ewo2_protection)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize=is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize=is_optimize_clucha)\n    buy_clucha_close_bblower = DecimalParameter(0.001, 0.05, default=0.03669, optimize=is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize=is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize=is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_39_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_nfix_39_protection = False\n    buy_nfix_39_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_39_protection)\n    buy_nfix_39_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_39_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    ## Slippage params\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 0.80, default=0.33, decimals=3, optimize=is_optimize_slip , load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n    sell_rsi_delta = IntParameter(4, 15, default=10, optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # Pump protections\n        #informative_1h['hl_pct_change_48'] = range_percent_change(informative_1h, 'HL', length=48)\n        #informative_1h['hl_pct_change_36'] = range_percent_change(informative_1h, 'HL', length=36)\n        #informative_1h['hl_pct_change_24'] = range_percent_change(informative_1h, 'HL', length=24)\n        #informative_1h['hl_pct_change_12'] = range_percent_change(informative_1h, 'HL', length=12)\n        #informative_1h['hl_pct_change_6'] = range_percent_change(informative_1h, 'HL', length=6)\n\n        return informative_1h\n\n    ############################################################################\n\n    ### Custom functions\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # sell trail\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi'] < 46.0):\n                return 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 32.0):\n                return 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi'] < 48.0):\n                return 'sell_profit_t_0_3'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 39.0):\n                return 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_1h'] < 50.0):\n                return 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 42.0):\n                return 'sell_profit_t_1_11'\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return 'sell_profit_t_1_12'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv_coh'\n\n        # sell bear\n        if last_candle['close'] < last_candle['ema_200']:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi'] < 34.0) and (last_candle['cmf'] < 0.0):\n                    return 'sell_profit_u_bear_1_1'\n                elif (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.4):\n                    return 'sell_profit_u_bear_1_2'\n\n        # sell quick\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi'] > 80.0):\n            return 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return 'signal_profit_q_2'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return 'signal_profit_q_pmax_bull'\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return 'signal_profit_q_pmax_bear'\n\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * self.sell_ema.value)\n                and (last_candle['cmf'] < self.sell_cmf.value)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_ema_close_delta.value)\n                and last_candle['rsi'] > previous_candle_1['rsi']\n                and (last_candle['rsi'] > (last_candle['rsi_1h'] + self.sell_rsi_delta.value))\n        ):\n            return 'sell_stoploss_u_e_1'\n\n        # stoploss - deadfish\n        if (    (current_profit < self.sell_deadfish_profit.value)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['bb_width'] < self.sell_deadfish_bb_width.value)\n                and (last_candle['close'] > last_candle['bb_middleband2'] * self.sell_deadfish_bb_factor.value)\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_deadfish_volume_factor.value)\n            ):\n            return 'sell_stoploss_deadfish'\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            #print(\"open rate is : \" + str(rate))\n            #print(\"last candle close is : \" + str(dataframe['close']))\n            #print(\"slippage is : \" + str(slippage) )\n            #print(\"############################################################################\")\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        return dataframe\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                    (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                    )\n                    |\n                    (\n                        (dataframe['ha_close'] < dataframe['ema_slow']) &\n                        (dataframe['ha_close'] < self.buy_clucha_close_bblower.value * dataframe['bb_lowerband2'])\n                    )\n                )\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_39_r14.value)\n            )\n\n        # NFI quick mode\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_39_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_39_r14.value)\n            )\n\n        is_nfix_51 = (\n                (dataframe['close'].shift(3) < dataframe['ema_16'].shift(3) * 0.944) &\n                (dataframe['EWO'].shift(3) < -1.0) &\n                (dataframe['rsi'].shift(3) > 28.0) &\n                (dataframe['cti'].shift(3) < -0.84) &\n                (dataframe['r_14'].shift(3) < -94.0) &\n                (dataframe['rsi'] > 30.0) &\n                (dataframe['crsi_1h'] > 1.0)\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~0.93 / 90.9% / 34.09%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~1.92 / 92.3% / 58.64%      D\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.26 / 97.8% / 7.74%       D\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.33 / 86.4% / 49.25%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                # ~0.95 / 87% / 21.77%        D\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.65 / 93.9% / 36.87%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~0.34 / 93.4% / 37.01%      F\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.36 / 89.1% / 10.32%      D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.07 / 83.2% / 70.22%      F\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[ (dataframe['volume'] > 0), 'sell' ] = 0\n\n        return dataframe\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_BIV1/BB_RPB_TSL_BIV1.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, ichimoku\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL_BIV1(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.668,\n        ##\n        \"buy_bb_width_1h\": 1.074,\n        \"buy_roc_1h\": 4,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 13.494,\n        \"buy_ema_diff\": 0.024,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.092,\n        \"buy_ema_low_2\": 1.164,\n        \"buy_ewo_high_2\": 4.072,\n        \"buy_rsi_ewo_2\": 42,\n        \"buy_rsi_fast_ewo_2\": 48,\n        ##\n        \"buy_closedelta_local_dip\": 13.717,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.084,\n        \"buy_rsi_local_dip\": 20,\n        ##\n        \"buy_r_deadfish_bb_factor\": 0.911,\n        \"buy_r_deadfish_bb_width\": 0.091,\n        \"buy_r_deadfish_ema\": 0.972,\n        \"buy_r_deadfish_volume_factor\": 1.008,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.04,\n        \"buy_clucha_bbdelta_tail\": 0.913,\n        \"buy_clucha_close_bblower\": 0.04,\n        \"buy_clucha_closedelta_close\": 0.05,\n        \"buy_clucha_rocr_1h\": 0.416,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_39_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_nfix_39_cti\": -0.105,\n        \"buy_nfix_39_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.05,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.205,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    is_optimize_ewo2_protection = False\n    buy_ewo2_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_ewo2_protection)\n    buy_ewo2_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_ewo2_protection)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize=is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize=is_optimize_clucha)\n    buy_clucha_close_bblower = DecimalParameter(0.001, 0.05, default=0.03669, optimize=is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize=is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize=is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_39_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_nfix_39_protection = False\n    buy_nfix_39_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_39_protection)\n    buy_nfix_39_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_39_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    ## Slippage params\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 0.80, default=0.33, decimals=3, optimize=is_optimize_slip , load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n    sell_rsi_delta = IntParameter(4, 15, default=10, optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # Pump protections\n        #informative_1h['hl_pct_change_48'] = range_percent_change(informative_1h, 'HL', length=48)\n        #informative_1h['hl_pct_change_36'] = range_percent_change(informative_1h, 'HL', length=36)\n        #informative_1h['hl_pct_change_24'] = range_percent_change(informative_1h, 'HL', length=24)\n        #informative_1h['hl_pct_change_12'] = range_percent_change(informative_1h, 'HL', length=12)\n        #informative_1h['hl_pct_change_6'] = range_percent_change(informative_1h, 'HL', length=6)\n\n        return informative_1h\n\n    ############################################################################\n\n    ### Custom functions\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # sell trail\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi'] < 46.0):\n                return 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 32.0):\n                return 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi'] < 48.0):\n                return 'sell_profit_t_0_3'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 39.0):\n                return 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_1h'] < 50.0):\n                return 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 42.0):\n                return 'sell_profit_t_1_11'\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return 'sell_profit_t_1_12'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return 'signal_profit_q_momdiv_coh'\n\n        # sell bear\n        if last_candle['close'] < last_candle['ema_200']:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi'] < 34.0) and (last_candle['cmf'] < 0.0):\n                    return 'sell_profit_u_bear_1_1'\n                elif (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.4):\n                    return 'sell_profit_u_bear_1_2'\n\n        # sell quick\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi'] > 80.0):\n            return 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return 'signal_profit_q_2'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return 'signal_profit_q_pmax_bull'\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return 'signal_profit_q_pmax_bear'\n\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * self.sell_ema.value)\n                and (last_candle['cmf'] < self.sell_cmf.value)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_ema_close_delta.value)\n                and last_candle['rsi'] > previous_candle_1['rsi']\n                and (last_candle['rsi'] > (last_candle['rsi_1h'] + self.sell_rsi_delta.value))\n        ):\n            return 'sell_stoploss_u_e_1'\n\n        # stoploss - deadfish\n        if (    (current_profit < self.sell_deadfish_profit.value)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['bb_width'] < self.sell_deadfish_bb_width.value)\n                and (last_candle['close'] > last_candle['bb_middleband2'] * self.sell_deadfish_bb_factor.value)\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_deadfish_volume_factor.value)\n            ):\n            return 'sell_stoploss_deadfish'\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            #print(\"open rate is : \" + str(rate))\n            #print(\"last candle close is : \" + str(dataframe['close']))\n            #print(\"slippage is : \" + str(slippage) )\n            #print(\"############################################################################\")\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        return dataframe\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                    (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                    )\n                    |\n                    (\n                        (dataframe['ha_close'] < dataframe['ema_slow']) &\n                        (dataframe['ha_close'] < self.buy_clucha_close_bblower.value * dataframe['bb_lowerband2'])\n                    )\n                )\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_39_r14.value)\n            )\n\n        # NFI quick mode\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_39_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_39_r14.value)\n            )\n\n        is_nfix_51 = (\n                (dataframe['close'].shift(3) < dataframe['ema_16'].shift(3) * 0.944) &\n                (dataframe['EWO'].shift(3) < -1.0) &\n                (dataframe['rsi'].shift(3) > 28.0) &\n                (dataframe['cti'].shift(3) < -0.84) &\n                (dataframe['r_14'].shift(3) < -94.0) &\n                (dataframe['rsi'] > 30.0) &\n                (dataframe['crsi_1h'] > 1.0)\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~0.93 / 90.9% / 34.09%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~1.92 / 92.3% / 58.64%      D\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.26 / 97.8% / 7.74%       D\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.33 / 86.4% / 49.25%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                # ~0.95 / 87% / 21.77%        D\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.65 / 93.9% / 36.87%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~0.34 / 93.4% / 37.01%      F\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.36 / 89.1% / 10.32%      D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.07 / 83.2% / 70.22%      F\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[ (dataframe['volume'] > 0), 'sell' ] = 0\n\n        return dataframe\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_RNG/BB_RPB_TSL_RNG.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\nclass BB_RPB_TSL_RNG(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_btc_safe\": -289,\n        \"buy_btc_safe_1d\": -0.05,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 12.148,\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_adx\": 20,\n        \"buy_fastd\": 20,\n        \"buy_fastk\": 22,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 4.179,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        ##\n    }\n\n    # sell space\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"sell_btc_safe\": -389,\n        \"base_nb_candles_sell\": 24,\n        \"high_offset\": 0.991,\n        \"high_offset_2\": 0.997        \n    }\n\n    # really hard to use this\n    minimal_roi = {\n        \"0\": 0.10,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.05, 0.2, default=0.15, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.025, 0.08, default=0.04, optimize = is_optimize_break)\n\n    is_optimize_local_dip = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = False)\n    buy_rsi = IntParameter(15, 30, default=35, optimize = False)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_ema_low_2 = DecimalParameter(0.96, 0.978, default=0.96 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(1.05, 1.2, default=1.09 , optimize = is_optimize_ewo_2)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    # Buy params toggle\n    buy_is_dip_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_is_break_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    ## Sell params\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    high_offset          = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)      \n\n    ## Trailing params\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        informative_pairs = [(\"BTC/USDT\", \"5m\")]\n\n        return informative_pairs\n\n    ############################################################################\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### BTC protection\n\n        # BTC info\n        inf_tf = '5m'\n        informative = self.dp.get_pair_dataframe('BTC/USDT', timeframe=inf_tf)\n        informative_past = informative.copy().shift(1)                                                                                                   # Get recent BTC info\n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d\n\n        ### Other checks\n\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband3']).astype('int')\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n        #dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        # SRSI hyperopt ?\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)   \n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)        \n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        if self.buy_is_dip_enabled.value:\n\n            is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n            #conditions.append(is_dip)\n\n        if self.buy_is_break_enabled.value:\n\n            is_break = (\n\n                (   (dataframe['bb_delta'] > self.buy_bb_delta.value)                                   #\"buy_bb_delta\": 0.025 0.036\n                    &                                                                                   #\"buy_bb_width\": 0.095 0.133\n                    (dataframe['bb_width'] > self.buy_bb_width.value)\n                )\n                &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n            #conditions.append(is_break)\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        # NFI quick mode\n\n        is_nfi_32 = (\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        # is_btc_safe = (\n\n        #         (dataframe['btc_diff'] > self.buy_btc_safe.value)\n        #        &(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n        #        &(dataframe['volume'] > 0)           # Make sure Volume is not 0\n        #     )\n\n        is_BB_checked = is_dip & is_break\n\n        #print(dataframe['btc_5m'])\n        #print(dataframe['btc_1d'])\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'])\n        #print(dataframe['btc_1d'] * -0.025)\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * -0.025)\n\n        ## condition append\n        conditions.append(is_BB_checked)          # ~1.7 89%\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)       # ~3.84 90.2%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local uptrend '\n\n        conditions.append(is_ewo)                 # ~2.26 93.5%\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)               # ~3.68 90.3%\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_cofi)                # ~3.21 90.8%\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_32)              # ~2.43 91.3%\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi 32 '\n\n        conditions.append(is_nfi_33)              # ~0.11 100%\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi 33 '\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&                \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &\n                (dataframe['close'] < dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_RNG_2/BB_RPB_TSL_RNG_2.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\nclass BB_RPB_TSL_RNG_2(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_btc_safe\": -289,\n        \"buy_btc_safe_1d\": -0.05,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 12.148,\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_adx\": 20,\n        \"buy_fastd\": 20,\n        \"buy_fastk\": 22,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 4.179,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        ##\n    }\n\n    # sell space\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n     \"base_nb_candles_sell\": 23,\n      \"high_offset\": 1.051,\n      \"high_offset_2\": 1.02,\n      \"sell_btc_safe\": -325      \n    }\n\n    # really hard to use this\n    minimal_roi = {\n        \"0\": 0.10,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.05, 0.2, default=0.15, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.025, 0.08, default=0.04, optimize = is_optimize_break)\n\n    is_optimize_local_dip = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = False)\n    buy_rsi = IntParameter(15, 30, default=35, optimize = False)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_ema_low_2 = DecimalParameter(0.96, 0.978, default=0.96 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(1.05, 1.2, default=1.09 , optimize = is_optimize_ewo_2)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    # Buy params toggle\n    buy_is_dip_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_is_break_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    ## Sell params\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    high_offset          = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)      \n\n    ## Trailing params\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        informative_pairs = [(\"BTC/USDT\", \"5m\")]\n\n        return informative_pairs\n\n    ############################################################################\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### BTC protection\n\n        # BTC info\n        inf_tf = '5m'\n        informative = self.dp.get_pair_dataframe('BTC/USDT', timeframe=inf_tf)\n        informative_past = informative.copy().shift(1)                                                                                                   # Get recent BTC info\n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d\n\n        ### Other checks\n\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband3']).astype('int')\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n        #dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        # SRSI hyperopt ?\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)   \n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)        \n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        if self.buy_is_dip_enabled.value:\n\n            is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n            #conditions.append(is_dip)\n\n        if self.buy_is_break_enabled.value:\n\n            is_break = (\n\n                (   (dataframe['bb_delta'] > self.buy_bb_delta.value)                                   #\"buy_bb_delta\": 0.025 0.036\n                    &                                                                                   #\"buy_bb_width\": 0.095 0.133\n                    (dataframe['bb_width'] > self.buy_bb_width.value)\n                )\n                &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n            #conditions.append(is_break)\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        # NFI quick mode\n\n        is_nfi_32 = (\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        # is_btc_safe = (\n\n        #         (dataframe['btc_diff'] > self.buy_btc_safe.value)\n        #        &(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n        #        &(dataframe['volume'] > 0)           # Make sure Volume is not 0\n        #     )\n\n        is_BB_checked = is_dip & is_break\n\n        #print(dataframe['btc_5m'])\n        #print(dataframe['btc_1d'])\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'])\n        #print(dataframe['btc_1d'] * -0.025)\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * -0.025)\n\n        ## condition append\n        conditions.append(is_BB_checked)          # ~1.7 89%\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)       # ~3.84 90.2%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local uptrend '\n\n        conditions.append(is_ewo)                 # ~2.26 93.5%\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)               # ~3.68 90.3%\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_cofi)                # ~3.21 90.8%\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_32)              # ~2.43 91.3%\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi 32 '\n\n        conditions.append(is_nfi_33)              # ~0.11 100%\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi 33 '\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&                \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &\n                (dataframe['close'] < dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_RNG_TBS/BB_RPB_TSL_RNG_TBS.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\nfrom typing import Dict, List\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\nclass BB_RPB_TSL_RNG_TBS(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_btc_safe\": -289,\n        \"buy_btc_safe_1d\": -0.05,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 12.148,\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_adx\": 20,\n        \"buy_fastd\": 20,\n        \"buy_fastk\": 22,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 4.179,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        ##\n    }\n\n    # sell space\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"sell_btc_safe\": -389,\n        \"base_nb_candles_sell\": 24,\n        \"high_offset\": 0.991,\n        \"high_offset_2\": 0.997        \n    }\n\n    # really hard to use this\n    minimal_roi = {\n        \"0\": 0.10,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n    process_only_new_candles = True\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.05, 0.2, default=0.15, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.025, 0.08, default=0.04, optimize = is_optimize_break)\n\n    is_optimize_local_dip = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = False)\n    buy_rsi = IntParameter(15, 30, default=35, optimize = False)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_ema_low_2 = DecimalParameter(0.96, 0.978, default=0.96 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(1.05, 1.2, default=1.09 , optimize = is_optimize_ewo_2)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    # Buy params toggle\n    buy_is_dip_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_is_break_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    ## Sell params\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    high_offset          = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)      \n\n    ## Trailing params\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.timeframe) for pair in pairs]\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        #informative_pairs = [(\"BTC/BUSD\", \"5m\")]\n\n        return informative_pairs\n\n    ############################################################################\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### BTC protection\n\n        # BTC info\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n        inf_tf = '5m'\n        informative = self.dp.get_pair_dataframe(btc_info_pair, timeframe=inf_tf)\n        informative_past = informative.copy().shift(1)                                                                                                   # Get recent BTC info\n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d\n\n        ### Other checks\n\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband3']).astype('int')\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n        #dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        # SRSI hyperopt ?\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)   \n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)        \n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        if self.buy_is_dip_enabled.value:\n\n            is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n            #conditions.append(is_dip)\n\n        if self.buy_is_break_enabled.value:\n\n            is_break = (\n\n                (   (dataframe['bb_delta'] > self.buy_bb_delta.value)                                   #\"buy_bb_delta\": 0.025 0.036\n                    &                                                                                   #\"buy_bb_width\": 0.095 0.133\n                    (dataframe['bb_width'] > self.buy_bb_width.value)\n                )\n                &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n            #conditions.append(is_break)\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        # NFI quick mode\n\n        is_nfi_32 = (\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        # is_btc_safe = (\n\n        #         (dataframe['btc_diff'] > self.buy_btc_safe.value)\n        #        &(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n        #        &(dataframe['volume'] > 0)           # Make sure Volume is not 0\n        #     )\n\n        is_BB_checked = is_dip & is_break\n\n        #print(dataframe['btc_5m'])\n        #print(dataframe['btc_1d'])\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'])\n        #print(dataframe['btc_1d'] * -0.025)\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * -0.025)\n\n        ## condition append\n        conditions.append(is_BB_checked)          # ~1.7 89%\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)       # ~3.84 90.2%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local uptrend '\n\n        conditions.append(is_ewo)                 # ~2.26 93.5%\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)               # ~3.68 90.3%\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_cofi)                # ~3.21 90.8%\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_32)              # ~2.43 91.3%\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi 32 '\n\n        conditions.append(is_nfi_33)              # ~0.11 100%\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi 33 '\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&                \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &\n                (dataframe['close'] < dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n        \n        \nclass TrailingBuyStrat2(BB_RPB_TSL_RNG_TBS):\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\n    #\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\n    #\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        default_offset = 0.005\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n        \n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n                            \n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n                            \n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n        \n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe\n\n        "
  },
  {
    "path": "strategies/BB_RPB_TSL_RNG_TBS_GOLD/BB_RPB_TSL_RNG_TBS_GOLD.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\nfrom typing import Dict, List\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\nclass BB_RPB_TSL_RNG_TBS_GOLD(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_btc_safe\": -289,\n        \"buy_btc_safe_1d\": -0.05,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 12.148,\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_adx\": 20,\n        \"buy_fastd\": 20,\n        \"buy_fastk\": 22,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 4.179,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        ##\n    }\n\n    # sell space\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"sell_btc_safe\": -389,\n        \"base_nb_candles_sell\": 24,\n        \"high_offset\": 0.991,\n        \"high_offset_2\": 0.997        \n    }\n\n    # really hard to use this\n    minimal_roi = {\n        \"0\": 0.10,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.049\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n    process_only_new_candles = True\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.05, 0.2, default=0.15, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.025, 0.08, default=0.04, optimize = is_optimize_break)\n\n    is_optimize_local_dip = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = False)\n    buy_rsi = IntParameter(15, 30, default=35, optimize = False)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_ema_low_2 = DecimalParameter(0.96, 0.978, default=0.96 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(1.05, 1.2, default=1.09 , optimize = is_optimize_ewo_2)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    # Buy params toggle\n    buy_is_dip_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_is_break_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    ## Sell params\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    high_offset          = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)      \n\n    ## Trailing params\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.timeframe) for pair in pairs]\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        #informative_pairs = [(\"BTC/BUSD\", \"5m\")]\n\n        return informative_pairs\n\n    ############################################################################\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### BTC protection\n\n        # BTC info\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n        inf_tf = '5m'\n        informative = self.dp.get_pair_dataframe(btc_info_pair, timeframe=inf_tf)\n        informative_past = informative.copy().shift(1)                                                                                                   # Get recent BTC info\n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d\n\n        ### Other checks\n\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband3']).astype('int')\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n        #dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        # SRSI hyperopt ?\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)   \n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)        \n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        if self.buy_is_dip_enabled.value:\n\n            is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n            #conditions.append(is_dip)\n\n        if self.buy_is_break_enabled.value:\n\n            is_break = (\n\n                (   (dataframe['bb_delta'] > self.buy_bb_delta.value)                                   #\"buy_bb_delta\": 0.025 0.036\n                    &                                                                                   #\"buy_bb_width\": 0.095 0.133\n                    (dataframe['bb_width'] > self.buy_bb_width.value)\n                )\n                &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n            #conditions.append(is_break)\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        # NFI quick mode\n\n        is_nfi_32 = (\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        # is_btc_safe = (\n\n        #         (dataframe['btc_diff'] > self.buy_btc_safe.value)\n        #        &(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n        #        &(dataframe['volume'] > 0)           # Make sure Volume is not 0\n        #     )\n\n        is_BB_checked = is_dip & is_break\n\n        #print(dataframe['btc_5m'])\n        #print(dataframe['btc_1d'])\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'])\n        #print(dataframe['btc_1d'] * -0.025)\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * -0.025)\n\n        ## condition append\n        conditions.append(is_BB_checked)          # ~1.7 89%\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)       # ~3.84 90.2%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local uptrend '\n\n        conditions.append(is_ewo)                 # ~2.26 93.5%\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)               # ~3.68 90.3%\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_cofi)                # ~3.21 90.8%\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_32)              # ~2.43 91.3%\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi 32 '\n\n        conditions.append(is_nfi_33)              # ~0.11 100%\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi 33 '\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&                \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &\n                (dataframe['close'] < dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n        \n        \nclass TrailingBuyStrat2(BB_RPB_TSL_RNG_TBS_GOLD):\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\n    #\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\n    #\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        default_offset = 0.005\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n        \n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n                            \n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n                            \n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n        \n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe\n\n        \n"
  },
  {
    "path": "strategies/BB_RPB_TSL_RNG_VWAP/BB_RPB_TSL_RNG_VWAP.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity limit is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n\n####################################################\n# VWAP bands, come from vwap strategy\n\ndef vmap_b(dataframe, window_size=20, num_of_std=1):\n    df = dataframe.copy()\n    df['vwap'] = qtpylib.rolling_vwap(df,window=window_size)\n    rolling_std = df['vwap'].rolling(window=window_size).std()\n    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)\n    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)\n    return df['vwap_low'], df['vwap'], df['vwap_high']\n\n\ndef top_percent_change(dataframe: DataFrame, length: int) -> float:\n    \"\"\"\n    Percentage change of the current close from the range maximum Open price\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param length: int The length to look back\n    \"\"\"\n    if length == 0:\n        return (dataframe['open'] - dataframe['close']) / dataframe['close']\n    else:\n        return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n####################################################\n\nclass BB_RPB_TSL_RNG_VWAP(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_btc_safe\": -289,\n        \"buy_btc_safe_1d\": -0.05,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 12.148,\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_adx\": 20,\n        \"buy_fastd\": 20,\n        \"buy_fastk\": 22,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 4.179,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        ##\n    }\n\n    # sell space\n    sell_params = {\n        \"pHSL\": -0.25,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"sell_btc_safe\": -389,\n        \"base_nb_candles_sell\": 24,\n        \"high_offset\": 0.991,\n        \"high_offset_2\": 0.997        \n    }\n\n    # really hard to use this\n    minimal_roi = {\n        \"0\": 100,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    process_only_new_candles = True\n    startup_candle_count = 120\n\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'emergencysell': 'limit',\n        'forcebuy': \"limit\",\n        'forcesell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.05, 0.2, default=0.15, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.025, 0.08, default=0.04, optimize = is_optimize_break)\n\n    is_optimize_local_dip = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = False)\n    buy_rsi = IntParameter(15, 30, default=35, optimize = False)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_ema_low_2 = DecimalParameter(0.96, 0.978, default=0.96 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(1.05, 1.2, default=1.09 , optimize = is_optimize_ewo_2)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    # Buy params toggle\n    buy_is_dip_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_is_break_enabled = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    ## Sell params\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    high_offset          = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)      \n\n    ## Trailing params\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        informative_pairs = [(\"BTC/USDT\", \"5m\")]\n\n        return informative_pairs\n\n    ############################################################################\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        buy_tag = ''\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        if len(buy_tags) == 1 and \"vwap\" in buy_tags:\n            PF_1 = 0.01\n            SL_1 = 0.01\n            PF_2 = 0.05\n            SL_2 = 0.042\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # vmap indicators\n        vwap_low, vwap, vwap_high = vmap_b(dataframe, 20, 1)\n        dataframe['vwap_low'] = vwap_low\n        dataframe['tcp_percent_4'] = top_percent_change(dataframe, 4)\n\n\n        ### BTC protection\n\n        # BTC info\n        inf_tf = '5m'\n        informative = self.dp.get_pair_dataframe('BTC/USDT', timeframe=inf_tf)\n        informative_past = informative.copy().shift(1)                                                                                                   # Get recent BTC info\n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d\n\n        ### Other checks\n\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband3']).astype('int')\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n        #dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        # SRSI hyperopt ?\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)   \n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)        \n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        if self.buy_is_dip_enabled.value:\n\n            is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n            #conditions.append(is_dip)\n\n        if self.buy_is_break_enabled.value:\n\n            is_break = (\n\n                (   (dataframe['bb_delta'] > self.buy_bb_delta.value)                                   #\"buy_bb_delta\": 0.025 0.036\n                    &                                                                                   #\"buy_bb_width\": 0.095 0.133\n                    (dataframe['bb_width'] > self.buy_bb_width.value)\n                )\n                &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n            #conditions.append(is_break)\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        # NFI quick mode\n\n        is_nfi_32 = (\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_vwap = (\n                (dataframe['close'] < dataframe['vwap_low']) &\n                (dataframe['tcp_percent_4'] > 0.04) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi'] < 35) &\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60) &\n                (dataframe['volume'] > 0)\n        )\n\n        # is_btc_safe = (\n\n        #         (dataframe['btc_diff'] > self.buy_btc_safe.value)\n        #        &(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n        #        &(dataframe['volume'] > 0)           # Make sure Volume is not 0\n        #     )\n\n        is_BB_checked = is_dip & is_break\n\n        #print(dataframe['btc_5m'])\n        #print(dataframe['btc_1d'])\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'])\n        #print(dataframe['btc_1d'] * -0.025)\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * -0.025)\n\n        ## condition append\n        conditions.append(is_BB_checked)          # ~1.7 89%\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)       # ~3.84 90.2%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local uptrend '\n\n        conditions.append(is_ewo)                 # ~2.26 93.5%\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)               # ~3.68 90.3%\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_cofi)                # ~3.21 90.8%\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_32)              # ~2.43 91.3%\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi 32 '\n\n        conditions.append(is_nfi_33)              # ~0.11 100%\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi 33 '\n\n        conditions.append(is_vwap)\n        dataframe.loc[is_vwap, 'buy_tag'] += 'vwap '\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&                \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &\n                (dataframe['close'] < dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_SMA_Tranz/BB_RPB_TSL_SMA_Tranz.py",
    "content": "# --- Do not remove these libs ---\nimport pandas_ta as pta\nimport copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat, DatetimeIndex, merge\nfrom functools import reduce\nimport math\nfrom random import shuffle\nfrom typing import Dict, List\nimport technical.indicators as ftt\nfrom technical.util import resample_to_interval\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta, timezone\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter, IStrategy, IntParameter)\nfrom skopt.space import Dimension, Integer, Real\nimport time\nfrom finta import TA as fta\n\nlog = logging.getLogger(__name__)\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3\n    return Series(index=bars.index, data=res)\n\ndef VWAPB(dataframe, window_size=20, num_of_std=1):\n    df = dataframe.copy()\n    df['vwap'] = qtpylib.rolling_vwap(df,window=window_size)\n    rolling_std = df['vwap'].rolling(window=window_size).std()\n    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)\n    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)\n    return df['vwap_low'], df['vwap'], df['vwap_high']\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n    \"\"\"\n    Rolling Percentage Change Maximum across interval.\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param method: High to Low / Open to Close\n    :param length: int The length to look back\n    \"\"\"\n    if method == 'HL':\n        return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n    elif method == 'OC':\n        return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n    else:\n        raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from -100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\ndef HA(dataframe, smoothing=None):\n    df = dataframe.copy()\n\n    df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    df.reset_index(inplace=True)\n\n    ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n    [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n    df['HA_Open'] = ha_open\n\n    df.set_index('index', inplace=True)\n\n    df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n    df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n    if smoothing is not None:\n        sml = abs(int(smoothing))\n        if sml > 0:\n            df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n            df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n            df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n            df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n\n    return df\n\ndef pump_warning(dataframe, perc=15):\n    df = dataframe.copy()\n    df[\"change\"] = df[\"high\"] - df[\"low\"]\n    df[\"test1\"] = (df[\"close\"] > df[\"open\"])\n    df[\"test2\"] = ((df[\"change\"]/df[\"low\"]) > (perc/100))\n    df[\"result\"] = (df[\"test1\"] & df[\"test2\"]).astype('int')\n    return df['result']\n\ndef pump_warning2(dataframe, params):\n    pct_change_timeframe=8\n    pct_change_max=0.15\n    pct_change_min=-0.15\n    pct_change_short_timeframe=8\n    pct_change_short_max=0.08\n    pct_change_short_min=-0.08\n    ispumping=0.4\n    islongpumping=0.48\n    isshortpumping=0.10\n    ispumping_rolling=20\n    islongpumping_rolling=30\n    isshortpumping_rolling=10\n    recentispumping_rolling=300\n    if 'pct_change_timeframe' in params:\n        pct_change_timeframe = params['pct_change_timeframe']\n    if 'pct_change_max' in params:\n        pct_change_max = params['pct_change_max']\n    if 'pct_change_min' in params:\n        pct_change_min = params['pct_change_min']\n    if 'pct_change_short_timeframe' in params:\n        pct_change_short_timeframe = params['pct_change_short_timeframe']\n    if 'pct_change_short_max' in params:\n        pct_change_short_max = params['pct_change_short_max']\n    if 'pct_change_short_min' in params:\n        pct_change_short_min = params['pct_change_short_min']\n    if 'ispumping' in params:\n        ispumping = params['ispumping']\n    if 'islongpumping' in params:\n        islongpumping = params['islongpumping']\n    if 'isshortpumping' in params:\n        isshortpumping = params['isshortpumping']\n    if 'ispumping_rolling' in params:\n        ispumping_rolling = params['ispumping_rolling']\n    if 'isshortpumping_rolling' in params:\n        isshortpumping_rolling = params['isshortpumping_rolling']\n    if 'recentispumping_rolling' in params:\n        recentispumping_rolling = params['recentispumping_rolling']\n    df = dataframe.copy()\n    df['pct_change'] = df['close'].pct_change(periods=pct_change_timeframe)\n    df['pct_change_int'] = ((df['pct_change'] > pct_change_max).astype('int') | (df['pct_change'] < pct_change_min).astype('int'))\n    df['pct_change_short'] = df['close'].pct_change(periods=pct_change_short_timeframe)\n    df['pct_change_int_short'] = ((df['pct_change_short'] > pct_change_short_max).astype('int') | (df['pct_change_short'] < pct_change_short_min).astype('int'))\n    df['ispumping'] = ((df['pct_change_int'].rolling(ispumping_rolling).sum() >= ispumping)).astype('int')\n    df['islongpumping'] = ((df['pct_change_int'].rolling(islongpumping_rolling).sum() >= islongpumping)).astype('int')\n    df['isshortpumping'] = ((df['pct_change_int_short'].rolling(isshortpumping_rolling).sum() >= isshortpumping)).astype('int')\n    df['recentispumping'] = (df['ispumping'].rolling(recentispumping_rolling).max() > 0) | (df['islongpumping'].rolling(recentispumping_rolling).max() > 0) | (df['isshortpumping'].rolling(recentispumping_rolling).max() > 0)\n\n    return df['recentispumping']\n\ndef dump_warning(dataframe, buy_threshold):\n    df_past = dataframe.copy().shift(1)                                                                                                    # Get recent BTC info\n\n    # 5m dump protection\n    df_past_source = (df_past['open'] + df_past['close'] + df_past['high'] + df_past['low']) / 4        # Get BTC price\n    df_threshold = df_past_source * buy_threshold                                                                                 # BTC dump n% in 5 min\n    df_past_delta = df_past['close'].shift(1) - df_past['close']                                                          # should be positive if dump\n    df_diff = df_threshold - df_past_delta                                                                                # Need be larger than 0\n    dataframe['pair_threshold'] = df_threshold\n    dataframe['pair_diff'] = df_diff\n\n    # 1d dump protection\n    df_past_1d = dataframe.copy().shift(288)\n    df_past_source_1d = (df_past_1d['open'] + df_past_1d['close'] + df_past_1d['high'] + df_past_1d['low']) / 4\n    dataframe['pair_5m'] = df_past_source\n    dataframe['pair_1d'] = df_past_source_1d\n    dataframe['pair_5m_1d_diff'] = df_past_source - df_past_source_1d\n\n    return dataframe\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef pct_change(a, b):\n    return (b - a) / a\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\nclass BB_RPB_TSL_SMA_Tranz(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n    DATESTAMP = 0\n    SELLMA = 1\n    SELL_TRIGGER=2\n    # buy space\n    buy_params = {\n        \"buy_btc_safe\": -250,\n        \"buy_btc_safe_1d\": -0.04,\n        ##\n        \"max_slip\": 0.983,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"base_nb_candles_buy_trima\": 15,\n        \"base_nb_candles_buy_trima2\": 38,\n        \"low_offset_trima\": 0.959,\n        \"low_offset_trima2\": 0.949,\n\n        \"base_nb_candles_buy_hma\": 70,\n        \"base_nb_candles_buy_hma2\": 12,\n        \"low_offset_hma\": 0.948,\n        \"low_offset_hma2\": 0.941,\n        #\n        \"base_nb_candles_buy_zema\": 25,\n        \"base_nb_candles_buy_zema2\": 53,\n        \"low_offset_zema\": 0.958,\n        \"low_offset_zema2\": 0.961,\n        #\n        \"base_nb_candles_buy_ema\": 9,\n        \"base_nb_candles_buy_ema2\": 75,\n        \"low_offset_ema\": 1.067,\n        \"low_offset_ema2\": 0.973,\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"ewo_high\": 2.615,\n        \"ewo_high2\": 2.188,\n        \"ewo_low\": -19.632,\n        \"ewo_low2\": -19.955,\n        \"rsi_buy\": 60,\n        \"rsi_buy2\": 45,\n        #\n        \"pump_protection_01_pct_change_timeframe\": 8,\n        \"pump_protection_01_pct_change_max\": 0.15,\n        \"pump_protection_01_pct_change_min\": -0.15,\n        #\n        \"pump_protection_01_pct_change_short_timeframe\": 8,\n        \"pump_protection_01_pct_change_short_max\": 0.1,\n        \"pump_protection_01_pct_change_short_min\": -0.1,\n        #\n        \"pump_protection_01_ispumping\": 0.2,\n        \"pump_protection_01_islongpumping\": 0.24,\n        \"pump_protection_01_isshortpumping\": 0.12,\n        #\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_ema_high_2\": 1.04116,\n        \"buy_ema_low_2\": 0.97463,\n        \"buy_ewo_high_2\": 5.249,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"lambo2_ema_14_factor\": 0.981,\n        \"lambo2_enabled\": True,\n        \"lambo2_rsi_14_limit\": 39,\n        \"lambo2_rsi_4_limit\": 44,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n        ##\n        \"base_nb_candles_ema_sell\": 5,\n        \"high_offset_sell_ema\": 0.994,\n        #\n        \"base_nb_candles_buy\": 8,\n        \"ewo_high\": 4.13,\n        \"ewo_high_2\": 4.477,\n        \"ewo_low\": -19.076,\n        \"lookback_candles\": 27,\n        \"low_offset\": 0.988,\n        \"low_offset_2\": 0.974,\n        \"profit_threshold\": 1.049,\n        \"rsi_buy\": 72,\n        \"rsi_fast_buy\": 40,\n        #\n        \"clucha_bbdelta_close\": 0.04796,\n        \"clucha_bbdelta_tail\": 0.93112,\n        \"clucha_close_bblower\": 0.01645,\n        \"clucha_closedelta_close\": 0.00931,\n        \"clucha_enabled\": False,\n        \"clucha_rocr_1h\": 0.41663,\n    }\n\n    protection_params = {\n        \"low_profit_lookback\": 48,\n        \"low_profit_min_req\": 0.04,\n        \"low_profit_stop_duration\": 14,\n        \"cooldown_lookback\": 2,  # value loaded from strategy\n    }\n    #############################################################\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n        #\n        \"base_nb_candles_sell\": 8,\n        \"high_offset\": 1.012,\n        \"high_offset_2\": 1.431,\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # Protection hyperspace params:\n    class HyperOpt:\n        @staticmethod\n        def generate_roi_table(params: dict):\n            \"\"\"\n            Generate the ROI table that will be used by Hyperopt\n            This implementation generates the default legacy Freqtrade ROI tables.\n            Change it if you need different number of steps in the generated\n            ROI tables or other structure of the ROI tables.\n            Please keep it aligned with parameters in the 'roi' optimization\n            hyperspace defined by the roi_space method.\n            \"\"\"\n            roi_table = {}\n            roi_table[0] = 0.05\n            roi_table[params['roi_t6']] = 0.04\n            roi_table[params['roi_t5']] = 0.03\n            roi_table[params['roi_t4']] = 0.02\n            roi_table[params['roi_t3']] = 0.01\n            roi_table[params['roi_t2']] = 0.0001\n            roi_table[params['roi_t1']] = -10\n\n            return roi_table\n\n        @staticmethod\n        def roi_space() -> List[Dimension]:\n            \"\"\"\n            Values to search for each ROI steps\n            Override it if you need some different ranges for the parameters in the\n            'roi' optimization hyperspace.\n            Please keep it aligned with the implementation of the\n            generate_roi_table method.\n            \"\"\"\n            return [\n                Integer(240, 720, name='roi_t1'),\n                Integer(120, 240, name='roi_t2'),\n                Integer(90, 120, name='roi_t3'),\n                Integer(60, 90, name='roi_t4'),\n                Integer(30, 60, name='roi_t5'),\n                Integer(1, 30, name='roi_t6'),\n            ]\n\n    minimal_roi = {\n        \"0\": 0.10347601757573865,\n        \"3\": 0.050495605759981035,\n        \"5\": 0.03350898081823659,\n        \"61\": 0.0275218557571848,\n        \"292\": 0.005185372158403069,\n        \"399\": 0,\n        \n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_15m = '15m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.15\n\n    # Custom stoploss\n    use_custom_stoploss = False\n    use_sell_signal = True\n\n    startup_candle_count: int = 400\n    ############################################################################\n\n    lambo2_ema_14_factor = DecimalParameter(0.9, 0.99, default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\n    lambo2_rsi_4_limit = IntParameter(2, 50, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\n    lambo2_rsi_14_limit = IntParameter(2, 50, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Multi Offset\n    optimize_buy_ema = False\n    base_nb_candles_buy_ema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n    base_nb_candles_buy_ema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema2 = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(1, 36, default=buy_params['lookback_candles'], space='buy', optimize=True)\n    profit_threshold = DecimalParameter(0.99, 1.05, default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter( 2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    ewo_low2 = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low2'], space='buy', optimize=True)\n    ewo_high2 = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high2'], space='buy', optimize=True)\n    ewo_high_2 = DecimalParameter( -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_buy2 = IntParameter(30, 70, default=buy_params['rsi_buy2'], space='buy', optimize=True)\n    rsi_fast_buy = IntParameter(10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=True)\n\n    ## Buy params\n    max_change_pump = 35\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize = is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12 , 12, default= 0 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50 , optimize = is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_39 = True\n    buy_nfix_39_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_nfix_39)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    #BB MODDED\n    is_optimize_ctt15_protection = False\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, optimize = is_optimize_ctt15_protection)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, optimize = is_optimize_ctt15_protection)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, optimize = is_optimize_ctt15_protection)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, optimize = is_optimize_ctt15_protection)\n\n    is_optimize_ctt25_protection = False\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, optimize = is_optimize_ctt25_protection)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, optimize = is_optimize_ctt25_protection)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, optimize = is_optimize_ctt25_protection)\n\n    #NFI 7 SMA\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    optimize_buy_trima = False\n    base_nb_candles_buy_trima = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n    base_nb_candles_buy_trima2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n\n    optimize_buy_hma = False\n    base_nb_candles_buy_hma = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n    base_nb_candles_buy_hma2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n\n    optimize_buy_zema = False\n    base_nb_candles_buy_zema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n    base_nb_candles_buy_zema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 1.00, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5 , optimize = is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20 , optimize = is_optimize_cti_r)\n\n    optimize_sell_ema = False\n    base_nb_candles_ema_sell = IntParameter(5, 80, default=20, space='sell', optimize=False)\n    high_offset_sell_ema = DecimalParameter(0.99, 1.1, default=1.012, space='sell', optimize=False)\n\n    optimize_buy_pump_protection_01 = True\n    pump_protection_01_pct_change_timeframe = IntParameter(5, 10, default=8, space='buy', optimize=optimize_buy_pump_protection_01)\n    pump_protection_01_pct_change_max = DecimalParameter(0.05, 0.35, default=0.15, space='buy', optimize=optimize_buy_pump_protection_01)\n    pump_protection_01_pct_change_min = DecimalParameter(-0.35, -0.05, default=-0.15, space='buy', optimize=optimize_buy_pump_protection_01)\n\n    pump_protection_01_pct_change_short_timeframe = IntParameter(5, 10, default=8, space='buy', optimize=optimize_buy_pump_protection_01)\n    pump_protection_01_pct_change_short_max = DecimalParameter(0.05, 0.35, default=0.08, space='buy', optimize=optimize_buy_pump_protection_01)\n    pump_protection_01_pct_change_short_min = DecimalParameter(-0.35, -0.05, default=-0.08, space='buy', optimize=optimize_buy_pump_protection_01)\n\n    pump_protection_01_ispumping = DecimalParameter(0.05, 0.35, default=0.2, space='buy', optimize=optimize_buy_pump_protection_01)\n    pump_protection_01_islongpumping = DecimalParameter(0.05, 0.35, default=0.24, space='buy', optimize=optimize_buy_pump_protection_01)\n    pump_protection_01_isshortpumping = DecimalParameter(0.05, 0.35, default=0.12, space='buy', optimize=optimize_buy_pump_protection_01)\n\n    #Protections\n    cooldown_lookback = IntParameter(2, 48, default=2, space=\"protection\", optimize=False)\n\n    low_profit_optimize = False\n    low_profit_lookback = IntParameter(2, 60, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_stop_duration = IntParameter(12, 200, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_min_req = DecimalParameter(-0.05, 0.05, default=-0.05, space=\"protection\", decimals=2, optimize=low_profit_optimize)\n\n        # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    custom_info = {}\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    #############################################################\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n            Rolling Percentage Change Maximum across interval.\n\n            :param dataframe: DataFrame The original OHLC dataframe\n            :param method: High to Low / Open to Close\n            :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    ############################################################################\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.inf_15m) for pair in pairs])\n        informative_pairs += [(\"BTC/USDT\", \"5m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_25'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=26)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n\n                # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = EWO(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        self.custom_info[pair][self.DATESTAMP] = dataframe['date']\n        self.custom_info[pair][self.SELLMA] = dataframe['ema_sell']\n        return True\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float, rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        self.custom_info[pair][self.SELL_TRIGGER] = 0\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe = dump_warning(dataframe, self.buy_threshold.value)\n        # pump detector\n        dataframe['pump'] = pump_warning(dataframe, perc=int(self.max_change_pump)) #25% di pump\n        dataframe['recentispumping'] = pump_warning2(dataframe, {\n                'pct_change_timeframe':         self.pump_protection_01_pct_change_timeframe.value,\n                'pct_change_max':               self.pump_protection_01_pct_change_max.value,\n                'pct_change_min':               self.pump_protection_01_pct_change_min.value,\n                'pct_change_short_timeframe':   self.pump_protection_01_pct_change_short_timeframe.value,\n                'pct_change_short_max':         self.pump_protection_01_pct_change_short_max.value,\n                'pct_change_short_min':         self.pump_protection_01_pct_change_short_min.value,\n                'ispumping':                    self.pump_protection_01_ispumping.value,\n                'islongpumping':                self.pump_protection_01_islongpumping.value,\n                'isshortpumping':               self.pump_protection_01_isshortpumping.value,\n                'ispumping_rolling':            6,\n                'islongpumping_rolling':        12,\n                'isshortpumping_rolling':       3,\n                'recentispumping_rolling':      60\n            })\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n                # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO2'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi_2'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_fast2'] = ta.RSI(dataframe, timeperiod=5)\n        dataframe['rsi_slow2'] = ta.RSI(dataframe, timeperiod=25)\n        dataframe['sqzmi'] = fta.SQZMI(dataframe)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # BB 20 - STD3\n        bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std3['lower']\n        dataframe['bb20_3_mid'] = bb_20_std3['mid']\n        dataframe['bb20_3_upp'] = bb_20_std3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # SMA\n        dataframe['bb9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_84'] = williams_r(dataframe, period=84)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_112'] = williams_r(dataframe, period=112)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        #HA\n        dataframe = HA(dataframe, 4)\n\n        #MAMA\n        dataframe['mama'], dataframe['fama'] = ta.MAMA(dataframe['close'], fastlimit=0.5, slowlimit=0.05)\n\n        #MULTIMA\n        dataframe['ema_offset_buy'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema.value)) *self.low_offset_ema.value\n        dataframe['ema_offset_buy2'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema2.value)) *self.low_offset_ema2.value\n        dataframe['ema_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_ema_sell.value))\n\n        #HMA\n        dataframe['hma_offset_buy'] = qtpylib.hull_moving_average(dataframe['close'], window=int(self.base_nb_candles_buy_hma.value)) *self.low_offset_hma.value\n        dataframe['hma_offset_buy2'] = qtpylib.hull_moving_average(dataframe['close'], window=int(self.base_nb_candles_buy_hma2.value)) *self.low_offset_hma2.value\n\n        #TRIMA\n        dataframe['trima_offset_buy'] = ta.TRIMA(dataframe, int(self.base_nb_candles_buy_trima.value)) *self.low_offset_trima.value\n        dataframe['trima_offset_buy2'] = ta.TRIMA(dataframe, int(self.base_nb_candles_buy_trima2.value)) *self.low_offset_trima2.value\n\n        #ZEMA\n        dataframe['zema_offset_buy'] = zema(dataframe, int(self.base_nb_candles_buy_zema.value)) *self.low_offset_zema.value\n        dataframe['zema_offset_buy2'] = zema(dataframe, int(self.base_nb_candles_buy_zema2.value)) *self.low_offset_zema2.value\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n\n\n        # EMA 200\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        #protection\n        dataframe['slice_close'] = dataframe.loc[[1,8], \"close\"]\n        dataframe['slice_high'] = dataframe.loc[[1,8], \"high\"]\n        dataframe['slice_low'] = dataframe.loc[[1,8], \"low\"]\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # BTC info\n        informative = self.dp.get_pair_dataframe('BTC/USDT', timeframe=self.timeframe)\n        informative = dump_warning(informative, self.buy_threshold.value)\n        dataframe['btc_threshold'] = informative['pair_threshold']\n        dataframe['btc_diff'] = informative['pair_diff']\n        dataframe['btc_5m'] = informative['pair_5m']\n        dataframe['btc_1d'] = informative['pair_1d']\n        dataframe['btc_5m_1d_diff'] = informative['pair_5m_1d_diff']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 15m informative timeframe\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # BTC dump protection\n        dataframe = self.populate_btc_indicators(dataframe, metadata)\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        # Check if the entry already exists\n        if not metadata[\"pair\"] in self.custom_info:\n            # Create empty entry for this pair {datestamp, sellma, sell_trigger}\n            self.custom_info[metadata[\"pair\"]] = ['', 0, 0]\n\n        vwap_low, vwap, vwap_high = VWAPB(dataframe, 20, 1)\n        dataframe['vwap_low'] = vwap_low\n        dataframe['tcp_percent_4'] = self.top_percent_change(dataframe , 4)\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        buy_profit = (\n                (dataframe['close_1h'].rolling(24).max() > (dataframe['close'] * 1.03 ))\n            )\n\n        nfi7_sma_protection = (\n                (dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200']) &\n                (dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h']) &\n                (dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"]) &\n                (dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"]) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value))) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value))) &\n                (dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"]) &\n                (dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n            )\n\n        is_can_buy_smooth_ha = (\n                (dataframe['close'] < dataframe['Smooth_HA_L']) &\n                (dataframe['Smooth_HA_O'].shift(1) < dataframe['Smooth_HA_H'].shift(1))\n            )\n\n        is_can_buy_rsi = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['r_84'] < 60) &\n                (dataframe['r_112'] < 60) &\n                (\n                    (\n                        (dataframe['close'] < dataframe['ema_offset_buy']) &\n                        (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                        (\n                            (dataframe['EWO'] < self.ewo_low.value) |\n                            (\n                                (dataframe['EWO'] > self.ewo_high.value) &\n                                (dataframe['rsi'] < self.rsi_buy.value)\n                            )\n                        )\n                    ) |\n                    (\n                        (dataframe['close'] < dataframe['ema_offset_buy2']) &\n                        (dataframe['pm'] > dataframe['pmax_thresh']) &\n                        (\n                            (dataframe['EWO'] < self.ewo_low2.value) |\n                            (\n                                (dataframe['EWO'] > self.ewo_high2.value) &\n                                (dataframe['rsi'] < self.rsi_buy2.value)\n                            )\n                        )\n                    )\n                )\n            )\n\n        check_pump_01 = (dataframe['pump'].rolling(20).max() < 1)\n\n        check_pump_02 = (dataframe['recentispumping'] == False)\n\n        is_btc_safe = (\n                #(dataframe['btc_diff'] > self.buy_btc_safe.value) &\n                (dataframe['btc_5m_1d_diff'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n            )\n            \n        is_btc_not_safe = (\n                #(dataframe['btc_diff'] > self.buy_btc_safe.value) &\n                (dataframe['btc_5m_1d_diff'] < dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n            )\n\n        is_real_dip = (\n                (dataframe['slice_low'].min() < (dataframe['low'] * 1.05 ))\n            )\n\n        #is_real_no_pump = (\n        #        (dataframe['slice_high'].shift(1).max() <= (dataframe['high'] * 1.1 ))\n        #    )\n\n        is_pair_safe = (\n                #is_real_dip &\n                (dataframe['pair_diff'] > self.buy_btc_safe.value) &\n                (dataframe['pair_5m_1d_diff'] > dataframe['pair_1d'] * self.buy_btc_safe_1d.value)\n            )\n\n        is_MMA_prot = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value) &\n                (dataframe['close_1h'].rolling(288).max() >= (dataframe['close'] * 1.03 )) &\n                (dataframe['close'] < (dataframe['ema_sell'] * self.high_offset_sell_ema.value)) &\n                (dataframe['sqzmi'] == False) &\n                (dataframe['volume'] > 0) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4))\n            )\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_break = (\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_standart_prot = (\n                (\n                    is_btc_safe |\n                    is_pair_safe &\n                    nfi7_sma_protection\n                ) |\n                (                    \n                    is_MMA_prot &\n                    nfi7_sma_protection\n                )\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value) &\n                (dataframe['close_1h'].rolling(288).max() >= (dataframe['close'] * 1.03 )) &\n                (dataframe['close'] < (dataframe['ema_sell'] * self.high_offset_sell_ema.value)) &\n                (dataframe['sqzmi'] == False) &\n                (dataframe['volume'] > 0) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &\n                check_pump_01 &\n                check_pump_02\n            )\n\n        is_protection = (\n                (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                &\n                (dataframe['rsi_fast'] < 35)\n                &\n                (dataframe['uptrend_1h'] > 0)\n                &\n                (dataframe['close'] < dataframe['ma_lower'])\n                &\n                (dataframe['open'] > dataframe['ma_lower'])\n                &\n                (dataframe['volume'] > 0)\n                &\n                (\n                (dataframe['open']<dataframe['ema_fast_1h'])\n                &\n                (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                |\n                (dataframe['open']>dataframe['ema_fast_1h'])\n                &\n                (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n            )\n        )\n\n        is_sqzOff = (\n                (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n                (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen, credit goes to @iterativ\n                #is_can_buy_rsi &\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (\n                is_standart_prot &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                is_standart_prot &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_nfix_3 = (\n                is_standart_prot &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['r_96'] < -80.0) &\n                (dataframe['cti_1h'] < -0.75) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_r_deadfish = (\n                is_standart_prot &\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_gumbo = (\n                is_standart_prot &\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value)\n            )\n\n        is_sqzmom = (\n                is_standart_prot &\n                (is_sqzOff) &\n                (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n                (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n                (dataframe['linreg_val_20'] < 0) &\n                (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n                (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n                (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n            )\n\n        # NFI quick mode, credit goes to @iterativ\n        is_nfi_13 = (\n                is_standart_prot &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (        # NFIX 26\n                is_standart_prot &\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                is_standart_prot &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                is_standart_prot &\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                is_standart_prot &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_12 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['EWO'] > 0.1) &\n                (dataframe['rsi_14'] < 40.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_480_1h'] < -20.0)\n            )\n\n        is_nfix_49 = (\n                is_standart_prot &\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_37 = (\n                is_standart_prot &\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n            ## BB MODDED\n        is_nfi_ctt35 = (\n                is_standart_prot &\n                (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.984) &\n                (dataframe['EWO'] > 9.6) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.5)\n            )\n\n        is_nfi_ctt25 = (\n                is_standart_prot &\n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < self.buy_25_rsi_4.value) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (\n                    (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                    (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                ) &\n                (dataframe['cti'] < self.buy_25_cti.value)\n            )\n\n        is_nfi_ctt15 = (\n                is_standart_prot &\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi_14'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            )\n\n        is_nfi_9 = (\n                is_standart_prot &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.968) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * 0.982) &\n                (dataframe['mfi'] < 50.0) &\n                (dataframe['cti'] < -0.85) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['rsi_14_1h'] > 20.0) &\n                (dataframe['rsi_14_1h'] < 88.0) &\n                (dataframe['crsi_1h'] > 21.0)\n            )\n\n        is_nfi_26 = (\n                is_standart_prot &\n                (dataframe['close'] < (dataframe['zema_61'] * 0.9405)) &\n                (dataframe['cti'] < -0.72) &\n                (dataframe['cci'] < -166.0) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['cti_1h'] < 0.95) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfix_54 = (\n                is_standart_prot &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_50'] * 0.925)\n            )\n\n        is_nfix_53 = (\n                is_standart_prot &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36)) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99)) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['cti_1h'] > -0.7)\n\n            )\n        is_nfix_52 = (\n                is_standart_prot &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998)) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfix_51 = (\n                is_standart_prot &\n                (dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944)) &\n                (dataframe['ewo_15m'] < -1.0) &\n                (dataframe['rsi_14_15m'] > 28.0) &\n                (dataframe['cti_15m'] < -0.84) &\n                (dataframe['r_14_15m'] < -94.0) &\n                (dataframe['rsi_14'] > 30.0) &\n                (dataframe['crsi_1h'] > 1.0)\n            )\n\n        is_nfix_48 = (\n                is_standart_prot &\n                (dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95)) &\n                (dataframe['close_15m'] > (dataframe['open_15m'].shift(3))) &\n                (dataframe['ewo_15m'] > 2.8) &\n                (dataframe['cti_15m'] < -0.75) &\n                (dataframe['r_14_15m'].shift(3) < -94.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 18.0)\n            )\n\n        is_nfix_47 = (\n                is_standart_prot &\n                (dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3)) &\n                (dataframe['ema_20_1h'] > dataframe['ema_25_1h']) &\n                (dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95)) &\n                (\n                    ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                    ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h']))\n                ) &\n                (dataframe['cti_15m'] < -0.9) &\n                (dataframe['r_14_15m'] < -90.0) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 8.0)\n            )\n\n        is_nfix_41 = (\n                is_standart_prot &\n                (dataframe['ema_12_15m'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n            )\n\n        is_nfix_36 = (\n                is_standart_prot &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_nfix_204 = (\n                is_standart_prot &\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_203 = (\n                is_standart_prot &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -6.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfix_202 = (\n                is_standart_prot &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * 0.84)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999)) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['rsi_14'] > 25.0) &\n                (dataframe['mfi'] > 18.0) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['r_14'].shift(1) < -94.0) &\n                (dataframe['crsi_1h'] > 12.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 1.6))\n            )\n\n        is_nfix_201 = (\n                is_standart_prot &\n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < 30.0) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.953) &\n                (dataframe['cti'] < -0.78) &\n                (dataframe['cci'] < -200.0)\n            )\n\n        is_nfix_34 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.972)) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi_14'] < 18.0)\n            )\n\n        is_nfix_28 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['sma_75'] * 0.96) &\n                (dataframe['EWO'] < -8.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 14.0)\n            )\n\n        is_nfix_27 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['sma_75'] * 0.934) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['r_14'] < -96.0)\n            )\n\n        is_nfix_19 = (\n                is_standart_prot &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['cti_1h'] > -0.75) &\n                (dataframe['cti_1h'] < 0.25)\n            )\n\n        is_nfix_11 = (\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['rsi_14'] < 25.0)\n            )\n\n        is_nfix_9 = (\n                is_standart_prot &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 20.0)\n            )\n\n        is_nfix_36 = (\n                is_standart_prot &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_nfi_sma_2 = (\n                is_standart_prot &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_3 = (\n                is_standart_prot &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_4 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n\n        is_nfi_sma_5 = (\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_6 = (\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_7 = (\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n                (dataframe['volume'] > 0)\n            )\n\n\n        is_nfi_sma_9 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_10 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_12 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['EWO'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_15 = (\n                is_standart_prot &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_16 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['EWO'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_17 = (\n                is_standart_prot &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['EWO'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_22 = (\n                is_standart_prot &\n                ((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume']) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value)) &\n                (dataframe['EWO'] > self.buy_ewo_22.value) &\n                (dataframe['rsi'] < self.buy_rsi_22.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_23 = (\n                is_standart_prot &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value)) &\n                (dataframe['EWO'] > self.buy_ewo_23.value) &\n                (dataframe['rsi'] < self.buy_rsi_23.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_23.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_btc_safe = (\n                (pct_change(dataframe['btc_1d'], dataframe['btc_5m']).fillna(0) > self.buy_btc_safe_1d.value) &\n                (dataframe['volume'] > 0)           # Make sure Volume is not 0\n        )\n\n        is_nasos_1 = (\n                is_standart_prot &\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO2'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            )\n\n        is_nasos_2 = (\n                is_standart_prot &\n                (dataframe['rsi_fast2'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO2'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            )\n\n        is_VWAP = (\n                is_standart_prot &\n                (\n                    is_MMA_prot |\n                    nfi7_sma_protection\n                ) &\n                (dataframe['close'] < dataframe['vwap_low']) &\n                (dataframe['tcp_percent_4'] > 0.04) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi'] < 35) &\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_fama = (\n                is_btc_safe &\n                is_pair_safe &\n                is_can_buy_rsi &\n                is_real_dip &\n                nfi7_sma_protection &\n                is_additional_check &\n                is_can_buy_smooth_ha &\n                buy_profit &\n                (dataframe['close'].rolling(288).max() >= (dataframe['close'] * 1.50 )) &\n                (qtpylib.crossed_above(dataframe['mama'], dataframe['fama'])) &\n                (dataframe['mama'].shift() > (dataframe['mama'] * 0.99))\n            )\n\n        is_hma = (\n                is_btc_safe &\n                is_pair_safe &\n                is_can_buy_rsi &\n                is_real_dip &\n                nfi7_sma_protection &\n                is_additional_check &\n                is_can_buy_smooth_ha &\n                buy_profit &\n                (\n                    (\n                        (\n                            (dataframe['close'] < dataframe['hma_offset_buy']) &\n                            (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                            (dataframe['rsi'] < 35)\n                        ) |\n                        (\n                            (dataframe['close'] < dataframe['hma_offset_buy2']) &\n                            (dataframe['pm'] > dataframe['pmax_thresh']) &\n                            (dataframe['rsi'] < 30)\n                        )\n                    ) &\n                    (dataframe['rsi_fast'] < 30)\n                )\n            )\n\n        is_trima = (\n                is_btc_safe &\n                is_pair_safe &\n                is_can_buy_rsi &\n                is_real_dip &\n                nfi7_sma_protection &\n                is_additional_check &\n                is_can_buy_smooth_ha &\n                buy_profit &\n                (\n                    (\n                        (dataframe['close'] < dataframe['trima_offset_buy']) &\n                        (dataframe['pm'] <= dataframe['pmax_thresh'])\n                    ) |\n                    (\n                        (dataframe['close'] < dataframe['trima_offset_buy2']) &\n                        (dataframe['pm'] > dataframe['pmax_thresh'])\n                    )\n                )\n            )\n\n        is_zema = (\n                is_btc_safe &\n                is_pair_safe &\n                is_can_buy_rsi &\n                is_real_dip &\n                nfi7_sma_protection &\n                is_additional_check &\n                is_can_buy_smooth_ha &\n                buy_profit &\n                (\n                    (\n                        (dataframe['close'] < dataframe['zema_offset_buy']) &\n                        (dataframe['pm'] <= dataframe['pmax_thresh'])\n                    ) |\n                    (\n                        (dataframe['close'] < dataframe['zema_offset_buy2']) &\n                        (dataframe['pm'] > dataframe['pmax_thresh'])\n                    )\n                )\n            )\n\n        is_clucHA = (\n                is_btc_safe &\n                is_pair_safe &\n                is_can_buy_rsi &\n                is_real_dip &\n                (\n                    is_MMA_prot |\n                    nfi7_sma_protection\n                ) &\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                    (dataframe['bb_lowerband2_40'].shift() > 0) &\n                    (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                    (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                    (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                    (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                    (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                )\n            )\n\n        ## Condition Append\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_nfix_3)                                                 # ~2.86 / 91.5% / 33.31%     D\n        dataframe.loc[is_nfix_3, 'buy_tag'] += 'is_nfix_3 '\n\n        conditions.append(is_VWAP)                                                 # ~2.86 / 91.5% / 33.31%     D\n        dataframe.loc[is_VWAP, 'buy_tag'] += 'is_VWAP '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_12)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_12, 'buy_tag'] += 'nfix_2 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n\n        conditions.append(is_nfi_ctt35)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_nfi_ctt35, 'buy_tag'] += 'nfi_ctt35 '\n\n        conditions.append(is_nfi_ctt25)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_nfi_ctt25, 'buy_tag'] += 'nfi_ctt25 '\n\n        conditions.append(is_nfi_ctt15)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_nfi_ctt15, 'buy_tag'] += 'nfi_ctt15 '\n\n        conditions.append(is_nfix_54)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_nfix_54, 'buy_tag'] += 'nfix_54 '\n\n        conditions.append(is_nfix_53)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_nfix_53, 'buy_tag'] += 'nfix_53 '\n\n        conditions.append(is_nfix_52)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_nfix_52, 'buy_tag'] += 'nfix_52 '\n\n        conditions.append(is_nfix_51)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_nfix_51, 'buy_tag'] += 'nfix_51 '\n\n        conditions.append(is_nfix_48)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_nfix_48, 'buy_tag'] += 'nfix_48 '\n\n        conditions.append(is_nfix_47)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfix_47, 'buy_tag'] += 'nfix_47 '\n\n        conditions.append(is_nfix_41)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfix_41, 'buy_tag'] += 'nfix_41 '\n\n        conditions.append(is_nfix_36)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfix_204)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_204, 'buy_tag'] += 'nfix_204 '\n\n        conditions.append(is_nfix_203)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_203, 'buy_tag'] += 'nfix_203 '\n\n        conditions.append(is_nfix_202)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_202, 'buy_tag'] += 'nfix_202 '\n\n        conditions.append(is_nfix_201)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_201, 'buy_tag'] += 'nfix_201 '\n\n        conditions.append(is_nfix_34)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_34, 'buy_tag'] += 'nfix_34 '\n\n        conditions.append(is_nfix_28)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_28, 'buy_tag'] += 'nfix_28 '\n\n        conditions.append(is_nfix_27)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_27, 'buy_tag'] += 'nfix_27 '\n\n        conditions.append(is_nfix_19)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_19, 'buy_tag'] += 'nfix_19 '\n\n        conditions.append(is_nfix_11)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_11, 'buy_tag'] += 'nfix_11 '\n\n        conditions.append(is_nfix_9)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_9, 'buy_tag'] += 'nfix_9 '\n\n        conditions.append(is_nfix_36)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfi_sma_2)\n        dataframe.loc[is_nfi_sma_2, 'buy_tag'] += 'is_nfi_sma_2 '\n\n        conditions.append(is_nfi_sma_3)\n        dataframe.loc[is_nfi_sma_3, 'buy_tag'] += 'is_nfi_sma_3 '\n\n        conditions.append(is_nfi_sma_4)\n        dataframe.loc[is_nfi_sma_4, 'buy_tag'] += 'is_nfi_sma_4 '\n\n        conditions.append(is_nfi_sma_5)\n        dataframe.loc[is_nfi_sma_5, 'buy_tag'] += 'is_nfi_sma_5 '\n\n        conditions.append(is_nfi_sma_6)\n        dataframe.loc[is_nfi_sma_6, 'buy_tag'] += 'is_nfi_sma_6 '\n\n        conditions.append(is_nfi_sma_7)\n        dataframe.loc[is_nfi_sma_7, 'buy_tag'] += 'is_nfi_sma_7 '\n\n        conditions.append(is_nfi_sma_9)\n        dataframe.loc[is_nfi_sma_9, 'buy_tag'] += 'is_nfi_sma_9 '\n\n        conditions.append(is_nfi_sma_10)\n        dataframe.loc[is_nfi_sma_10, 'buy_tag'] += 'is_nfi_sma_10 '\n\n        conditions.append(is_nfi_sma_12)\n        dataframe.loc[is_nfi_sma_12, 'buy_tag'] += 'is_nfi_sma_12 '\n\n        conditions.append(is_nfi_sma_15)\n        dataframe.loc[is_nfi_sma_15, 'buy_tag'] += 'is_nfi_sma_15 '\n\n        conditions.append(is_nfi_sma_16)\n        dataframe.loc[is_nfi_sma_16, 'buy_tag'] += 'is_nfi_sma_16 '\n\n        conditions.append(is_nfi_sma_17)\n        dataframe.loc[is_nfi_sma_17, 'buy_tag'] += 'is_nfi_sma_17 '\n\n        conditions.append(is_nfi_sma_22)\n        dataframe.loc[is_nfi_sma_22, 'buy_tag'] += 'is_nfi_sma_22 '\n\n        conditions.append(is_nfi_sma_23)\n        dataframe.loc[is_nfi_sma_23, 'buy_tag'] += 'is_nfi_sma_23 '\n\n        conditions.append(is_nasos_1)                                                #     -\n        dataframe.loc[is_nasos_1, 'buy_tag'] += 'is_nasos_1 '\n\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'is_clucHA '                                #     ---\n        conditions.append(is_clucHA)\n\n        dataframe.loc[is_nasos_2, 'buy_tag'] += 'is_nasos_2 '                                #     ---\n        conditions.append(is_nasos_2)\n\n        conditions.append(is_hma)\n        dataframe.loc[is_hma, 'buy_tag'] += 'is_hma '\n\n        conditions.append(is_zema)\n        dataframe.loc[is_zema, 'buy_tag'] += 'is_zema '\n\n        conditions.append(is_trima)                                                #     -\n        dataframe.loc[is_trima, 'buy_tag'] += 'is_trima '\n\n        dataframe.loc[is_fama, 'buy_tag'] += 'is_fama '                                #     ---\n        conditions.append(is_fama)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\nclass UziChanTB2(BB_RPB_TSL_SMA_Tranz):\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n    custom_info_trail_sell = dict()    \n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_sell_order_enabled = True    \n    trailing_expire_seconds = 1800      #NOTE 5m timeframe\n    #trailing_expire_seconds = 1800/5    #NOTE 1m timeframe\n    #trailing_expire_seconds = 1800*3    #NOTE 15m timeframe\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = True\n    trailing_sell_uptrend_enabled = True    \n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    trailing_sell_max_stop = 0.02   # stop trailing sell if current_price < starting_price * (1+trailing_buy_max_stop)\n    trailing_sell_max_sell = 0.000  # sell if price between downlimit (=max of serie (current_price * (1 + trailing_sell_offset())) and (start_price * 1+trailing_sell_max_sell))\n\n    abort_trailing_when_sell_signal_triggered = False\n\n\n    init_trailing_buy_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,  \n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    init_trailing_sell_dict = {\n        'trailing_sell_order_started': False,\n        'trailing_sell_order_downlimit': 0,        \n        'start_trailing_sell_price': 0,\n        'sell_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_sell_trailing': False,\n    }    \n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_buy_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_sell(self, pair, reinit=False):\n        # returns trailing sell info for pair (init if necessary)\n        if not pair in self.custom_info_trail_sell:\n            self.custom_info_trail_sell[pair] = dict()\n        if (reinit or not 'trailing_sell' in self.custom_info_trail_sell[pair]):\n            self.custom_info_trail_sell[pair]['trailing_sell'] = self.init_trailing_sell_dict.copy()\n        return self.custom_info_trail_sell[pair]['trailing_sell']\n\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_buy_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n\n\n    def trailing_sell_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_sell = self.trailing_sell(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_sell['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\"'\\033[36m'SELL: \"\n                f\"pair: {pair} : \"\n                f\"start: {trailing_sell['start_trailing_sell_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"downlimit: {trailing_sell['trailing_sell_order_downlimit']:.4f}, \"\n                f\"profit: {self.current_trailing_sell_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_sell['offset']}\")\n\n    def current_trailing_buy_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def current_trailing_sell_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_sell = self.trailing_sell(pair)\n        if trailing_sell['trailing_sell_order_started']:\n            return (current_price - trailing_sell['start_trailing_sell_price'])/ trailing_sell['start_trailing_sell_price']\n            #return 0-((trailing_sell['start_trailing_sell_price'] - current_price) / trailing_sell['start_trailing_sell_price'])\n        else:\n            return 0\n\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_buy_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.0045 * (1 + adapt)        #NOTE: default_offset 0.0045 <--> 0.009\n        \n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    def trailing_sell_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_sell_profit_ratio = self.current_trailing_sell_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\n        \n        trailing_sell  = self.trailing_sell(pair)\n        if not trailing_sell['trailing_sell_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration =  current_time - trailing_sell['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_sell_profit_ratio > 0) and (last_candle['sell'] != 0)):\n                # more than 1h, price over first signal, sell signal still active -> sell\n                return 'forcesell'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_sell_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_sell_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is falling, sell \n            return 'forcesell'\n\n        if current_trailing_sell_profit_ratio > 0:\n            # current price is lower than initial price\n            return default_offset\n\n        trailing_sell_offset = {\n            # 0.06: 0.02,\n            # 0.03: 0.01,\n            0.1: default_offset,\n        }\n\n        for key in trailing_sell_offset:\n            if current_trailing_sell_profit_ratio < key:\n                return trailing_sell_offset[key]\n\n        return default_offset\n\n    # end of trailing sell parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])   \n        self.trailing_sell(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n            val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n            \n            if val:\n                if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                    val = False\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    if(len(dataframe) >= 1):\n                        last_candle = dataframe.iloc[-1].squeeze()\n                        current_price = rate\n                        trailing_buy = self.trailing_buy(pair)\n                        trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                        if trailing_buy['allow_trailing']:\n                            if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                                # start trailing buy\n                                \n                                trailing_buy['trailing_buy_order_started'] = True\n                                trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                                trailing_buy['start_trailing_price'] = last_candle['close']\n                                trailing_buy['buy_tag'] = last_candle['buy_tag']\n                                trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                                trailing_buy['offset'] = 0\n                                \n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                            elif trailing_buy['trailing_buy_order_started']:\n                                if trailing_buy_offset == 'forcebuy':\n                                    # buy in custom conditions\n                                    val = True\n                                    ratio = \"%.2f\" % ((self.current_trailing_buy_profit_ratio(pair, current_price)) * 100)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                                elif trailing_buy_offset is None:\n                                    # stop trailing buy custom conditions\n                                    self.trailing_buy(pair, reinit=True)\n                                    logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                                elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                    # update uplimit\n                                    old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                                elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                    # buy ! current price > uplimit && lower thant starting price\n                                    val = True\n                                    ratio = \"%.2f\" % ((self.current_trailing_buy_profit_ratio(pair, current_price)) * 100)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                                elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                    # stop trailing buy because price is too high\n                                    self.trailing_buy(pair, reinit=True)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                                else:\n                                    # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'price too high for {pair} !')\n\n                        else:\n                            logger.info(f\"Wait for next buy signal for {pair}\")\n\n                    if (val == True):\n                        self.trailing_buy_info(pair, rate)\n                        self.trailing_buy(pair, reinit=True)\n                        logger.info(f'STOP trailing buy for {pair} because I buy it')\n            \n            return val\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super().confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)        \n\n        if val:\n            if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_sell= self.trailing_sell(pair)\n                    trailing_sell_offset = self.trailing_sell_offset(dataframe, pair, current_price)\n\n                    if trailing_sell['allow_sell_trailing']:\n                        if (not trailing_sell['trailing_sell_order_started'] and (last_candle['sell'] != 0)):\n                            trailing_sell['trailing_sell_order_started'] = True\n                            trailing_sell['trailing_sell_order_downlimit'] = last_candle['close']\n                            trailing_sell['start_trailing_sell_price'] = last_candle['close']\n                            trailing_sell['sell_tag'] = last_candle['sell_tag']\n                            trailing_sell['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_sell['offset'] = 0\n                            \n                            self.trailing_sell_info(pair, current_price)\n                            logger.info(f'start trailing sell for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_sell['trailing_sell_order_started']:\n                            if trailing_sell_offset == 'forcesell':\n                                # sell in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f\"FORCESELL for {pair} ({ratio} %, {current_price})\")\n\n                            elif trailing_sell_offset is None:\n                                # stop trailing sell custom conditions\n                                self.trailing_sell(pair, reinit=True)\n                                logger.info(f'STOP trailing sell for {pair} because \"trailing sell offset\" returned None')\n\n                            elif current_price > trailing_sell['trailing_sell_order_downlimit']:\n                                # update downlimit\n                                old_downlimit = trailing_sell[\"trailing_sell_order_downlimit\"]\n                                self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'] = max(current_price * (1 - trailing_sell_offset), self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'])\n                                self.custom_info_trail_sell[pair]['trailing_sell']['offset'] = trailing_sell_offset\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'update trailing sell for {pair} at {old_downlimit} -> {self.custom_info_trail_sell[pair][\"trailing_sell\"][\"trailing_sell_order_downlimit\"]}')\n\n                            elif current_price > (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_sell)):\n                                # sell! current price < downlimit && higher than starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) < downlimit ({trailing_sell['trailing_sell_order_downlimit']}) but higher than starting price ({(trailing_sell['start_trailing_sell_price'] * (1 + self.trailing_sell_max_sell))}). OK for {pair} ({ratio} %)\")\n\n                            elif current_price < (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_stop)):\n                                # stop trailing, sell fast, price too low\n                                val = True                                \n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'STOP trailing sell for {pair} because of the price is much lower than starting price * {1 + self.trailing_sell_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'price too low for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next sell signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_sell_info(pair, rate)\n                    self.trailing_sell(pair, reinit=True)\n                    logger.info(f'STOP trailing sell for {pair} because I SOLD it')\n\n        #if (sell_reason != 'sell_signal') | (sell_reason!='force_sell'):\n        if (sell_reason != 'sell_signal'):\n            val = True\n\n        return val\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"                        \n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_sell_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.abort_trailing_when_sell_signal_triggered and self.config['runmode'].value in ('live', 'dry_run'):\n            last_candle = dataframe.iloc[-1].squeeze()\n            if (last_candle['sell'] != 0):\n                trailing_buy = self.trailing_buy(metadata['pair'])\n                if trailing_buy['trailing_buy_order_started']:\n                    logger.info(f\"Sell signal for {metadata['pair']} is triggered!!! Abort trailing\")\n                    self.trailing_buy(metadata['pair'], reinit=True)        \n\n        if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_sell = self.trailing_sell(metadata['pair'])\n            if (last_candle['sell'] != 0):\n                if not trailing_sell['trailing_sell_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    #if not open_trades: \n                    if open_trades:\n                        logger.info(f\"Set 'allow_SELL_trailing' to True for {metadata['pair']} to start *SELL* trailing\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_sell['allow_sell_trailing'] = True\n                        initial_sell_tag = last_candle['sell_tag'] if 'sell_tag' in last_candle else 'sell signal'\n                        dataframe.loc[:, 'sell_tag'] = f\"{initial_sell_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_sell['trailing_sell_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger sell signal!\")\n                    dataframe.loc[:,'sell'] = 1\n                    dataframe.loc[:, 'sell_tag'] = trailing_sell['sell_tag']\n\n        return dataframe\n\n\n    plot_config = {\n      'main_plot':{\n            'uc_up':{'color':'gray'},\n            'uc_mid':{'color':'green'},\n            'uc_low' :{'color':'gray'},        \n            },\n      'subplots': {                 \n      }  \n    }     "
  },
  {
    "path": "strategies/BB_RPB_TSL_SMA_Tranz_TB_1_1_1/BB_RPB_TSL_SMA_Tranz_TB_1_1_1.py",
    "content": "# --- Do not remove these libs ---\nimport pandas_ta as pta\nimport copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom random import shuffle\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\nimport time\n\nlog = logging.getLogger(__name__)\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL_SMA_Tranz_TB_1_1_1(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.983,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.04796,\n        \"buy_clucha_bbdelta_tail\": 0.93112,\n        \"buy_clucha_close_bblower\": 0.01645,\n        \"buy_clucha_closedelta_close\": 0.00931,\n        \"buy_clucha_rocr_1h\": 0.41663,\n        ##\n        \"buy_ema_high_2\": 1.04116,\n        \"buy_ema_low_2\": 0.97463,\n        \"buy_ewo_high_2\": 5.249,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n        ##DIAMOND\n        \"buy_fast\": 31,\n        \"buy_push\": 0.72,\n        \"buy_shift\": -7,\n        \"buy_slow\": 2,\n    }\n    #############################################################\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n        #DIAMOND\n        \"sell_fast\": 17,\n        \"sell_push\": 1.493,\n        \"sell_shift\": -7,\n        \"sell_slow\": 28,\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n\n    minimal_roi = {\n        \"0\": 0.205,\n        \"81\": 0.038,\n        \"292\": 0.005,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n    inf_15m = '15m'\n    info_timefame_1d = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_15m = '15m'\n    res_timeframe = 'none'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    startup_candle_count: int = 400\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize = is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12 , 12, default= 0 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50 , optimize = is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_39 = True\n    buy_nfix_39_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_nfix_39)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    #BB MODDED\n    is_optimize_ctt15_protection = False\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, optimize = is_optimize_ctt15_protection)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, optimize = is_optimize_ctt15_protection)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, optimize = is_optimize_ctt15_protection)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, optimize = is_optimize_ctt15_protection)\n\n    is_optimize_ctt25_protection = False\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, optimize = is_optimize_ctt25_protection)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, optimize = is_optimize_ctt25_protection)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, optimize = is_optimize_ctt25_protection)\n\n    #DIAMOND\n    is_diamond_protection = False\n    buy_push = DecimalParameter(0, 2, decimals=3, default=1, optimize = is_diamond_protection)\n    buy_shift = IntParameter(-10, 0, default=-6, optimize = is_diamond_protection)\n    buy_fast = IntParameter(2, 50, default=9, optimize = is_diamond_protection)\n    buy_slow = IntParameter(2, 50, default=18, optimize = is_diamond_protection)\n\n    #NFI 7 SMA\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 1.00, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5 , optimize = is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20 , optimize = is_optimize_cti_r)\n\n    #DIAMOND\n    is_optimize_diamondprofit = False\n    sell_push = DecimalParameter(0, 2, decimals=3,  default=1 , optimize = is_optimize_diamondprofit)\n    sell_shift = IntParameter(-10, 0, default=-6 , optimize = is_optimize_diamondprofit)\n    sell_fast = IntParameter(2, 50, default=9 , optimize = is_optimize_diamondprofit)\n    sell_slow = IntParameter(2, 50, default=18 , optimize = is_optimize_diamondprofit)\n\n        # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    #############################################################\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n            Rolling Percentage Change Maximum across interval.\n\n            :param dataframe: DataFrame The original OHLC dataframe\n            :param method: High to Low / Open to Close\n            :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs.extend = [(pair, '15m') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_25'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=26)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n\n                # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = EWO(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # BB 20 - STD3\n        bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std3['lower']\n        dataframe['bb20_3_mid'] = bb_20_std3['mid']\n        dataframe['bb20_3_upp'] = bb_20_std3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # SMA\n        dataframe['bb9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n\n\n        # EMA 200\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            (\n                buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200']) &\n                buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h']) &\n                buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"]) &\n                buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"]) &\n                buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value))) &\n                buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value))) &\n                buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"]) &\n                buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n            )\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_sqzOff = (\n                (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n                (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen, credit goes to @iterativ\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_nfix_3 = (\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['r_96'] < -80.0) &\n                (dataframe['cti_1h'] < -0.75) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                )\n            )\n\n        is_cofi = (                                                                         # Modified from cofi, credit goes to original author \"slack user CofiBit\"\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_r14.value)\n            )\n\n        is_gumbo = (                                                                        # Modified from gumbo1, creadit goes to original author @raph92\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value)\n            )\n\n        is_sqzmom = (                                                                       # Modified from squeezeMomentum, credit goes to original author @LazyBear of TradingView\n                (is_sqzOff) &\n                (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n                (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n                (dataframe['linreg_val_20'] < 0) &\n                (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n                (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n                (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n            )\n\n        # NFI quick mode, credit goes to @iterativ\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_12 = (\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['EWO'] > 0.1) &\n                (dataframe['rsi_14'] < 40.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_480_1h'] < -20.0)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_33 = (\n                (dataframe['moderi_96']) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.988)) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi'] < 32.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfi7_37 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n            ## BB MODDED\n        is_nfi_ctt35 = (\n                (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.984) &\n                (dataframe['EWO'] > 9.6) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.5)\n            )\n\n        is_nfi_ctt25 = (\n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < self.buy_25_rsi_4.value) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (\n                    (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                    (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                ) &\n                (dataframe['cti'] < self.buy_25_cti.value)\n            )\n\n        is_nfi_ctt15 = (\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi_14'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            )\n\n        is_nfix_39 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07)) &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb_lowerband2_40'].shift().gt(0)) &\n                (dataframe['bb_delta_cluc'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb_delta_cluc'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb_lowerband2_40'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_13'] * self.buy_nfix_39_ema.value)\n            )\n\n        is_nfi_9 = (\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.968) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * 0.982) &\n                (dataframe['mfi'] < 50.0) &\n                (dataframe['cti'] < -0.85) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['rsi_14_1h'] > 20.0) &\n                (dataframe['rsi_14_1h'] < 88.0) &\n                (dataframe['crsi_1h'] > 21.0)\n            )\n\n        # EDIT ME MAYBE? this was ema fast = SMA now i made it ema_fast is larger then SMA\n        is_diamond = (\n                (dataframe['ema_20'] > ta.SMA(dataframe, timeperiod=int(self.buy_fast.value))) &\n                (dataframe['ema_25'] > ta.SMA(dataframe, timeperiod=int(self.buy_slow.value)))\n            )\n\n        is_nfi_26 = (\n                (dataframe['close'] < (dataframe['zema_61'] * 0.9405)) &\n                (dataframe['cti'] < -0.72) &\n                (dataframe['cci'] < -166.0) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['cti_1h'] < 0.95) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfix_54 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_50'] * 0.925)\n            )\n\n        is_nfix_53 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36)) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99)) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['cti_1h'] > -0.7)\n\n            )\n        is_nfix_52 = (\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998)) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfix_51 = (\n                (dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944)) &\n                (dataframe['ewo_15m'] < -1.0) &\n                (dataframe['rsi_14_15m'] > 28.0) &\n                (dataframe['cti_15m'] < -0.84) &\n                (dataframe['r_14_15m'] < -94.0) &\n                (dataframe['rsi_14'] > 30.0) &\n                (dataframe['crsi_1h'] > 1.0)\n            )\n\n        is_nfix_48 = (\n                (dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95)) &\n                (dataframe['close_15m'] > (dataframe['open_15m'].shift(3))) &\n                (dataframe['ewo_15m'] > 2.8) &\n                (dataframe['cti_15m'] < -0.75) &\n                (dataframe['r_14_15m'].shift(3) < -94.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 18.0)\n            )\n\n        is_nfix_47 = (\n                (dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3)) &\n                (dataframe['ema_20_1h'] > dataframe['ema_25_1h']) &\n                (dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95)) &\n                (\n                    ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                    ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h']))\n                ) &\n                (dataframe['cti_15m'] < -0.9) &\n                (dataframe['r_14_15m'] < -90.0) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 8.0)\n            )\n\n        is_nfix_41 = (\n                (dataframe['ema_12_15m'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n            )\n\n        is_nfix_38 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['mfi'] < 34.5) &\n                (dataframe['r_64'] < -65.0) &\n                (dataframe['r_96'] < -50.0) &\n                (dataframe['r_480_1h'] < -1.0)\n            )\n\n        is_nfix_36 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_nfix_204 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_203 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -6.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfix_202 = (\n                (dataframe['close'] > (dataframe['ema_200_1h'] * 0.84)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999)) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['rsi_14'] > 25.0) &\n                (dataframe['mfi'] > 18.0) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['r_14'].shift(1) < -94.0) &\n                (dataframe['crsi_1h'] > 12.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 1.6))\n            )\n\n        is_nfix_201 = (\n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < 30.0) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.953) &\n                (dataframe['cti'] < -0.78) &\n                (dataframe['cci'] < -200.0)\n            )\n\n        is_nfix_34 = (\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.972)) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi_14'] < 18.0)\n            )\n\n        is_nfix_28 = (\n                (dataframe['close'] < dataframe['sma_75'] * 0.96) &\n                (dataframe['EWO'] < -8.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 14.0)\n            )\n\n        is_nfix_27 = (\n                (dataframe['close'] < dataframe['sma_75'] * 0.934) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['r_14'] < -96.0)\n            )\n\n        is_nfix_19 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['cti_1h'] > -0.75) &\n                (dataframe['cti_1h'] < 0.25)\n            )\n\n        is_nfix_11 = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['rsi_14'] < 25.0)\n            )\n\n        is_nfix_9 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 20.0)\n            )\n\n        is_nfix_36 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_nfi_sma_1 = (\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_2 = (\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_3 = (\n\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_4 = (\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n\n        is_nfi_sma_5 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_6 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_7 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_8 = (\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_9 = (\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_10 = (\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n        )\n        is_nfi_sma_11 = (\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_12 = (\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['EWO'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_13 = (\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['EWO'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_14 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_15 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n                (dataframe['volume'] > 0)\n                   )\n\n        is_nfi_sma_16 = (\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['EWO'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_17 = (\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['EWO'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_18 = (\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_19 = (\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_20 = (\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_21 = (\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_22 = (\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume']) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value)) &\n                (dataframe['EWO'] > self.buy_ewo_22.value) &\n                (dataframe['rsi'] < self.buy_rsi_22.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_23 = (\n\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value)) &\n                (dataframe['EWO'] > self.buy_ewo_23.value) &\n                (dataframe['rsi'] < self.buy_rsi_23.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_23.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_24 = (\n\n                (dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12)) &\n                (dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12)) &\n                (dataframe['ema_12_1h'] > dataframe['ema_35_1h']) &\n                (dataframe['cmf_1h'].shift(12) < 0) &\n                (dataframe['cmf_1h'] > 0) &\n                (dataframe['rsi'] < self.buy_24_rsi_max.value) &\n                (dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_nfix_3)                                                 # ~2.86 / 91.5% / 33.31%     D\n        dataframe.loc[is_nfix_3, 'buy_tag'] += 'is_nfix_3 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_12)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_12, 'buy_tag'] += 'nfix_2 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_33)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfi7_33, 'buy_tag'] += 'nfi7_33 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n\n        conditions.append(is_nfi_ctt35)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_nfi_ctt35, 'buy_tag'] += 'nfi_ctt35 '\n\n        conditions.append(is_nfi_ctt25)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_nfi_ctt25, 'buy_tag'] += 'nfi_ctt25 '\n\n        conditions.append(is_nfi_ctt15)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_nfi_ctt15, 'buy_tag'] += 'nfi_ctt15 '\n\n        conditions.append(is_diamond)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_diamond, 'buy_tag'] += 'diamond '\n\n        conditions.append(is_nfix_54)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_nfix_54, 'buy_tag'] += 'nfix_54 '\n\n        conditions.append(is_nfix_53)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_nfix_53, 'buy_tag'] += 'nfix_53 '\n\n        conditions.append(is_nfix_52)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_nfix_52, 'buy_tag'] += 'nfix_52 '\n\n        conditions.append(is_nfix_51)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_nfix_51, 'buy_tag'] += 'nfix_51 '\n\n        conditions.append(is_nfix_48)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_nfix_48, 'buy_tag'] += 'nfix_48 '\n\n        conditions.append(is_nfix_47)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfix_47, 'buy_tag'] += 'nfix_47 '\n\n        conditions.append(is_nfix_41)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfix_41, 'buy_tag'] += 'nfix_41 '\n\n        conditions.append(is_nfix_38)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfix_38, 'buy_tag'] += 'nfix_38 '\n\n        conditions.append(is_nfix_36)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfix_204)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_204, 'buy_tag'] += 'nfix_204 '\n\n        conditions.append(is_nfix_203)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_203, 'buy_tag'] += 'nfix_203 '\n\n        conditions.append(is_nfix_202)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_202, 'buy_tag'] += 'nfix_202 '\n\n        conditions.append(is_nfix_201)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_201, 'buy_tag'] += 'nfix_201 '\n\n        conditions.append(is_nfix_34)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_34, 'buy_tag'] += 'nfix_34 '\n\n        conditions.append(is_nfix_28)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_28, 'buy_tag'] += 'nfix_28 '\n\n        conditions.append(is_nfix_27)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_27, 'buy_tag'] += 'nfix_27 '\n\n        conditions.append(is_nfix_19)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_19, 'buy_tag'] += 'nfix_19 '\n\n        conditions.append(is_nfix_11)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_11, 'buy_tag'] += 'nfix_11 '\n\n        conditions.append(is_nfix_9)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_9, 'buy_tag'] += 'nfix_9 '\n\n        conditions.append(is_nfix_36)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfix_39)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_39, 'buy_tag'] += 'nfix_39 '\n\n        conditions.append(is_nfi_sma_1)\n        dataframe.loc[is_nfi_sma_1, 'buy_tag'] += 'is_nfi_sma_1 '\n\n        conditions.append(is_nfi_sma_2)\n        dataframe.loc[is_nfi_sma_2, 'buy_tag'] += 'is_nfi_sma_2 '\n\n        conditions.append(is_nfi_sma_3)\n        dataframe.loc[is_nfi_sma_3, 'buy_tag'] += 'is_nfi_sma_3 '\n\n        conditions.append(is_nfi_sma_4)\n        dataframe.loc[is_nfi_sma_4, 'buy_tag'] += 'is_nfi_sma_4 '\n\n        conditions.append(is_nfi_sma_5)\n        dataframe.loc[is_nfi_sma_5, 'buy_tag'] += 'is_nfi_sma_5 '\n\n        conditions.append(is_nfi_sma_6)\n        dataframe.loc[is_nfi_sma_6, 'buy_tag'] += 'is_nfi_sma_6 '\n\n        conditions.append(is_nfi_sma_7)\n        dataframe.loc[is_nfi_sma_7, 'buy_tag'] += 'is_nfi_sma_7 '\n\n        conditions.append(is_nfi_sma_8)\n        dataframe.loc[is_nfi_sma_8, 'buy_tag'] += 'is_nfi_sma_8 '\n\n        conditions.append(is_nfi_sma_9)\n        dataframe.loc[is_nfi_sma_9, 'buy_tag'] += 'is_nfi_sma_9 '\n\n        conditions.append(is_nfi_sma_10)\n        dataframe.loc[is_nfi_sma_10, 'buy_tag'] += 'is_nfi_sma_10 '\n\n        conditions.append(is_nfi_sma_11)\n        dataframe.loc[is_nfi_sma_11, 'buy_tag'] += 'is_nfi_sma_11 '\n\n        conditions.append(is_nfi_sma_12)\n        dataframe.loc[is_nfi_sma_12, 'buy_tag'] += 'is_nfi_sma_12 '\n\n        conditions.append(is_nfi_sma_13)\n        dataframe.loc[is_nfi_sma_13, 'buy_tag'] += 'is_nfi_sma_13 '\n\n        conditions.append(is_nfi_sma_14)\n        dataframe.loc[is_nfi_sma_14, 'buy_tag'] += 'is_nfi_sma_14 '\n\n        conditions.append(is_nfi_sma_15)\n        dataframe.loc[is_nfi_sma_15, 'buy_tag'] += 'is_nfi_sma_15 '\n\n        conditions.append(is_nfi_sma_16)\n        dataframe.loc[is_nfi_sma_16, 'buy_tag'] += 'is_nfi_sma_16 '\n\n        conditions.append(is_nfi_sma_17)\n        dataframe.loc[is_nfi_sma_17, 'buy_tag'] += 'is_nfi_sma_17 '\n\n        conditions.append(is_nfi_sma_18)\n        dataframe.loc[is_nfi_sma_18, 'buy_tag'] += 'is_nfi_sma_18 '\n\n        conditions.append(is_nfi_sma_19)\n        dataframe.loc[is_nfi_sma_19, 'buy_tag'] += 'is_nfi_sma_19 '\n\n        conditions.append(is_nfi_sma_20)\n        dataframe.loc[is_nfi_sma_20, 'buy_tag'] += 'is_nfi_sma_20 '\n\n        conditions.append(is_nfi_sma_21)\n        dataframe.loc[is_nfi_sma_21, 'buy_tag'] += 'is_nfi_sma_21 '\n\n        conditions.append(is_nfi_sma_22)\n        dataframe.loc[is_nfi_sma_22, 'buy_tag'] += 'is_nfi_sma_22 '\n\n        conditions.append(is_nfi_sma_23)\n        dataframe.loc[is_nfi_sma_23, 'buy_tag'] += 'is_nfi_sma_23 '\n\n        conditions.append(is_nfi_sma_24)\n        dataframe.loc[is_nfi_sma_24, 'buy_tag'] += 'is_nfi_sma_24 '\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\nclass BB_RPB_TSL_Tranz_TrailingBuy(BB_RPB_TSL_SMA_Tranz_TB_1_1_1):\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\n    #\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\n    #\n\n    process_only_new_candles = False\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            log.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        default_offset = 0.005\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n\n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n\n                            self.trailing_buy_info(pair, current_price)\n                            log.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                log.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f'price too high for {pair} !')\n\n                    else:\n                        log.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    log.info(f'STOP trailing buy for {pair} because I buy it')\n\n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        log.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    log.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n                    #idk its the right place here nut yea\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']"
  },
  {
    "path": "strategies/BB_RPB_TSL_SMA_Tranz_TB_MOD/BB_RPB_TSL_SMA_Tranz_TB_MOD.py",
    "content": "# --- Do not remove these libs ---\nimport pandas_ta as pta\nimport copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat, DatetimeIndex, merge\nfrom functools import reduce\nimport math\nfrom random import shuffle\nfrom typing import Dict, List\nimport technical.indicators as ftt\nfrom technical.util import resample_to_interval\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta, timezone\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter, IStrategy, IntParameter)\nimport time\n\nlog = logging.getLogger(__name__)\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n    \"\"\"\n    Rolling Percentage Change Maximum across interval.\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param method: High to Low / Open to Close\n    :param length: int The length to look back\n    \"\"\"\n    if method == 'HL':\n        return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n    elif method == 'OC':\n        return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n    else:\n        raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from -100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\ndef HA(dataframe, smoothing=None):\n    df = dataframe.copy()\n\n    df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    df.reset_index(inplace=True)\n\n    ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n    [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n    df['HA_Open'] = ha_open\n\n    df.set_index('index', inplace=True)\n\n    df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n    df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n    if smoothing is not None:\n        sml = abs(int(smoothing))\n        if sml > 0:\n            df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n            df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n            df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n            df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n\n    return df\n\ndef pump_warning(dataframe, perc=15):\n    df = dataframe.copy()\n    df[\"change\"] = df[\"high\"] - df[\"low\"]\n    df[\"test1\"] = (df[\"close\"] > df[\"open\"])\n    df[\"test2\"] = ((df[\"change\"]/df[\"low\"]) > (perc/100))\n    df[\"result\"] = (df[\"test1\"] & df[\"test2\"]).astype('int')\n    return df['result']\n\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef pct_change(a, b):\n    return (b - a) / a\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\nclass BB_RPB_TSL_SMA_Tranz_TB_MOD(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"buy_btc_safe_1d\": -0.025,\n        ##\n        \"max_slip\": 0.983,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"base_nb_candles_buy_trima\": 15,\n        \"base_nb_candles_buy_trima2\": 38,\n        \"low_offset_trima\": 0.959,\n        \"low_offset_trima2\": 0.949,\n\n        \"base_nb_candles_buy_hma\": 70,\n        \"base_nb_candles_buy_hma2\": 12,\n        \"low_offset_hma\": 0.948,\n        \"low_offset_hma2\": 0.941,\n        #\n        \"base_nb_candles_buy_zema\": 25,\n        \"base_nb_candles_buy_zema2\": 53,\n        \"low_offset_zema\": 0.958,\n        \"low_offset_zema2\": 0.961,\n        #\n        \"base_nb_candles_buy_ema\": 9,\n        \"base_nb_candles_buy_ema2\": 75,\n        \"low_offset_ema\": 1.067,\n        \"low_offset_ema2\": 0.973,\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"ewo_high\": 2.615,\n        \"ewo_high2\": 2.188,\n        \"ewo_low\": -19.632,\n        \"ewo_low2\": -19.955,\n        \"rsi_buy\": 60,\n        \"rsi_buy2\": 45,\n        #\n        \"pump_protection_01_pct_change_timeframe\": 8,\n        \"pump_protection_01_pct_change_max\": 0.15,\n        \"pump_protection_01_pct_change_min\": -0.15,\n        #\n        \"pump_protection_01_pct_change_short_timeframe\": 8,\n        \"pump_protection_01_pct_change_short_max\": 0.1,\n        \"pump_protection_01_pct_change_short_min\": -0.1,\n        #\n        \"pump_protection_01_ispumping\": 0.2,\n        \"pump_protection_01_islongpumping\": 0.24,\n        \"pump_protection_01_isshortpumping\": 0.12,\n        #\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.04796,\n        \"buy_clucha_bbdelta_tail\": 0.93112,\n        \"buy_clucha_close_bblower\": 0.01645,\n        \"buy_clucha_closedelta_close\": 0.00931,\n        \"buy_clucha_rocr_1h\": 0.41663,\n        ##\n        \"buy_ema_high_2\": 1.04116,\n        \"buy_ema_low_2\": 0.97463,\n        \"buy_ewo_high_2\": 5.249,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n        ##\n        \"base_nb_candles_ema_sell\": 5,\n        \"high_offset_sell_ema\": 0.994,\n        #\n        \"base_nb_candles_buy\": 8,\n        \"ewo_high\": 4.13,\n        \"ewo_high_2\": 4.477,\n        \"ewo_low\": -19.076,\n        \"lookback_candles\": 27,\n        \"low_offset\": 0.988,\n        \"low_offset_2\": 0.974,\n        \"profit_threshold\": 1.049,\n        \"rsi_buy\": 72,\n        \"rsi_fast_buy\": 40,\n    }\n\n    protection_params = {\n        \"low_profit_lookback\": 48,\n        \"low_profit_min_req\": 0.04,\n        \"low_profit_stop_duration\": 14,\n        \"cooldown_lookback\": 2,  # value loaded from strategy\n    }\n    #############################################################\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n        #\n        \"base_nb_candles_sell\": 20,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n\n    minimal_roi = {\n        \"0\": 0.2,\n        \"30\": 0.1,\n        \"60\": 0.05,\n        \"90\": 0.03,\n        \"120\": 0.02,\n        \"150\": 0.01,\n        \"180\": 0.005,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n    inf_15m = '15m'\n    info_timefame_1d = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_15m = '15m'\n    res_timeframe = 'none'\n    informative_timeframe = '1h'\n    timeframe_15m = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.15\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    startup_candle_count: int = 400\n    ############################################################################\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Multi Offset\n    optimize_buy_ema = False\n    base_nb_candles_buy_ema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n    base_nb_candles_buy_ema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema2 = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(1, 36, default=buy_params['lookback_candles'], space='buy', optimize=True)\n    profit_threshold = DecimalParameter(0.99, 1.05, default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter( 2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    ewo_low2 = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low2'], space='buy', optimize=True)\n    ewo_high2 = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high2'], space='buy', optimize=True)\n    ewo_high_2 = DecimalParameter( -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_buy2 = IntParameter(30, 70, default=buy_params['rsi_buy2'], space='buy', optimize=True)\n    rsi_fast_buy = IntParameter(10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=True)\n\n    ## Buy params\n    max_change_pump = 35\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize = is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12 , 12, default= 0 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50 , optimize = is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_39 = True\n    buy_nfix_39_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_nfix_39)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    #BB MODDED\n    is_optimize_ctt15_protection = False\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, optimize = is_optimize_ctt15_protection)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, optimize = is_optimize_ctt15_protection)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, optimize = is_optimize_ctt15_protection)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, optimize = is_optimize_ctt15_protection)\n\n    is_optimize_ctt25_protection = False\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, optimize = is_optimize_ctt25_protection)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, optimize = is_optimize_ctt25_protection)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, optimize = is_optimize_ctt25_protection)\n\n    #NFI 7 SMA\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    optimize_buy_trima = False\n    base_nb_candles_buy_trima = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n    base_nb_candles_buy_trima2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n\n    optimize_buy_hma = False\n    base_nb_candles_buy_hma = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n    base_nb_candles_buy_hma2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n\n    optimize_buy_zema = False\n    base_nb_candles_buy_zema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n    base_nb_candles_buy_zema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 1.00, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5 , optimize = is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20 , optimize = is_optimize_cti_r)\n\n    optimize_sell_ema = False\n    base_nb_candles_ema_sell = IntParameter(5, 80, default=20, space='sell', optimize=False)\n    high_offset_sell_ema = DecimalParameter(0.99, 1.1, default=1.012, space='sell', optimize=False)\n\n    #Protections\n    cooldown_lookback = IntParameter(2, 48, default=2, space=\"protection\", optimize=False)\n\n    low_profit_optimize = False\n    low_profit_lookback = IntParameter(2, 60, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_stop_duration = IntParameter(12, 200, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_min_req = DecimalParameter(-0.05, 0.05, default=-0.05, space=\"protection\", decimals=2, optimize=low_profit_optimize)\n\n        # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    ############################################################################\n    @property\n    def protections(self):\n        prot = []\n\n        prot.append({\n            \"method\": \"CooldownPeriod\",\n            \"stop_duration_candles\": self.cooldown_lookback.value\n        })\n        prot.append({\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": self.low_profit_lookback.value,\n            \"trade_limit\": 1,\n            \"stop_duration\": int(self.low_profit_stop_duration.value),\n            \"required_profit\": self.low_profit_min_req.value\n        })\n\n        return prot\n\n    def pump_warning2(self, dataframe):\n        df = dataframe.copy()\n        df['pct_change'] = df['close'].pct_change(periods=self.pump_protection_01_pct_change_timeframe.value)\n        df['pct_change_int'] = ((df['pct_change'] > self.pump_protection_01_pct_change_max.value).astype(int) | (df['pct_change'] < self.pump_protection_01_pct_change_min.value).astype(int))\n        df['pct_change_short'] = df['close'].pct_change(periods=self.pump_protection_01_pct_change_short_timeframe.value)\n        df['pct_change_int_short'] = ((df['pct_change_short'] > self.pump_protection_01_pct_change_short_max.value).astype(int) | (df['pct_change_short'] < self.pump_protection_01_pct_change_short_min.value).astype(int))\n        df['ispumping'] = ((df['pct_change_int'].rolling(20).sum() >= self.pump_protection_01_ispumping.value)).astype('int')\n        df['islongpumping'] = ((df['pct_change_int'].rolling(30).sum() >= self.pump_protection_01_islongpumping.value)).astype('int')\n        df['isshortpumping'] = ((df['pct_change_int_short'].rolling(10).sum() >= self.pump_protection_01_isshortpumping.value)).astype('int')\n        df['recentispumping'] = (df['ispumping'].rolling(300).max() > 0) | (df['islongpumping'].rolling(300).max() > 0) | (df['isshortpumping'].rolling(300).max() > 0)\n\n        return df['recentispumping']\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    #############################################################\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n            Rolling Percentage Change Maximum across interval.\n\n            :param dataframe: DataFrame The original OHLC dataframe\n            :param method: High to Low / Open to Close\n            :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    ############################################################################\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        informative_pairs.extend([(pair, self.timeframe_15m) for pair in pairs])\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs += [(\"BTC/USDT\", \"5m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n\n        return informative_1h\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_25'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=26)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n\n                # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = EWO(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n                 return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n                # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO2'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi_2'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_fast2'] = ta.RSI(dataframe, timeperiod=5)\n        dataframe['rsi_slow2'] = ta.RSI(dataframe, timeperiod=25)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # BB 20 - STD3\n        bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std3['lower']\n        dataframe['bb20_3_mid'] = bb_20_std3['mid']\n        dataframe['bb20_3_upp'] = bb_20_std3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # SMA\n        dataframe['bb9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_84'] = williams_r(dataframe, period=84)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_112'] = williams_r(dataframe, period=112)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n                # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n        # pump detector\n        dataframe['pump'] = pump_warning(dataframe, perc=int(self.max_change_pump))\n        #25% di pump\n        #dataframe['recentispumping'] = self.pump_warning2(dataframe)\n        #HA\n        dataframe = HA(dataframe, 4)\n\n        #MULTIMA\n        dataframe['ema_offset_buy'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema.value)) *self.low_offset_ema.value\n        dataframe['ema_offset_buy2'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema2.value)) *self.low_offset_ema2.value\n        dataframe['ema_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_ema_sell.value))\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n\n\n        # EMA 200\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        ### BTC protection\n        dataframe['btc_5m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='5m')['close']\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\n        dataframe = merge_informative_pair(dataframe, btc_1d, '5m', '1d', ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_sqzOff = (\n                (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n                (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen, credit goes to @iterativ\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_nfix_3 = (\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['r_96'] < -80.0) &\n                (dataframe['cti_1h'] < -0.75) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                    (dataframe['bb_lowerband2_40'].shift() > 0) &\n                    (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                    (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                    (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                    (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                    (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                )\n            )\n\n        is_cofi = (                                                                         # Modified from cofi, credit goes to original author \"slack user CofiBit\"\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_r14.value)\n            )\n\n        is_gumbo = (                                                                        # Modified from gumbo1, creadit goes to original author @raph92\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value)\n            )\n\n        is_sqzmom = (                                                                       # Modified from squeezeMomentum, credit goes to original author @LazyBear of TradingView\n                (is_sqzOff) &\n                (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n                (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n                (dataframe['linreg_val_20'] < 0) &\n                (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n                (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n                (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n            )\n\n        # NFI quick mode, credit goes to @iterativ\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_12 = (\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['EWO'] > 0.1) &\n                (dataframe['rsi_14'] < 40.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_480_1h'] < -20.0)\n            )\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_33 = (\n                (dataframe['moderi_96']) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.988)) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi'] < 32.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfi7_37 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n            ## BB MODDED\n        is_nfi_ctt35 = (\n                (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.984) &\n                (dataframe['EWO'] > 9.6) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.5)\n            )\n\n        is_nfi_ctt25 = (\n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < self.buy_25_rsi_4.value) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (\n                    (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                    (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                ) &\n                (dataframe['cti'] < self.buy_25_cti.value)\n            )\n\n        is_nfi_ctt15 = (\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi_14'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            )\n\n        is_nfix_39 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07)) &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb_lowerband2_40'].shift().gt(0)) &\n                (dataframe['bb_delta_cluc'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb_delta_cluc'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb_lowerband2_40'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_13'] * 0.912)\n            )\n\n        is_nfi_9 = (\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.968) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * 0.982) &\n                (dataframe['mfi'] < 50.0) &\n                (dataframe['cti'] < -0.85) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['rsi_14_1h'] > 20.0) &\n                (dataframe['rsi_14_1h'] < 88.0) &\n                (dataframe['crsi_1h'] > 21.0)\n            )\n\n        is_nfi_26 = (\n                (dataframe['close'] < (dataframe['zema_61'] * 0.9405)) &\n                (dataframe['cti'] < -0.72) &\n                (dataframe['cci'] < -166.0) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['cti_1h'] < 0.95) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfix_54 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_50'] * 0.925)\n            )\n\n        is_nfix_53 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36)) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99)) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['cti_1h'] > -0.7)\n\n            )\n        is_nfix_52 = (\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998)) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfix_51 = (\n                (dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944)) &\n                (dataframe['ewo_15m'] < -1.0) &\n                (dataframe['rsi_14_15m'] > 28.0) &\n                (dataframe['cti_15m'] < -0.84) &\n                (dataframe['r_14_15m'] < -94.0) &\n                (dataframe['rsi_14'] > 30.0) &\n                (dataframe['crsi_1h'] > 1.0)\n            )\n\n        is_nfix_48 = (\n                (dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95)) &\n                (dataframe['close_15m'] > (dataframe['open_15m'].shift(3))) &\n                (dataframe['ewo_15m'] > 2.8) &\n                (dataframe['cti_15m'] < -0.75) &\n                (dataframe['r_14_15m'].shift(3) < -94.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 18.0)\n            )\n\n        is_nfix_47 = (\n                (dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3)) &\n                (dataframe['ema_20_1h'] > dataframe['ema_25_1h']) &\n                (dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95)) &\n                (\n                    ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                    ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h']))\n                ) &\n                (dataframe['cti_15m'] < -0.9) &\n                (dataframe['r_14_15m'] < -90.0) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 8.0)\n            )\n\n        is_nfix_41 = (\n                (dataframe['ema_12_15m'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n            )\n\n        is_nfix_38 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['mfi'] < 34.5) &\n                (dataframe['r_64'] < -65.0) &\n                (dataframe['r_96'] < -50.0) &\n                (dataframe['r_480_1h'] < -1.0)\n            )\n\n        is_nfix_36 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_nfix_204 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_203 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -6.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfix_202 = (\n                (dataframe['close'] > (dataframe['ema_200_1h'] * 0.84)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999)) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['rsi_14'] > 25.0) &\n                (dataframe['mfi'] > 18.0) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['r_14'].shift(1) < -94.0) &\n                (dataframe['crsi_1h'] > 12.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 1.6))\n            )\n\n        is_nfix_201 = (\n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < 30.0) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.953) &\n                (dataframe['cti'] < -0.78) &\n                (dataframe['cci'] < -200.0)\n            )\n\n        is_nfix_34 = (\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.972)) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi_14'] < 18.0)\n            )\n\n        is_nfix_28 = (\n                (dataframe['close'] < dataframe['sma_75'] * 0.96) &\n                (dataframe['EWO'] < -8.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 14.0)\n            )\n\n        is_nfix_27 = (\n                (dataframe['close'] < dataframe['sma_75'] * 0.934) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['r_14'] < -96.0)\n            )\n\n        is_nfix_19 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['cti_1h'] > -0.75) &\n                (dataframe['cti_1h'] < 0.25)\n            )\n\n        is_nfix_11 = (\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['rsi_14'] < 25.0)\n            )\n\n        is_nfix_9 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 20.0)\n            )\n\n        is_nfix_36 = (\n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n\n        is_nfi_sma_2 = (\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_3 = (\n\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_4 = (\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n\n        is_nfi_sma_5 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_6 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value)) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_7 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n                (dataframe['volume'] > 0)\n            )\n\n\n        is_nfi_sma_9 = (\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_10 = (\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n        )\n\n        is_nfi_sma_12 = (\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['EWO'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_14 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_15 = (\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n                (dataframe['volume'] > 0)\n                   )\n\n        is_nfi_sma_16 = (\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['EWO'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_17 = (\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['EWO'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_22 = (\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume']) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value)) &\n                (dataframe['EWO'] > self.buy_ewo_22.value) &\n                (dataframe['rsi'] < self.buy_rsi_22.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_nfi_sma_23 = (\n\n                (dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value)) &\n                (dataframe['EWO'] > self.buy_ewo_23.value) &\n                (dataframe['rsi'] < self.buy_rsi_23.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_23.value) &\n                (dataframe['volume'] > 0)\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        is_btc_safe = (\n                (pct_change(dataframe['btc_1d'], dataframe['btc_5m']).fillna(0) > self.buy_btc_safe_1d.value) &\n                (dataframe['volume'] > 0)           # Make sure Volume is not 0\n        )\n\n        is_nasos_1 = (\n\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            )\n\n        is_nasos_2 = (\n\n                (dataframe['rsi_fast2'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO2'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo2)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo2, 'buy_tag'] += 'is_ewo_2 '\n\n        conditions.append(is_nfix_3)                                                 # ~2.86 / 91.5% / 33.31%     D\n        dataframe.loc[is_nfix_3, 'buy_tag'] += 'is_nfix_3 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_12)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_12, 'buy_tag'] += 'nfix_2 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_33)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfi7_33, 'buy_tag'] += 'nfi7_33 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n\n        conditions.append(is_nfi_ctt35)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_nfi_ctt35, 'buy_tag'] += 'nfi_ctt35 '\n\n        conditions.append(is_nfi_ctt25)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_nfi_ctt25, 'buy_tag'] += 'nfi_ctt25 '\n\n        conditions.append(is_nfi_ctt15)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_nfi_ctt15, 'buy_tag'] += 'nfi_ctt15 '\n\n        conditions.append(is_nfix_54)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_nfix_54, 'buy_tag'] += 'nfix_54 '\n\n        conditions.append(is_nfix_53)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_nfix_53, 'buy_tag'] += 'nfix_53 '\n\n        conditions.append(is_nfix_52)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_nfix_52, 'buy_tag'] += 'nfix_52 '\n\n        conditions.append(is_nfix_51)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_nfix_51, 'buy_tag'] += 'nfix_51 '\n\n        conditions.append(is_nfix_48)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_nfix_48, 'buy_tag'] += 'nfix_48 '\n\n        conditions.append(is_nfix_47)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfix_47, 'buy_tag'] += 'nfix_47 '\n\n        conditions.append(is_nfix_41)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfix_41, 'buy_tag'] += 'nfix_41 '\n\n        conditions.append(is_nfix_38)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfix_38, 'buy_tag'] += 'nfix_38 '\n\n        conditions.append(is_nfix_36)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfix_204)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_204, 'buy_tag'] += 'nfix_204 '\n\n        conditions.append(is_nfix_203)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_203, 'buy_tag'] += 'nfix_203 '\n\n        conditions.append(is_nfix_202)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_202, 'buy_tag'] += 'nfix_202 '\n\n        conditions.append(is_nfix_201)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_201, 'buy_tag'] += 'nfix_201 '\n\n        conditions.append(is_nfix_34)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_34, 'buy_tag'] += 'nfix_34 '\n\n        conditions.append(is_nfix_28)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_28, 'buy_tag'] += 'nfix_28 '\n\n        conditions.append(is_nfix_27)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_27, 'buy_tag'] += 'nfix_27 '\n\n        conditions.append(is_nfix_19)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_19, 'buy_tag'] += 'nfix_19 '\n\n        conditions.append(is_nfix_11)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_11, 'buy_tag'] += 'nfix_11 '\n\n        conditions.append(is_nfix_9)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_9, 'buy_tag'] += 'nfix_9 '\n\n        conditions.append(is_nfix_36)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfix_39)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_39, 'buy_tag'] += 'nfix_39 '\n\n        conditions.append(is_nfi_sma_2)\n        dataframe.loc[is_nfi_sma_2, 'buy_tag'] += 'is_nfi_sma_2 '\n\n        conditions.append(is_nfi_sma_3)\n        dataframe.loc[is_nfi_sma_3, 'buy_tag'] += 'is_nfi_sma_3 '\n\n        conditions.append(is_nfi_sma_4)\n        dataframe.loc[is_nfi_sma_4, 'buy_tag'] += 'is_nfi_sma_4 '\n\n        conditions.append(is_nfi_sma_5)\n        dataframe.loc[is_nfi_sma_5, 'buy_tag'] += 'is_nfi_sma_5 '\n\n        conditions.append(is_nfi_sma_6)\n        dataframe.loc[is_nfi_sma_6, 'buy_tag'] += 'is_nfi_sma_6 '\n\n        conditions.append(is_nfi_sma_7)\n        dataframe.loc[is_nfi_sma_7, 'buy_tag'] += 'is_nfi_sma_7 '\n\n        conditions.append(is_nfi_sma_9)\n        dataframe.loc[is_nfi_sma_9, 'buy_tag'] += 'is_nfi_sma_9 '\n\n        conditions.append(is_nfi_sma_10)\n        dataframe.loc[is_nfi_sma_10, 'buy_tag'] += 'is_nfi_sma_10 '\n\n        conditions.append(is_nfi_sma_12)\n        dataframe.loc[is_nfi_sma_12, 'buy_tag'] += 'is_nfi_sma_12 '\n\n        conditions.append(is_nfi_sma_14)\n        dataframe.loc[is_nfi_sma_14, 'buy_tag'] += 'is_nfi_sma_14 '\n\n        conditions.append(is_nfi_sma_15)\n        dataframe.loc[is_nfi_sma_15, 'buy_tag'] += 'is_nfi_sma_15 '\n\n        conditions.append(is_nfi_sma_16)\n        dataframe.loc[is_nfi_sma_16, 'buy_tag'] += 'is_nfi_sma_16 '\n\n        conditions.append(is_nfi_sma_17)\n        dataframe.loc[is_nfi_sma_17, 'buy_tag'] += 'is_nfi_sma_17 '\n\n        conditions.append(is_nfi_sma_22)\n        dataframe.loc[is_nfi_sma_22, 'buy_tag'] += 'is_nfi_sma_22 '\n\n        conditions.append(is_nfi_sma_23)\n        dataframe.loc[is_nfi_sma_23, 'buy_tag'] += 'is_nfi_sma_23 '\n        \n        conditions.append(is_nasos_1)                                                #     -\n        dataframe.loc[is_nasos_1, 'buy_tag'] += 'is_nasos_1 '\n\n        dataframe.loc[is_nasos_2, 'buy_tag'] += 'is_nasos_2 '                                #     ---\n        conditions.append(is_nasos_2)\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\nclass BB_RPB_TSL_Tranz_TrailingBuy(BB_RPB_TSL_SMA_Tranz_TB):\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\n    #\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\n    #\n\n    process_only_new_candles = False\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            log.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        default_offset = 0.005\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n\n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n\n                            self.trailing_buy_info(pair, current_price)\n                            log.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                log.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                log.info(f'price too high for {pair} !')\n\n                    else:\n                        log.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    log.info(f'STOP trailing buy for {pair} because I buy it')\n\n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        log.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    log.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n                    #idk its the right place here nut yea\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BB_RPB_TSL_Tranz/BB_RPB_TSL_Tranz.py",
    "content": "# --- Do not remove these libs ---\nimport pandas_ta as pta\nimport copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\nimport time\n\nlog = logging.getLogger(__name__)\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL_Tranz(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.983,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        \"buy_ewo_high_2\": 4.179,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_closedelta_local_dip\": 12.044,\n        \"buy_ema_diff_local_dip\": 0.024,\n        \"buy_ema_high_local_dip\": 1.014,\n        \"buy_rsi_local_dip\": 21,\n        ##\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.049,\n        \"buy_clucha_bbdelta_tail\": 1.146,\n        \"buy_clucha_close_bblower\": 0.018,\n        \"buy_clucha_closedelta_close\": 0.017,\n        \"buy_clucha_rocr_1h\": 0.526,\n        ##\n        \"buy_adx\": 13,\n        \"buy_cofi_r14\": -85.016,\n        \"buy_cofi_cti\": -0.892,\n        \"buy_ema_cofi\": 1.147,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_39_ema\": 0.912,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n    }\n\n    minimal_roi = {\n        \"0\": 0.205,\n        \"81\": 0.038,\n        \"292\": 0.005,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n    inf_15m = '15m'\n    info_timefame_1d = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_15m = '15m'\n    res_timeframe = 'none'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n    is_optimize_local_dip = False\n    buy_ema_diff_local_dip = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_ema_high_local_dip = DecimalParameter(0.90, 1.2, default=0.942 , optimize = is_optimize_local_dip)\n    buy_closedelta_local_dip = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n    buy_rsi_local_dip = IntParameter(15, 45, default=28, optimize = is_optimize_local_dip)\n    buy_crsi_local_dip = IntParameter(10, 18, default=10, optimize = False)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize = is_optimize_clucha)\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.94, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(0, 40, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(0, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_cofi_protection = False\n    buy_cofi_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_cofi_protection)\n    buy_cofi_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_cofi_protection)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12 , 12, default= 0 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50 , optimize = is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_39 = True\n    buy_nfix_39_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_nfix_39)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n    \n    #BB MODDED\n    is_optimize_ctt15_protection = False\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, optimize = is_optimize_ctt15_protection)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, optimize = is_optimize_ctt15_protection)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, optimize = is_optimize_ctt15_protection)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, optimize = is_optimize_ctt15_protection)\n    \n    is_optimize_ctt25_protection = False\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, optimize = is_optimize_ctt25_protection)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, optimize = is_optimize_ctt25_protection)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, optimize = is_optimize_ctt25_protection)\n\n\n    ## Slippage params\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 1.00, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5 , optimize = is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20 , optimize = is_optimize_cti_r)\n    \n    ############################################################################\n\n    def informative_pairs(self):\n        \n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs.extend = [(pair, '15m') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        \n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24) \n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        # Pump protections\n        #informative_1h['hl_pct_change_48'] = range_percent_change(informative_1h, 'HL', length=48)\n        #informative_1h['hl_pct_change_36'] = range_percent_change(informative_1h, 'HL', length=36)\n        #informative_1h['hl_pct_change_24'] = range_percent_change(informative_1h, 'HL', length=24)\n        #informative_1h['hl_pct_change_12'] = range_percent_change(informative_1h, 'HL', length=12)\n        #informative_1h['hl_pct_change_6'] = range_percent_change(informative_1h, 'HL', length=6)\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_25'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=26)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n        \n                # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = ewo(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n        \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        # sell trail\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi'] < 46.0):\n                return f\"sell_profit_t_0_1( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 32.0):\n                return f\"sell_profit_t_0_2( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi'] < 48.0):\n                return f\"sell_profit_t_0_3( {buy_tag})\"\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 39.0):\n                return f\"sell_profit_t_1_1( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return f\"sell_profit_t_1_2( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return f\"sell_profit_t_1_4( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return f\"sell_profit_t_1_5( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return f\"sell_profit_t_1_7( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_1h'] < 50.0):\n                return f\"sell_profit_t_1_9( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return f\"sell_profit_t_1_10( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 42.0):\n                return f\"sell_profit_t_1_11( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return f\"sell_profit_t_1_12( {buy_tag})\"\n\n        # sell cti_r\n        if 0.012 > current_profit >= 0.0 :\n            if (last_candle['cti'] > self.sell_cti_r_cti.value) and (last_candle['r_14'] > self.sell_cti_r_r.value):\n                return f\"sell_profit_t_cti_r_0_1( {buy_tag})\"\n\n        # main sell\n        if current_profit > 0.02:\n            if (last_candle['momdiv_sell_1h'] == True):\n                return f\"signal_profit_q_momdiv_1h( {buy_tag})\"\n            if (last_candle['momdiv_sell'] == True):\n                return f\"signal_profit_q_momdiv( {buy_tag})\"\n            if (last_candle['momdiv_coh'] == True):\n                return f\"signal_profit_q_momdiv_coh( {buy_tag})\"\n\n        # sell bear\n        if last_candle['close'] < last_candle['ema_200']:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi'] < 34.0) and (last_candle['cmf'] < 0.0):\n                    return f\"sell_profit_u_bear_1_1( {buy_tag})\"\n                elif (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.4):\n                    return f\"sell_profit_u_bear_1_2( {buy_tag})\"\n\n        # sell quick\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi'] > 80.0):\n            return f\"signal_profit_q_1( {buy_tag})\"\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return f\"signal_profit_q_2( {buy_tag})\"\n\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return f\"signal_profit_q_pmax_bull( {buy_tag})\"\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return f\"signal_profit_q_pmax_bear( {buy_tag})\"\n\n        # sell scalp\n        if (current_profit > 0 and buy_tag in [ 'nfix_39 ']):\n            if (\n                    (current_profit > 0)\n                    and (last_candle['fisher'] > 0.39075)\n                    and (last_candle['ha_high'] <= previous_candle_1['ha_high'])\n                    and (previous_candle_1['ha_high'] <= previous_candle_2['ha_high'])\n                    and (last_candle['ha_close'] <= previous_candle_1['ha_close'])\n                    and (last_candle['ema_4'] > last_candle['ha_close'])\n                    and (last_candle['ha_close'] * 0.99754 > last_candle['bb_middleband2'])\n                ):\n                return f\"sell_scalp( {buy_tag})\"\n\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * 0.988)\n                and (last_candle['cmf'] < -0.046)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.022)\n                and last_candle['rsi'] > previous_candle_1['rsi']\n                and (last_candle['rsi'] > (last_candle['rsi_1h'] + 10.0))\n            ):\n            return f\"sell_stoploss_u_e_1( {buy_tag})\"\n\n        # stoploss - deadfish\n        if (    (current_profit < self.sell_deadfish_profit.value)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['bb_width'] < self.sell_deadfish_bb_width.value)\n                and (last_candle['close'] > last_candle['bb_middleband2'] * self.sell_deadfish_bb_factor.value)\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_deadfish_volume_factor.value)\n            ):\n            return f\"sell_stoploss_deadfish( {buy_tag})\"\n\n        # stoploss - bleeding\n        #if (    (current_profit < -0.05)\n                #and (last_candle['close'] < last_candle['ema_200'])\n                #and (last_candle['cti_mean_24'] < self.sell_bleeding_cti.value)\n                #and (last_candle['r_14_mean_24'] < self.sell_bleeding_r14.value)\n                #and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_bleeding_volume_factor.value)\n            #):\n            #return f\"sell_stoploss_bleeding( {buy_tag})\"\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    \n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n        \n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n        \n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # BB 20 - STD3\n        bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std3['lower']\n        dataframe['bb20_3_mid'] = bb_20_std3['mid']\n        dataframe['bb20_3_upp'] = bb_20_std3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['bb9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        \n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        \n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n        \n        return dataframe\n        \n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n        \n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )        \n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_sqzOff = (\n                (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n                (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (  \n                is_additional_check &        # from NFI next gen, credit goes to @iterativ\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_local_dip = (\n                is_additional_check &        \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff_local_dip.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ema_high_local_dip.value) &\n                (dataframe['rsi'] < self.buy_rsi_local_dip.value) &\n                (dataframe['crsi'] > self.buy_crsi_local_dip.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta_local_dip.value / 1000 )\n            )\n\n        is_ewo = (        \n                is_additional_check &        # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                is_additional_check &        \n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish = (  \n                is_additional_check &        # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                )\n            )\n\n        is_cofi = (    \n                is_additional_check &        # Modified from cofi, credit goes to original author \"slack user CofiBit\"\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['cti'] < self.buy_cofi_cti.value) &\n                (dataframe['r_14'] < self.buy_cofi_r14.value)\n            )\n\n        is_gumbo = (    \n                is_additional_check &        # Modified from gumbo1, creadit goes to original author @raph92\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value)\n            )\n\n        is_sqzmom = (     \n                is_additional_check &        # Modified from squeezeMomentum, credit goes to original author @LazyBear of TradingView\n                (is_sqzOff) &\n                (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n                (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n                (dataframe['linreg_val_20'] < 0) &\n                (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n                (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n                (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n            )\n\n        # NFI quick mode, credit goes to @iterativ\n        is_nfi_13 = (\n                is_additional_check &        \n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (\n                is_additional_check &        \n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                is_additional_check &        \n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_nfi_38 = (\n                is_additional_check &\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n\n        is_nfix_5 = (\n                is_additional_check &\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n        is_nfix_39 = (\n                is_additional_check &        \n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb_lowerband2_40'].shift().gt(0)) &\n                (dataframe['bb_delta_cluc'].gt(dataframe['close'] * 0.056)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.01)) &\n                (dataframe['tail'].lt(dataframe['bb_delta_cluc'] * 0.5)) &\n                (dataframe['close'].lt(dataframe['bb_lowerband2_40'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['close'] > dataframe['ema_13'] * self.buy_nfix_39_ema.value)\n            )\n\n        is_nfix_49 = (\n                is_additional_check &        \n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_33 = (\n                is_additional_check &        \n                (dataframe['moderi_96']) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.988)) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi'] < 32.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfi7_37 = (\n                is_additional_check &        \n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n            ## BB MODDED\n        is_nfi_ctt35 = (\n                is_additional_check &        \n                (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.984) &\n                (dataframe['EWO'] > 9.6) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.5)\n            )\n    \n        is_nfi_ctt25 = (\n                is_additional_check &        \n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < self.buy_25_rsi_4.value) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value)) &\n                (\n                    (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                    (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                ) &\n                (dataframe['cti'] < self.buy_25_cti.value)\n            )\n                \n        is_nfi_ctt15 = (\n                is_additional_check &        \n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi_14'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            )\n            \n        is_nfi_9 = (\n                is_additional_check &        \n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.968) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * 0.982) &\n                (dataframe['mfi'] < 50.0) &\n                (dataframe['cti'] < -0.85) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['rsi_14_1h'] > 20.0) &\n                (dataframe['rsi_14_1h'] < 88.0) &\n                (dataframe['crsi_1h'] > 21.0)    \n            )\n            \n        is_nfi_10 = (\n                is_additional_check &        \n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.94) &\n                (dataframe['close'] < dataframe['bb20_2_low'] * 0.984) &\n                (dataframe['r_14'] < -88.0) &\n                (dataframe['cti_1h'] > -0.5) &\n                (dataframe['cti_1h'] < 0.94)\n            )\n            \n        is_nfi_26 = (\n                is_additional_check &        \n                (dataframe['close'] < (dataframe['zema_61'] * 0.9405)) &\n                (dataframe['cti'] < -0.72) &\n                (dataframe['cci'] < -166.0) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['cti_1h'] < 0.95) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n            \n        is_nfix_53 = (\n                is_additional_check &        \n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36)) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99)) &\n                (dataframe['r_14'] < -90.0) &\n                (dataframe['cti_1h'] > -0.7)\n                    \n            )\n        is_nfix_52 = (\n                is_additional_check &        \n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998)) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n                \n        is_nfix_51 = (\n                is_additional_check &        \n                (dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944)) &\n                (dataframe['ewo_15m'] < -1.0) &\n                (dataframe['rsi_14_15m'] > 28.0) &\n                (dataframe['cti_15m'] < -0.84) &\n                (dataframe['r_14_15m'] < -94.0) &\n                (dataframe['rsi_14'] > 30.0) &\n                (dataframe['crsi_1h'] > 1.0)\n            )\n                \n        is_nfix_48 = (\n                is_additional_check &        \n                (dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95)) &\n                (dataframe['close_15m'] > (dataframe['open_15m'].shift(3))) &\n                (dataframe['ewo_15m'] > 2.8) &\n                (dataframe['cti_15m'] < -0.75) &\n                (dataframe['r_14_15m'].shift(3) < -94.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 18.0)\n            )\n                \n        is_nfix_47 = (\n                is_additional_check &        \n                (dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3)) &\n                (dataframe['ema_20_1h'] > dataframe['ema_25_1h']) &\n                (dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95)) &\n                (\n                    ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                    ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h']))\n                ) &\n                (dataframe['cti_15m'] < -0.9) &\n                (dataframe['r_14_15m'] < -90.0) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['cti_1h'] < 0.1) &\n                (dataframe['crsi_1h'] > 8.0)\n            )\n                \n        is_nfix_41 = (\n                is_additional_check &        \n                (dataframe['ema_12_15m'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_26_15m'] > dataframe['ema_12_15m']) &\n                ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03)) &\n                ((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100)) &\n                (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n            )\n\n        is_nfix_38 = (\n                is_additional_check &        \n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['mfi'] < 34.5) &\n                (dataframe['r_64'] < -65.0) &\n                (dataframe['r_96'] < -50.0) &\n                (dataframe['r_480_1h'] < -1.0)\n            )\n                \n        is_nfix_36 = (\n                is_additional_check &        \n                (dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.956) &\n                (dataframe['rsi_14'] < 34.0) &\n                (dataframe['r_64'] < -80.0) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['r_480_1h'] < -30.0)\n            )\n                \n        is_nfix_204 = (\n                is_additional_check &        \n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] < -4.4) &\n                (dataframe['cti'] < -0.95) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 0.5)\n            )\n                \n        is_nfix_203 = (\n                is_additional_check &        \n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -6.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n                \n        is_nfix_202 = (\n                is_additional_check &        \n                (dataframe['close'] > (dataframe['ema_200_1h'] * 0.84)) &\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999)) &\n                (dataframe['cti'] < -0.5) &\n                (dataframe['rsi_14'] > 25.0) &\n                (dataframe['mfi'] > 18.0) &\n                (dataframe['r_14'] < -94.0) &\n                (dataframe['r_14'].shift(1) < -94.0) &\n                (dataframe['crsi_1h'] > 12.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 1.6))\n            )\n                \n        is_nfix_201 = (\n                is_additional_check &        \n                (dataframe['rsi_20'] < dataframe['rsi_20'].shift()) &\n                (dataframe['rsi_4'] < 30.0) &\n                (dataframe['ema_20_1h'] > dataframe['ema_26_1h']) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.953) &\n                (dataframe['cti'] < -0.78) &\n                (dataframe['cci'] < -200.0)\n            )\n                \n        is_nfix_34 = (\n                is_additional_check &        \n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < (dataframe['bb20_2_low'] * 0.972)) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi_14'] < 18.0)\n            )\n                \n        is_nfix_28 = (\n                is_additional_check &        \n                (dataframe['close'] < dataframe['sma_75'] * 0.96) &\n                (dataframe['EWO'] < -8.0) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0) &\n                (dataframe['crsi_1h'] > 14.0)\n            )\n                \n        is_nfix_27 = (\n                is_additional_check &        \n                (dataframe['close'] < dataframe['sma_75'] * 0.934) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi_14'] < 32.0) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['r_14'] < -96.0)\n            )\n                \n        is_nfix_19 = (\n                is_additional_check &        \n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['bb40_2_low'].shift().gt(0)) &\n                (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.02)) &\n                (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28)) &\n                (dataframe['close'].lt(dataframe['bb40_2_low'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['cti_1h'] > -0.75) &\n                (dataframe['cti_1h'] < 0.25) \n            )\n                \n        is_nfix_11 = (\n                is_additional_check &        \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < dataframe['ema_20'] * 0.932) &\n                (dataframe['rsi_14'] < 25.0)\n            )\n            \n        is_nfix_9 = (\n                is_additional_check &        \n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.0) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 20.0)\n            )\n            \n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_local_dip)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_local_dip, 'buy_tag'] += 'local_dip '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                 # ~2.86 / 91.5% / 33.31%     D\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n        conditions.append(is_clucHA)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        conditions.append(is_cofi)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n\n        conditions.append(is_nfi_38)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfi_38, 'buy_tag'] += 'nfi_38 '\n\n        conditions.append(is_nfix_5)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_5, 'buy_tag'] += 'nfix_5 '\n\n        conditions.append(is_nfix_39)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_39, 'buy_tag'] += 'nfix_39 '\n\n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_33)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfi7_33, 'buy_tag'] += 'nfi7_33 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n        \n        conditions.append(is_nfi_ctt35)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_nfi_ctt35, 'buy_tag'] += 'nfi_ctt35 '\n\n        conditions.append(is_nfi_ctt25)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_nfi_ctt25, 'buy_tag'] += 'nfi_ctt25 '\n\n        conditions.append(is_nfi_ctt15)                                            # ~0.76 / 91.1% / 15.54%\n        dataframe.loc[is_nfi_ctt15, 'buy_tag'] += 'nfi_ctt15 '\n\n        conditions.append(is_nfi_10)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_nfi_10, 'buy_tag'] += 'nfi_10 '\n\n        conditions.append(is_nfix_53)                                               # ~7.2 / 92.5% / 97.98%       D\n        dataframe.loc[is_nfix_53, 'buy_tag'] += 'nfix_53 '\n\n        conditions.append(is_nfix_52)                                                 # ~0.4 / 94.4% / 9.59%        D\n        dataframe.loc[is_nfix_52, 'buy_tag'] += 'nfix_52 '\n\n        conditions.append(is_nfix_51)                                                # ~2.63 / 90.6% / 41.49%      D\n        dataframe.loc[is_nfix_51, 'buy_tag'] += 'nfix_51 '\n\n        conditions.append(is_nfix_48)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_nfix_48, 'buy_tag'] += 'nfix_48 '\n\n        conditions.append(is_nfix_47)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfix_47, 'buy_tag'] += 'nfix_47 '\n\n        conditions.append(is_nfix_41)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfix_41, 'buy_tag'] += 'nfix_41 '\n\n        conditions.append(is_nfix_38)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfix_38, 'buy_tag'] += 'nfix_38 '\n\n        conditions.append(is_nfix_36)                                               # ~1.13 / 88.5% / 31.34%      D\n        dataframe.loc[is_nfix_36, 'buy_tag'] += 'nfix_36 '\n\n        conditions.append(is_nfix_204)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_204, 'buy_tag'] += 'nfix_204 '\n\n        conditions.append(is_nfix_203)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_203, 'buy_tag'] += 'nfix_203 '\n\n        conditions.append(is_nfix_202)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_202, 'buy_tag'] += 'nfix_202 '\n\n        conditions.append(is_nfix_201)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_201, 'buy_tag'] += 'nfix_201 '\n\n        conditions.append(is_nfix_34)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_34, 'buy_tag'] += 'nfix_34 '\n        \n        conditions.append(is_nfix_28)                                               # ~0.25 / 97.7% / 6.53%       D\n        dataframe.loc[is_nfix_28, 'buy_tag'] += 'nfix_28 '\n\n        conditions.append(is_nfix_27)                                              # ~5.33 / 91.8% / 58.57%      D\n        dataframe.loc[is_nfix_27, 'buy_tag'] += 'nfix_27 '\n\n        conditions.append(is_nfix_19)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_19, 'buy_tag'] += 'nfix_19 '\n\n        conditions.append(is_nfix_11)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfix_11, 'buy_tag'] += 'nfix_11 '\n\n        conditions.append(is_nfix_9)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfix_9, 'buy_tag'] += 'nfix_9 '\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[ (dataframe['volume'] > 0), 'sell' ] = 0\n\n        return dataframe\n        \nclass BB_RPB_TSL_Tranz_TrailingBuy(BB_RPB_TSL_Tranz):\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\n    #\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\n    #\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        default_offset = 0.005\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n        \n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n                            \n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n                            \n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n        \n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']"
  },
  {
    "path": "strategies/BB_RPB_TSL_c7c477d_20211030/BB_RPB_TSL_c7c477d_20211030.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, ichimoku\n\n# --------------------------------\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSL_c7c477d_20211030(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_btc_safe\": -289,\n        \"buy_btc_safe_1d\": -0.05,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 12.148,\n        \"buy_ema_diff\": 0.022,\n        ##\n        \"buy_adx\": 20,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 2.055,\n        \"buy_fastd\": 21,\n        \"buy_fastk\": 30,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.01,\n        \"pPF_2\": 0.048,\n        \"pSL_1\": 0.009,\n        \"pSL_2\": 0.043,\n        ##\n        \"sell_btc_safe\": -389,\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n    }\n\n    # really hard to use this\n    minimal_roi = {\n        \"0\": 0.10,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_dip = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_dip)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_dip)\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = False)\n    buy_rsi = IntParameter(15, 30, default=35, optimize = False)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_ema_low_2 = DecimalParameter(0.96, 0.978, default=0.96 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(1.05, 1.2, default=1.09 , optimize = is_optimize_ewo_2)\n\n    is_optimize_cofi = True\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = False)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    ## Trailing params\n\n    is_optimize_trailing = True\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs += [(\"BTC/USDT\", \"5m\")]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h['chikou_span_greater'] = (informative_1h['chikou_span'] > informative_1h['senkou_a']).shift(30).fillna(False)\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        return informative_1h\n\n    ############################################################################\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### BTC protection\n\n        # BTC info\n        inf_tf = '5m'\n        informative = self.dp.get_pair_dataframe('BTC/USDT', timeframe=inf_tf)\n        informative_past = informative.copy().shift(1)                                                                                                   # Get recent BTC info\n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d\n\n        ### Other checks\n\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband3']).astype('int')\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n        #dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        # SRSI hyperopt ?\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EMA\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_break = (\n\n                (   (dataframe['bb_delta'] > self.buy_bb_delta.value)                                   #\"buy_bb_delta\": 0.025 0.036\n                    &                                                                                   #\"buy_bb_width\": 0.095 0.133\n                    (dataframe['bb_width'] > self.buy_bb_width.value)\n                )\n                &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_ichi_ok = (\n\n                (dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h']) &\n                (dataframe['close'] > dataframe['cloud_top_1h']) &\n                (dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h']) &\n                (dataframe['chikou_span_greater_1h'])\n        )\n\n        is_local_uptrend = (                                                                            # from NFI next gen\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        # NFI quick mode\n\n        is_nfi_32 = (\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 19) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.942) &\n                (dataframe['cti'] < -0.86)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n        is_btc_safe = (\n\n                (dataframe['btc_diff'] > self.buy_btc_safe.value)\n               &(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * self.buy_btc_safe_1d.value)\n               &(dataframe['volume'] > 0)           # Make sure Volume is not 0\n            )\n\n        is_BB_checked = is_dip & is_break\n        is_cofi_checked = is_cofi & is_ichi_ok\n\n        #print(dataframe['btc_5m'])\n        #print(dataframe['btc_1d'])\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'])\n        #print(dataframe['btc_1d'] * -0.025)\n        #print(dataframe['btc_5m'] - dataframe['btc_1d'] > dataframe['btc_1d'] * -0.025)\n\n        # condition append\n        conditions.append(is_BB_checked)                                           # ~1.61 / 87.9% / 29.36%\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.5 / 89.9% / 56.4%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local uptrend '\n\n        conditions.append(is_ewo)                                                  # ~2.19 / 92.6% / 28.12%\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_ewo_2)                                                # ~3.65 / 82.5% / 21.56%\n        dataframe.loc[is_ewo_2, 'buy_tag'] += 'ewo2 '\n\n        conditions.append(is_cofi_checked)                                         # ~2.57 / 82.2% / 52.42%\n        dataframe.loc[is_cofi_checked, 'buy_tag'] += 'cofi '\n\n        conditions.append(is_nfi_32)                                               # ~2.3 / 88.2% / 42.35%\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi 32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi 33 '\n\n        if conditions:\n            dataframe.loc[ is_btc_safe & reduce(lambda x, y: x | y, conditions), 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (\n                    (dataframe['btc_diff'] < self.sell_btc_safe.value)\n                    |\n                    (\n                        (dataframe['close'] < dataframe['ema_200'] * self.sell_ema.value) &\n                        (dataframe['cmf'] < self.sell_cmf.value) &\n                        (((dataframe['ema_200'] - dataframe['close']) / dataframe['close']) < self.sell_ema_close_delta.value) &\n                        (dataframe['rsi'] > dataframe['rsi'].shift(1))\n                    )\n                )\n                &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BB_RPB_TSLmeneguzzo/BB_RPB_TSLmeneguzzo.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom functools import reduce\nfrom technical.indicators import RMI, zema, ichimoku\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass BB_RPB_TSLmeneguzzo(IStrategy):\n    '''\n        BB_RPB_TSL\n        @author jilv220\n        Simple bollinger brand strategy inspired by this blog  ( https://hacks-for-life.blogspot.com/2020/12/freqtrade-notes.html )\n        RPB, which stands for Real Pull Back, taken from ( https://github.com/GeorgeMurAlkh/freqtrade-stuff/blob/main/user_data/strategies/TheRealPullbackV2.py )\n        The trailing custom stoploss taken from BigZ04_TSL from Perkmeister ( modded by ilya )\n        I modified it to better suit my taste and added Hyperopt for this strategy.\n    '''\n\n    # (1) sell rework\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        \"max_slip\": 0.983,\n        ##\n        \"buy_bb_width_1h\": 0.954,\n        \"buy_roc_1h\": 86,\n        ##\n        \"buy_threshold\": 0.003,\n        \"buy_bb_factor\": 0.999,\n        #\n        \"buy_bb_delta\": 0.025,\n        \"buy_bb_width\": 0.095,\n        ##\n        \"buy_cci\": -116,\n        \"buy_cci_length\": 25,\n        \"buy_rmi\": 49,\n        \"buy_rmi_length\": 17,\n        \"buy_srsi_fk\": 32,\n        ##\n        \"buy_closedelta\": 17.922,\n        \"buy_ema_diff\": 0.026,\n        ##\n        \"buy_ema_high\": 0.968,\n        \"buy_ema_low\": 0.935,\n        \"buy_ewo\": -5.001,\n        \"buy_rsi\": 23,\n        \"buy_rsi_fast\": 44,\n        ##\n        \"buy_ema_high_2\": 1.087,\n        \"buy_ema_low_2\": 0.970,\n        \"buy_ewo_high_2\": 4.179,\n        \"buy_rsi_ewo_2\": 35,\n        \"buy_rsi_fast_ewo_2\": 45,\n        ##\n        \"buy_r_deadfish_bb_factor\": 1.014,\n        \"buy_r_deadfish_bb_width\": 0.299,\n        \"buy_r_deadfish_ema\": 1.054,\n        \"buy_r_deadfish_volume_factor\": 1.59,\n        \"buy_r_deadfish_cti\": -0.115,\n        \"buy_r_deadfish_r14\": -44.34,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.049,\n        \"buy_clucha_bbdelta_tail\": 1.146,\n        \"buy_clucha_close_bblower\": 0.018,\n        \"buy_clucha_closedelta_close\": 0.017,\n        \"buy_clucha_rocr_1h\": 0.526,\n        ##\n        \"buy_adx\": 13,\n        \"buy_ewo_high\": 8.594,\n        \"buy_fastd\": 28,\n        \"buy_fastk\": 39,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        ##\n        \"buy_sqzmom_ema\": 0.981,\n        \"buy_sqzmom_ewo\": -3.966,\n        \"buy_sqzmom_r14\": -45.068,\n        ##\n        \"buy_nfix_49_cti\": -0.105,\n        \"buy_nfix_49_r14\": -81.827,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"sell_cmf\": -0.046,\n        \"sell_ema\": 0.988,\n        \"sell_ema_close_delta\": 0.022,\n        ##\n        \"sell_deadfish_profit\": -0.063,\n        \"sell_deadfish_bb_factor\": 0.954,\n        \"sell_deadfish_bb_width\": 0.043,\n        \"sell_deadfish_volume_factor\": 2.37,\n        ##\n        \"sell_cti_r_cti\": 0.844,\n        \"sell_cti_r_r\": -19.99,\n    }\n\n    minimal_roi = {\n        \"0\": 0.205,\n        \"81\": 0.038,\n        \"292\": 0.005,\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Disabled\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_dip = False\n    buy_rmi = IntParameter(30, 50, default=35, optimize= is_optimize_dip)\n    buy_cci = IntParameter(-135, -90, default=-133, optimize= is_optimize_dip)\n    buy_srsi_fk = IntParameter(30, 50, default=25, optimize= is_optimize_dip)\n    buy_cci_length = IntParameter(25, 45, default=25, optimize = is_optimize_dip)\n    buy_rmi_length = IntParameter(8, 20, default=8, optimize = is_optimize_dip)\n\n    is_optimize_break = False\n    buy_bb_width = DecimalParameter(0.065, 0.135, default=0.095, optimize = is_optimize_break)\n    buy_bb_delta = DecimalParameter(0.018, 0.035, default=0.025, optimize = is_optimize_break)\n\n    is_optimize_local_uptrend = False\n    buy_ema_diff = DecimalParameter(0.022, 0.027, default=0.025, optimize = is_optimize_local_uptrend)\n    buy_bb_factor = DecimalParameter(0.990, 0.999, default=0.995, optimize = False)\n    buy_closedelta = DecimalParameter(12.0, 18.0, default=15.0, optimize = is_optimize_local_uptrend)\n\n\n\n    is_optimize_ewo = False\n    buy_rsi_fast = IntParameter(35, 50, default=45, optimize = is_optimize_ewo)\n    buy_rsi = IntParameter(15, 35, default=35, optimize = is_optimize_ewo)\n    buy_ewo = DecimalParameter(-6.0, 5, default=-5.585, optimize = is_optimize_ewo)\n    buy_ema_low = DecimalParameter(0.9, 0.99, default=0.942 , optimize = is_optimize_ewo)\n    buy_ema_high = DecimalParameter(0.95, 1.2, default=1.084 , optimize = is_optimize_ewo)\n\n    is_optimize_ewo_2 = False\n    buy_rsi_fast_ewo_2 = IntParameter(15, 50, default=45, optimize = is_optimize_ewo_2)\n    buy_rsi_ewo_2 = IntParameter(15, 50, default=35, optimize = is_optimize_ewo_2)\n    buy_ema_low_2 = DecimalParameter(0.90, 1.2, default=0.970 , optimize = is_optimize_ewo_2)\n    buy_ema_high_2 = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_ewo_2)\n    buy_ewo_high_2 = DecimalParameter(2, 12, default=4.179, optimize = is_optimize_ewo_2)\n\n    is_optimize_r_deadfish = False\n    buy_r_deadfish_ema = DecimalParameter(0.90, 1.2, default=1.087 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_bb_factor = DecimalParameter(0.90, 1.2, default=1.0 , optimize = is_optimize_r_deadfish)\n    buy_r_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_r_deadfish)\n\n    is_optimize_r_deadfish_protection = False\n    buy_r_deadfish_cti = DecimalParameter(-0.6, -0.0, default=-0.5 , optimize = is_optimize_r_deadfish_protection)\n    buy_r_deadfish_r14 = DecimalParameter(-60, -44, default=-60 , optimize = is_optimize_r_deadfish_protection)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=0.02206, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=1.02515, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=0.04401, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=0.47782, optimize = is_optimize_clucha)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo_protection)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo_protection)\n\n    is_optimize_sqzmom_protection = False\n    buy_sqzmom_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_ewo = DecimalParameter(-12 , 12, default= 0 , optimize = is_optimize_sqzmom_protection)\n    buy_sqzmom_r14 = DecimalParameter(-100, -22, default=-50 , optimize = is_optimize_sqzmom_protection)\n\n    is_optimize_nfix_49_protection = False\n    buy_nfix_49_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_nfix_49_protection)\n    buy_nfix_49_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_nfix_49_protection)\n\n    is_optimize_btc_safe = False\n    buy_btc_safe = IntParameter(-300, 50, default=-200, optimize = is_optimize_btc_safe)\n    buy_btc_safe_1d = DecimalParameter(-0.075, -0.025, default=-0.05, optimize = is_optimize_btc_safe)\n    buy_threshold = DecimalParameter(0.003, 0.012, default=0.008, optimize = is_optimize_btc_safe)\n\n    is_optimize_check = False\n    buy_roc_1h = IntParameter(-25, 200, default=10, optimize = is_optimize_check)\n    buy_bb_width_1h = DecimalParameter(0.3, 2.0, default=0.3, optimize = is_optimize_check)\n\n    ## Slippage params\n\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 1.00, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\n\n    ## Sell params\n\n    sell_btc_safe = IntParameter(-400, -300, default=-365, optimize = False)\n\n    is_optimize_sell_stoploss = False\n    sell_cmf = DecimalParameter(-0.4, 0.0, default=0.0, optimize = is_optimize_sell_stoploss)\n    sell_ema_close_delta = DecimalParameter(0.022, 0.027, default= 0.024, optimize = is_optimize_sell_stoploss)\n    sell_ema = DecimalParameter(0.97, 0.99, default=0.987 , optimize = is_optimize_sell_stoploss)\n\n    is_optimize_deadfish = False\n    sell_deadfish_bb_width = DecimalParameter(0.03, 0.75, default=0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_profit = DecimalParameter(-0.15, -0.05, default=-0.05 , optimize = is_optimize_deadfish)\n    sell_deadfish_bb_factor = DecimalParameter(0.90, 1.20, default=1.0 , optimize = is_optimize_deadfish)\n    sell_deadfish_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_deadfish)\n\n    is_optimize_bleeding = False\n    sell_bleeding_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_bleeding)\n    sell_bleeding_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_bleeding)\n    sell_bleeding_volume_factor = DecimalParameter(1, 2.5, default=1.0 , optimize = is_optimize_bleeding)\n\n    is_optimize_cti_r = False\n    sell_cti_r_cti = DecimalParameter(0.55, 1, default=0.5 , optimize = is_optimize_cti_r)\n    sell_cti_r_r = DecimalParameter(-15, 0, default=-20 , optimize = is_optimize_cti_r)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_8'] = ta.EMA(informative_1h, timeperiod=8)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n        informative_1h['cti_40'] = pta.cti(informative_1h[\"close\"], length=40)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_96'] = williams_r(informative_1h, period=96)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband2'] = bollinger2['lower']\n        informative_1h['bb_middleband2'] = bollinger2['mid']\n        informative_1h['bb_upperband2'] = bollinger2['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb_upperband2'] - informative_1h['bb_lowerband2']) / informative_1h['bb_middleband2'])\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(dataframe, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # Elliot\n        informative_1h['EWO'] = EWO(informative_1h, 50, 200)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        # Pump protections\n        #informative_1h['hl_pct_change_48'] = range_percent_change(informative_1h, 'HL', length=48)\n        #informative_1h['hl_pct_change_36'] = range_percent_change(informative_1h, 'HL', length=36)\n        #informative_1h['hl_pct_change_24'] = range_percent_change(informative_1h, 'HL', length=24)\n        #informative_1h['hl_pct_change_12'] = range_percent_change(informative_1h, 'HL', length=12)\n        #informative_1h['hl_pct_change_6'] = range_percent_change(informative_1h, 'HL', length=6)\n\n        return informative_1h\n\n    ############################################################################\n\n    ### Custom functions\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n    # From NFIX\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        # sell trail\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi'] < 46.0):\n                return f\"sell_profit_t_0_1( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 32.0):\n                return f\"sell_profit_t_0_2( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi'] < 48.0):\n                return f\"sell_profit_t_0_3( {buy_tag})\"\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 39.0):\n                return f\"sell_profit_t_1_1( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return f\"sell_profit_t_1_2( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return f\"sell_profit_t_1_4( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return f\"sell_profit_t_1_5( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return f\"sell_profit_t_1_7( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_1h'] < 50.0):\n                return f\"sell_profit_t_1_9( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return f\"sell_profit_t_1_10( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi'] < 42.0):\n                return f\"sell_profit_t_1_11( {buy_tag})\"\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return f\"sell_profit_t_1_12( {buy_tag})\"\n\n        # sell cti_r\n        if 0.012 > current_profit >= 0.0 :\n            if (last_candle['cti'] > self.sell_cti_r_cti.value) and (last_candle['r_14'] > self.sell_cti_r_r.value):\n                return f\"sell_profit_t_cti_r_0_1( {buy_tag})\"\n\n        # main sell\n        if current_profit > 0.02:\n            if (last_candle['momdiv_sell_1h'] == True):\n                return f\"signal_profit_q_momdiv_1h( {buy_tag})\"\n            if (last_candle['momdiv_sell'] == True):\n                return f\"signal_profit_q_momdiv( {buy_tag})\"\n            if (last_candle['momdiv_coh'] == True):\n                return f\"signal_profit_q_momdiv_coh( {buy_tag})\"\n\n        # sell bear\n        if last_candle['close'] < last_candle['ema_200']:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi'] < 34.0) and (last_candle['cmf'] < 0.0):\n                    return f\"sell_profit_u_bear_1_1( {buy_tag})\"\n                elif (last_candle['rsi'] < 44.0) and (last_candle['cmf'] < -0.4):\n                    return f\"sell_profit_u_bear_1_2( {buy_tag})\"\n\n        # sell quick\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi'] > 80.0):\n            return f\"signal_profit_q_1( {buy_tag})\"\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return f\"signal_profit_q_2( {buy_tag})\"\n\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return f\"signal_profit_q_pmax_bull( {buy_tag})\"\n        if (0.06 > current_profit > 0.02) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return f\"signal_profit_q_pmax_bear( {buy_tag})\"\n\n        # sell scalp\n\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * 0.988)\n                and (last_candle['cmf'] < -0.046)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.022)\n                and last_candle['rsi'] > previous_candle_1['rsi']\n                and (last_candle['rsi'] > (last_candle['rsi_1h'] + 10.0))\n            ):\n            return f\"sell_stoploss_u_e_1( {buy_tag})\"\n\n        # stoploss - deadfish\n        if (    (current_profit < self.sell_deadfish_profit.value)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['bb_width'] < self.sell_deadfish_bb_width.value)\n                and (last_candle['close'] > last_candle['bb_middleband2'] * self.sell_deadfish_bb_factor.value)\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_deadfish_volume_factor.value)\n            ):\n            return f\"sell_stoploss_deadfish( {buy_tag})\"\n\n        # stoploss - bleeding\n        #if (    (current_profit < -0.05)\n                #and (last_candle['close'] < last_candle['ema_200'])\n                #and (last_candle['cti_mean_24'] < self.sell_bleeding_cti.value)\n                #and (last_candle['r_14_mean_24'] < self.sell_bleeding_r14.value)\n                #and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * self.sell_bleeding_volume_factor.value)\n            #):\n            #return f\"sell_stoploss_bleeding( {buy_tag})\"\n\n        return None\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    ############################################################################\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        ### Other BB checks\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n        dataframe['bb_delta'] = ((dataframe['bb_lowerband2'] - dataframe['bb_lowerband3']) / dataframe['bb_lowerband2'])\n\n        # CCI hyperopt\n        for val in self.buy_cci_length.range:\n            dataframe[f'cci_length_{val}'] = ta.CCI(dataframe, val)\n\n        dataframe['cci'] = ta.CCI(dataframe, 26)\n        dataframe['cci_long'] = ta.CCI(dataframe, 170)\n\n        # RMI hyperopt\n        for val in self.buy_rmi_length.range:\n            dataframe[f'rmi_length_{val}'] = RMI(dataframe, length=val, mom=4)\n\n        # SRSI hyperopt\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA\n        dataframe['ema_4'] = ta.EMA(dataframe, timeperiod=4)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # KC 20\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # fisher\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        return dataframe\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_dip = (\n                (dataframe[f'rmi_length_{self.buy_rmi_length.value}'] < self.buy_rmi.value) &\n                (dataframe[f'cci_length_{self.buy_cci_length.value}'] <= self.buy_cci.value) &\n                (dataframe['srsi_fk'] < self.buy_srsi_fk.value)\n            )\n\n        is_sqzOff = (\n                (dataframe['bb_lowerband2'] < dataframe['kc_lowerband_28_1']) &\n                (dataframe['bb_upperband2'] > dataframe['kc_upperband_28_1'])\n            )\n\n        is_break = (\n\n                (dataframe['bb_delta'] > self.buy_bb_delta.value) &\n                (dataframe['bb_width'] > self.buy_bb_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 ) &    # from BinH\n                (dataframe['close'] < dataframe['bb_lowerband3'] * self.buy_bb_factor.value)\n            )\n\n        is_local_uptrend = (                                                                            # from NFI next gen, credit goes to @iterativ\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                (dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * self.buy_ema_diff.value) &\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100) &\n                (dataframe['close'] < dataframe['bb_lowerband2'] * self.buy_bb_factor.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_closedelta.value / 1000 )\n            )\n\n        is_ewo = (                                                                                      # from SMA offset\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low.value) &\n                (dataframe['EWO'] > self.buy_ewo.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high.value) &\n                (dataframe['rsi'] < self.buy_rsi.value)\n            )\n\n        is_ewo_2 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast_ewo_2.value) &\n                (dataframe['close'] < dataframe['ema_8'] * self.buy_ema_low_2.value) &\n                (dataframe['EWO'] > self.buy_ewo_high_2.value) &\n                (dataframe['close'] < dataframe['ema_16'] * self.buy_ema_high_2.value) &\n                (dataframe['rsi'] < self.buy_rsi_ewo_2.value)\n            )\n\n        is_r_deadfish = (                                                                               # reverse deadfish\n                (dataframe['ema_100'] < dataframe['ema_200'] * self.buy_r_deadfish_ema.value) &\n                (dataframe['bb_width'] > self.buy_r_deadfish_bb_width.value) &\n                (dataframe['close'] < dataframe['bb_middleband2'] * self.buy_r_deadfish_bb_factor.value) &\n                (dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * self.buy_r_deadfish_volume_factor.value) &\n                (dataframe['cti'] < self.buy_r_deadfish_cti.value) &\n                (dataframe['r_14'] < self.buy_r_deadfish_r14.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                )\n            )\n\n        is_gumbo = (                                                                        # Modified from gumbo1, creadit goes to original author @raph92\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value)\n            )\n\n        is_sqzmom = (                                                                       # Modified from squeezeMomentum, credit goes to original author @LazyBear of TradingView\n                (is_sqzOff) &\n                (dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1)) &\n                (dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20']) &\n                (dataframe['linreg_val_20'] < 0) &\n                (dataframe['close'] < dataframe['ema_13'] * self.buy_sqzmom_ema.value) &\n                (dataframe['EWO'] < self.buy_sqzmom_ewo.value) &\n                (dataframe['r_14'] < self.buy_sqzmom_r14.value)\n            )\n\n        # NFI quick mode, credit goes to @iterativ\n        is_nfi_13 = (\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['close'] < dataframe['sma_30'] * 0.99) &\n                (dataframe['cti'] < -0.92) &\n                (dataframe['EWO'] < -5.585) &\n                (dataframe['cti_1h'] < -0.88) &\n                (dataframe['crsi_1h'] > 10.0)\n            )\n\n        is_nfi_32 = (  # NFIX 26\n                (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) &\n                (dataframe['rsi_fast'] < 46) &\n                (dataframe['rsi'] > 25.0) &\n                (dataframe['close'] < dataframe['sma_15'] * 0.93) &\n                (dataframe['cti'] < -0.9)\n            )\n\n        is_nfi_33 = (\n                (dataframe['close'] < (dataframe['ema_13'] * 0.978)) &\n                (dataframe['EWO'] > 8) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['rsi'] < 32) &\n                (dataframe['r_14'] < -98.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.5))\n            )\n\n\n        is_nfix_5 = (\n                (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12)) &\n                (dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24)) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.932) &\n                (dataframe['EWO'] > 3.6) &\n                (dataframe['cti'] < -0.9) &\n                (dataframe['r_14'] < -97.0)\n            )\n\n\n        is_nfix_49 = (\n                (dataframe['ema_26'].shift(3) > dataframe['ema_12'].shift(3)) &\n                (dataframe['ema_26'].shift(3) - dataframe['ema_12'].shift(3) > dataframe['open'].shift(3) * 0.032) &\n                (dataframe['ema_26'].shift(9) - dataframe['ema_12'].shift(9) > dataframe['open'].shift(3) / 100) &\n                (dataframe['close'].shift(3) < dataframe['ema_20'].shift(3) * 0.916) &\n                (dataframe['rsi'].shift(3) < 32.5) &\n                (dataframe['crsi'].shift(3) > 18.0) &\n                (dataframe['cti'] < self.buy_nfix_49_cti.value) &\n                (dataframe['r_14'] < self.buy_nfix_49_r14.value)\n            )\n\n        is_nfi7_33 = (\n                (dataframe['moderi_96']) &\n                (dataframe['cti'] < -0.88) &\n                (dataframe['close'] < (dataframe['ema_13'] * 0.988)) &\n                (dataframe['EWO'] > 6.4) &\n                (dataframe['rsi'] < 32.0) &\n                (dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n            )\n\n        is_nfi7_37 = (\n                (dataframe['pm'] > dataframe['pmax_thresh']) &\n                (dataframe['close'] < dataframe['sma_75'] * 0.98) &\n                (dataframe['EWO'] > 9.8) &\n                (dataframe['rsi'] < 56.0) &\n                (dataframe['cti'] < -0.7) &\n                (dataframe['safe_dump_50_1h'])\n            )\n\n        is_additional_check = (\n                (dataframe['roc_1h'] < self.buy_roc_1h.value) &\n                (dataframe['bb_width_1h'] < self.buy_bb_width_1h.value)\n            )\n\n        ## Additional Check\n        is_BB_checked = is_dip & is_break\n\n        ## Condition Append\n        conditions.append(is_BB_checked)                                           # ~2.32 / 91.1% / 46.27%      D\n        dataframe.loc[is_BB_checked, 'buy_tag'] += 'bb '\n\n        conditions.append(is_local_uptrend)                                        # ~3.28 / 92.4% / 69.72%\n        dataframe.loc[is_local_uptrend, 'buy_tag'] += 'local_uptrend '\n\n        conditions.append(is_ewo)                                                  # ~0.92 / 92.0% / 43.74%      D\n        dataframe.loc[is_ewo, 'buy_tag'] += 'ewo '\n\n        conditions.append(is_r_deadfish)                                           # ~0.99 / 86.9% / 21.93%      D\n        dataframe.loc[is_r_deadfish, 'buy_tag'] += 'r_deadfish '\n\n       # conditions.append(is_clucHA)                                               # ~7.2 / 92.5% / 97.98%       D\n       # dataframe.loc[is_clucHA, 'buy_tag'] += 'clucHA '\n\n        #conditions.append(is_gumbo)                                                # ~2.63 / 90.6% / 41.49%      D\n        #dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_sqzmom)                                               # ~3.14 / 92.4% / 64.14%      D\n        dataframe.loc[is_sqzmom, 'buy_tag'] += 'sqzmom '\n\n        conditions.append(is_nfi_13)                                               # ~0.4 / 100%                 D\n        dataframe.loc[is_nfi_13, 'buy_tag'] += 'nfi_13 '\n\n        conditions.append(is_nfi_32)                                               # ~0.78 / 92.0 % / 37.41%     D\n        dataframe.loc[is_nfi_32, 'buy_tag'] += 'nfi_32 '\n\n        conditions.append(is_nfi_33)                                               # ~0.11 / 100%                D\n        dataframe.loc[is_nfi_33, 'buy_tag'] += 'nfi_33 '\n        \n        conditions.append(is_nfix_49)                                              # ~0.33 / 100% / 0%           D\n        dataframe.loc[is_nfix_49, 'buy_tag'] += 'nfix_49 '\n\n        conditions.append(is_nfi7_33)                                              # ~0.71 / 91.3% / 28.94%      D\n        dataframe.loc[is_nfi7_33, 'buy_tag'] += 'nfi7_33 '\n\n        conditions.append(is_nfi7_37)                                              # ~0.46 / 92.6% / 17.05%      D\n        dataframe.loc[is_nfi7_37, 'buy_tag'] += 'nfi7_37 '\n\n        if conditions:\n            dataframe.loc[\n                            \n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[ (dataframe['volume'] > 0), 'sell' ] = 0\n\n        return dataframe\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']"
  },
  {
    "path": "strategies/BB_RSI/BB_RSI.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass BB_RSI(IStrategy):\n    \"\"\"\n    Strategy Bollinger Bands + RSI\n    author@: Leandro Handal\n    github@: https://github.com/lhandal\n\n    How to use it?\n    $ freqtrade trade --strategy BB_RSI\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n\n        \"0\": 0.4,\n        \"335\": 0.18834,\n        \"564\": 0.07349,\n        \"1097\": 0\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.06491\n    # Optimal ticker interval for the strategy\n    ticker_interval = '1h'\n\n    # trailing stoploss\n    trailing_only_offset_is_reached = False\n    trailing_stop = True\n    trailing_stop_positive = 0.01036\n    trailing_stop_positive_offset = 0.02409\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n\n                (dataframe['close'] < dataframe['bb_lowerband'])\n                &\n                (dataframe['rsi'] > 7)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n\n                (dataframe['close'] > dataframe['bb_upperband'])\n                &\n                (dataframe['rsi'] > 74)\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BB_Strategy04/BB_Strategy04.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BB_Strategy04(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.22597784040439192,\n        \"180\": 0.06269048445164815,\n        \"613\": 0.037662786960331776,\n        \"2004\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.32530922906811843\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    ticker_interval = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    # startup_candle_count: int = 10\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'bb_lowerband2': {'color': 'red'},\n            'bb_lowerband1': {'color': 'green'},\n            'bb_middleband1': {'color': 'orange'},\n            'bb_upperband1': {'color': 'green'},\n            # 'ma': {'color': 'blue'}\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        for std in [1, 2]:\n            # Bollinger bands\n            bollinger = qtpylib.bollinger_bands(dataframe['close'], window=24*3, stds=std)\n            dataframe[f'bb_lowerband{std}'] = bollinger['lower']\n            dataframe[f'bb_middleband{std}'] = bollinger['mid']\n            dataframe[f'bb_upperband{std}'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['close'], dataframe['bb_lowerband1']))\n                (dataframe['close'] < dataframe['bb_lowerband2']) &\n                (dataframe['close'] > dataframe['bb_lowerband2']*(1 + self.stoploss))\n\n                # (dataframe['volume'] > self.config['stake_amount'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['close'], dataframe['bb_upperband1']))\n                (dataframe['close'] > dataframe['bb_upperband2'])\n                # (dataframe['close'] < dataframe['bb_lowerband1.5'])\n                # (dataframe['volume'] > self.config['stake_amount'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BBands/BBands.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport pandas_ta as pta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BBands(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1m'\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.05\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Strategy parameters\n    buy_rsi = IntParameter(10, 40, default=30, space=\"buy\")\n    sell_rsi = IntParameter(60, 90, default=70, space=\"sell\")\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    @property\n    def plot_config(self):\n        return {\n            # Main plot indicators (Moving averages, ...)\n            'main_plot': {\n                'tema': {},\n                'sar': {'color': 'white'},\n            },\n            'subplots': {\n                # Subplots - each dict defines one additional plot\n                \"MACD\": {\n                    'macd': {'color': 'blue'},\n                    'macdsignal': {'color': 'orange'},\n                },\n                \"RSI\": {\n                    'rsi': {'color': 'red'},\n                }\n            }\n        }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # ((dataframe['close'] < dataframe['bb_lowerband']) | (dataframe['open'] < dataframe['bb_lowerband'])) &\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is rising\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # ((dataframe['close'] > dataframe['bb_upperband']) | (dataframe['open'] > dataframe['bb_upperband'])) &\n                (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n            \n        return dataframe\n    "
  },
  {
    "path": "strategies/BBandsRSI/BBandsRSI.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport pandas_ta as pta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BBandsRSI(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.15\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Strategy parameters\n    buy_rsi = IntParameter(10, 40, default=30, space=\"buy\")\n    sell_rsi = IntParameter(60, 90, default=70, space=\"sell\")\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    @property\n    def plot_config(self):\n        return {\n            # Main plot indicators (Moving averages, ...)\n            'main_plot': {\n                'bb_upperband': {'color': 'grey'},\n                'bb_middleband': {'color': 'red'},\n                'bb_lowerband': {'color': 'grey'}\n            },\n            'subplots': {\n                # Subplots - each dict defines one additional plot\n                \"RSI\": {\n                    'rsi': {'color': 'blue'},\n                    'overbought': {'color': 'red'},\n                    'oversold': {'color': 'green'}\n                }\n            }\n        }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['overbought'] = 70\n        dataframe['oversold'] = 30\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 70) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/BBlower/BBlower.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BBlower(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.32477,\n        \"220\": 0.13561,\n        \"962\": 0.10732,\n        \"2115\": 0\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.13912\n    \n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.29846\n    trailing_stop_positive_offset = 0.30425\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 25)\n        dataframe['RSI'] = ta.RSI(dataframe, timeperiod = 25)\n        dataframe['TEMA'] = ta.TEMA(dataframe, timeperiod = 50)\n      \n        # Bollinger bands\n        bollingerTA1 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=1.0, nbdevdn=1.0, matype=0)\n        \n        dataframe['bb_lowerbandTA1'] = bollingerTA1['lowerband']\n        dataframe['bb_middlebandTA1'] = bollingerTA1['middleband']\n        dataframe['bb_upperbandTA1'] = bollingerTA1['upperband']\n        \n        bollingerTA2 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=2.0, nbdevdn=2.0, matype=0)\n        \n        dataframe['bb_lowerbandTA2'] = bollingerTA2['lowerband']\n        dataframe['bb_middlebandTA2'] = bollingerTA2['middleband']\n        dataframe['bb_upperbandTA2'] = bollingerTA2['upperband']\n        \n        bollingerTA3 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=3.0, nbdevdn=3.0, matype=0)\n        \n        dataframe['bb_lowerbandTA3'] = bollingerTA3['lowerband']\n        dataframe['bb_middlebandTA3'] = bollingerTA3['middleband']\n        dataframe['bb_upperbandTA3'] = bollingerTA3['upperband']\n        \n        bollingerTA4 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=4.0, nbdevdn=4.0, matype=0)\n        \n        dataframe['bb_lowerbandTA4'] = bollingerTA4['lowerband']\n        dataframe['bb_middlebandTA4'] = bollingerTA4['middleband']\n        dataframe['bb_upperbandTA4'] = bollingerTA4['upperband']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        dataframe.loc[\n            (\n                # (dataframe['TEMA'] < dataframe['bb_upperbandTA1'])\n                # &\n                (dataframe['RSI'] > dataframe['RSI'].shift(1))\n                &\n                (dataframe['RSI'].shift(1) > dataframe['RSI'].shift(2))\n                &\n                (dataframe['RSI'].shift(2) > dataframe['RSI'].shift(3))\n                &\n                (dataframe['RSI'].shift(3) > dataframe['RSI'].shift(4))\n                &\n                (dataframe['RSI'] < 50)\n                &\n                (qtpylib.crossed_above(\n                        dataframe['TEMA'], dataframe['bb_lowerbandTA1']\n                    ))\n                  \n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                       \n        dataframe.loc[\n            (\n                \n            #     (dataframe['CMO'] > 23) \n            # & \n            #   (dataframe['RSI'] > 98) \n            #       &\n                # (dataframe['TEMA'] > dataframe['bb_upperbandTA2'])\n           \n                \n                \n            ),\n            'sell'] = 1        \n        \n        return dataframe"
  },
  {
    "path": "strategies/Babico_SMA5xBBmid/Babico_SMA5xBBmid.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n# --------------------------------\n\nclass Babico_SMA5xBBmid(IStrategy):\n\n    minimal_roi = {\n        \"0\": 99999999\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_sell_signal = True\n    sell_profit_only = True\n    process_only_new_candles = True\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '1d'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bb = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_low'] = bb['lower']\n        dataframe['bb_mid'] = bb['mid']\n        dataframe['bb_upp'] = bb['upper']\n\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema5'], dataframe['bb_mid']) \n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['bb_mid'], dataframe['ema5']) \n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Bandtastic/Bandtastic.py",
    "content": "import talib.abstract as ta\nimport numpy as np  # noqa\nimport pandas as pd\nfrom functools import reduce\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter, RealParameter\n\n__author__ = \"Robert Roman\"\n__copyright__ = \"Free For Use\"\n__license__ = \"MIT\"\n__version__ = \"1.0\"\n__maintainer__ = \"Robert Roman\"\n__email__ = \"robertroman7@gmail.com\"\n__BTC_donation__ = \"3FgFaG15yntZYSUzfEpxr5mDt1RArvcQrK\"\n\n\n# Optimized With Sharpe Ratio and 1 year data\n# 199/40000:  30918 trades. 18982/3408/8528 Wins/Draws/Losses. Avg profit   0.39%. Median profit   0.65%. Total profit  119934.26007495 USDT ( 119.93%). Avg duration 8:12:00 min. Objective: -127.60220\n\nclass Bandtastic(IStrategy):\n    INTERFACE_VERSION = 2\n\n    timeframe = '15m'\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.162,\n        \"69\": 0.097,\n        \"229\": 0.061,\n        \"566\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.345\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.058\n    trailing_only_offset_is_reached = False\n\n    # Hyperopt Buy Parameters\n    buy_fastema = IntParameter(low=1, high=236, default=211, space='buy', optimize=True, load=True)\n    buy_slowema = IntParameter(low=1, high=126, default=364, space='buy', optimize=True, load=True)\n    buy_rsi = IntParameter(low=15, high=70, default=52, space='buy', optimize=True, load=True)\n    buy_mfi = IntParameter(low=15, high=70, default=30, space='buy', optimize=True, load=True)\n\n    buy_rsi_enabled = CategoricalParameter([True, False], space='buy', optimize=True, default=False)\n    buy_mfi_enabled = CategoricalParameter([True, False], space='buy', optimize=True, default=False)\n    buy_ema_enabled = CategoricalParameter([True, False], space='buy', optimize=True, default=False)\n    buy_trigger = CategoricalParameter([\"bb_lower1\", \"bb_lower2\", \"bb_lower3\", \"bb_lower4\"], default=\"bb_lower1\", space=\"buy\")\n\n    # Hyperopt Sell Parameters\n    sell_fastema = IntParameter(low=1, high=365, default=7, space='sell', optimize=True, load=True)\n    sell_slowema = IntParameter(low=1, high=365, default=6, space='sell', optimize=True, load=True)\n    sell_rsi = IntParameter(low=30, high=100, default=57, space='sell', optimize=True, load=True)\n    sell_mfi = IntParameter(low=30, high=100, default=46, space='sell', optimize=True, load=True)\n\n    sell_rsi_enabled = CategoricalParameter([True, False], space='sell', optimize=True, default=False)\n    sell_mfi_enabled = CategoricalParameter([True, False], space='sell', optimize=True, default=True)\n    sell_ema_enabled = CategoricalParameter([True, False], space='sell', optimize=True, default=False)\n    sell_trigger = CategoricalParameter([\"sell-bb_upper1\", \"sell-bb_upper2\", \"sell-bb_upper3\", \"sell-bb_upper4\"], default=\"sell-bb_upper2\", space=\"sell\")\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Bollinger Bands 1,2,3 and 4\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        dataframe['bb_middleband4'] = bollinger4['mid']\n        dataframe['bb_upperband4'] = bollinger4['upper']\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        # GUARDS\n        if self.buy_rsi_enabled.value:\n            conditions.append(dataframe['rsi'] < self.buy_rsi.value)\n        if self.buy_mfi_enabled.value:\n            conditions.append(dataframe['mfi'] < self.buy_mfi.value)\n        if self.buy_ema_enabled.value:\n            try:\n                conditions.append(ta.EMA(dataframe, timeperiod=int(self.buy_fastema.value)) > ta.EMA(dataframe, timeperiod=int(self.buy_slowema.value)))\n            except Exception:\n                pass\n\n        # TRIGGERS\n        if self.buy_trigger.value == 'bb_lower1':\n            conditions.append(dataframe[\"close\"] < dataframe['bb_lowerband1'])\n        if self.buy_trigger.value == 'bb_lower2':\n            conditions.append(dataframe[\"close\"] < dataframe['bb_lowerband2'])\n        if self.buy_trigger.value == 'bb_lower3':\n            conditions.append(dataframe[\"close\"] < dataframe['bb_lowerband3'])\n        if self.buy_trigger.value == 'bb_lower4':\n            conditions.append(dataframe[\"close\"] < dataframe['bb_lowerband4'])\n\n        # Check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        # GUARDS\n        if self.sell_rsi_enabled.value:\n            conditions.append(dataframe['rsi'] > self.sell_rsi.value)\n        if self.sell_mfi_enabled.value:\n            conditions.append(dataframe['mfi'] > self.sell_mfi.value)\n        if self.sell_ema_enabled.value:\n            try:\n                conditions.append(ta.EMA(dataframe, timeperiod=int(self.sell_fastema.value)) < ta.EMA(dataframe, timeperiod=int(self.sell_slowema.value)))\n            except Exception:\n                pass\n\n        # TRIGGERS\n        if self.sell_trigger.value == 'sell-bb_upper1':\n            conditions.append(dataframe[\"close\"] > dataframe['bb_upperband1'])\n        if self.sell_trigger.value == 'sell-bb_upper2':\n            conditions.append(dataframe[\"close\"] > dataframe['bb_upperband2'])\n        if self.sell_trigger.value == 'sell-bb_upper3':\n            conditions.append(dataframe[\"close\"] > dataframe['bb_upperband3'])\n        if self.sell_trigger.value == 'sell-bb_upper4':\n            conditions.append(dataframe[\"close\"] > dataframe['bb_upperband4'])\n\n        # Check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BbRoi/BbRoi.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass BbRoi(IStrategy):\n    minimal_roi = { \n        \"0\": 0.17552,\n        \"53\": 0.11466,\n        \"226\": 0.06134,\n        \"400\": 0\n    }   \n\n    # Stoploss:\n    stoploss = -0.23701\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01007\n    trailing_stop_positive_offset = 0.01821\n    trailing_only_offset_is_reached = True\n\n    ticker_interval = '15m'\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    ignore_roi_if_buy_signal = False\n\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': True\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # EMA\n        dataframe['ema9'] = ta.EMA(dataframe, timeperiod=9)\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['close'] > dataframe['bb_middleband']) &\n                    (dataframe['close'] < dataframe['bb_upperband']) &\n                    (dataframe['close'] > dataframe['ema9']) &\n                    (dataframe['close'] > dataframe['ema200']) &\n                    (dataframe['ema20'] > dataframe['ema200'])\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'] > 75) |\n                    (dataframe['close'] < dataframe['bb_middleband'] * 0.97) &\n                    (dataframe['open'] > dataframe['close'])  # red bar\n\n            ),\n            'sell'] = 1\n        return dataframe\n\n"
  },
  {
    "path": "strategies/BbandRsi/BbandRsi.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass BbandRsi(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/BbandRsi.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'] < 30) &\n                    (dataframe['close'] < dataframe['bb_lowerband'])\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'] > 70)\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BbandRsiRolling/BbandRsiRolling.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\n\n# --------------------------------\n\n\nclass BbandRsiRolling(IStrategy):\n    \"\"\"\n\n    author@: Michael Fourie\n\n    This strategy uses Bollinger Bands and the rolling rsi to determine when it should make a buy.\n    Selling is completley determined by the minimal roi.\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This has been determined through hyperopt in a timerange of 270 days.\n    minimal_roi = {\n        \"0\":  0.03279,\n        \"259\": 0.02964,\n        \"536\" : 0.02467,\n        \"818\": 0.02326,\n        \"965\": 0.01951,\n        \"1230\": 0.01492,\n        \"1279\" : 0.01502,\n        \"1448\": 0.00945,\n        \"1525\" : 0.00698,\n        \"1616\": 0.00319,\n        \"1897\" : 0\n\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.08\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'].rolling(8).min() < 37) &\n                    (dataframe['close'] < dataframe['bb_lowerband'])\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BcmbigzDevelop/BcmbigzDevelop.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import (\n    merge_informative_pair,\n    CategoricalParameter,\n    DecimalParameter,\n    IntParameter,\n)\nfrom functools import reduce\nimport logging\n\n# -------------------------------------------------------------------------------------------------\n# --- logger for parameter merging output, only remove if you remove it further down too! ---------\nlogger = logging.getLogger(__name__)\n# -------------------------------------------------------------------------------------------------\n\n\nclass BcmbigzDevelop(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018, }\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018, }\n    minimal_roi = {\"0\": 0.20, \"38\": 0.074, \"78\": 0.025, \"194\": 0}\n\n    stoploss = -0.99  # effectively disabled.\n\n    timeframe = \"5m\"\n    inf_1h = \"1h\"\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = (\n        0.001  # it doesn't meant anything, just to guarantee there is a minimal profit.\n    )\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.05\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        \"buy\": \"market\",\n        \"sell\": \"market\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": False,\n    }\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        #############\n        # Enable/Disable conditions\n        \"bzv7_buy_condition_0_enable\": True,\n        \"bzv7_buy_condition_1_enable\": True,\n        \"bzv7_buy_condition_2_enable\": True,\n        \"bzv7_buy_condition_3_enable\": True,\n        \"bzv7_buy_condition_4_enable\": True,\n        \"bzv7_buy_condition_5_enable\": True,\n        \"bzv7_buy_condition_6_enable\": True,\n        \"bzv7_buy_condition_7_enable\": True,\n        \"bzv7_buy_condition_8_enable\": True,\n        \"bzv7_buy_condition_9_enable\": True,\n        \"bzv7_buy_condition_10_enable\": False,\n        \"bzv7_buy_condition_11_enable\": False,\n        \"bzv7_buy_condition_12_enable\": True,\n        \"bzv7_buy_condition_13_enable\": False,\n        \"v6_buy_condition_0_enable\": False,\n        \"v6_buy_condition_1_enable\": True,\n        \"v6_buy_condition_2_enable\": True,\n        \"v6_buy_condition_3_enable\": True,\n        \"v8_buy_condition_0_enable\": True,\n        \"v8_buy_condition_1_enable\": False,\n        \"v8_buy_condition_2_enable\": True,\n        \"v8_buy_condition_3_enable\": False,\n        \"v8_buy_condition_4_enable\": True,\n    }\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"bzv7_sell_condition_0_enable\": False,\n        \"v8_sell_condition_0_enable\": True,\n        \"v8_sell_condition_1_enable\": True,\n    }\n\n    # if you want to see which buy conditions were met\n    # or if there is an trade exit override due to high RSI set to True\n    # logger will output the buy and trade exit conditions\n    cust_log_verbose = False\n    ############################################################################\n    # minimum conditions to match in buy\n    buy_minimum_conditions = IntParameter(\n        1, 2, default=1, space=\"buy\", optimize=False, load=True\n    )\n    #  Strategy: BigZ07\n    # Buy HyperParam\n    bzv7_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_4_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_5_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_6_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_7_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_8_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_9_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_10_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_11_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_12_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_condition_13_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=False, space=\"sell\", optimize=False, load=True\n    )\n\n    bzv7_buy_bb20_close_bblowerband_safe_1 = DecimalParameter(\n        0.7, 1.1, default=0.989, space=\"buy\", optimize=False, load=True\n    )\n    bzv7_buy_bb20_close_bblowerband_safe_2 = DecimalParameter(\n        0.7, 1.1, default=0.982, space=\"buy\", optimize=False, load=True\n    )\n\n    bzv7_buy_volume_pump_1 = DecimalParameter(\n        0.1, 0.9, default=0.4, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_volume_drop_1 = DecimalParameter(\n        1, 10, default=3.8, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_volume_drop_2 = DecimalParameter(\n        1, 10, default=3, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_volume_drop_3 = DecimalParameter(\n        1, 10, default=2.7, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n\n    bzv7_buy_rsi_1h_1 = DecimalParameter(\n        10.0, 40.0, default=16.5, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_rsi_1h_2 = DecimalParameter(\n        10.0, 40.0, default=15.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_rsi_1h_3 = DecimalParameter(\n        10.0, 40.0, default=20.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_rsi_1h_4 = DecimalParameter(\n        10.0, 40.0, default=35.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_rsi_1h_5 = DecimalParameter(\n        10.0, 60.0, default=39.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n\n    bzv7_buy_rsi_1 = DecimalParameter(\n        10.0, 40.0, default=28.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_rsi_2 = DecimalParameter(\n        7.0, 40.0, default=10.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    bzv7_buy_rsi_3 = DecimalParameter(\n        7.0, 40.0, default=14.2, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n\n    bzv7_buy_macd_1 = DecimalParameter(\n        0.01, 0.09, default=0.02, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    bzv7_buy_macd_2 = DecimalParameter(\n        0.01, 0.09, default=0.03, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n\n    #  Strategy: CombinedBinHClucAndMADV6\n    v6_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    # Strategy:  CombinedBinHClucV8\n    v8_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_4_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n    v8_sell_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n\n    v8_sell_rsi_main = DecimalParameter(\n        72.0, 90.0, default=80, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_0 = DecimalParameter(\n        0.001, 0.1, default=0.015, space=\"buy\", decimals=3, optimize=False, load=True\n    )\n    buy_dip_threshold_1 = DecimalParameter(\n        0.08, 0.2, default=0.12, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_2 = DecimalParameter(\n        0.02, 0.4, default=0.28, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_3 = DecimalParameter(\n        0.25, 0.44, default=0.36, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_bb40_bbdelta_close = DecimalParameter(\n        0.005, 0.04, default=0.031, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb40_closedelta_close = DecimalParameter(\n        0.01, 0.03, default=0.021, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb40_tail_bbdelta = DecimalParameter(\n        0.2, 0.4, default=0.264, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_close_bblowerband = DecimalParameter(\n        0.8, 1.1, default=0.992, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_volume = IntParameter(\n        18, 36, default=29, space=\"buy\", optimize=False, load=True\n    )\n    buy_rsi_diff = DecimalParameter(\n        34.0, 60.0, default=50.48, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_min_inc = DecimalParameter(\n        0.005, 0.05, default=0.01, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_rsi_1h = DecimalParameter(\n        40.0, 70.0, default=67.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_rsi = DecimalParameter(\n        30.0, 40.0, default=38.5, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_mfi = DecimalParameter(\n        36.0, 65.0, default=36.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_volume_1 = DecimalParameter(\n        1.0, 10.0, default=2.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_ema_open_mult_1 = DecimalParameter(\n        0.01, 0.05, default=0.02, space=\"buy\", decimals=3, optimize=False, load=True\n    )\n    sell_custom_roi_profit_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_1 = DecimalParameter(\n        40.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_profit_2 = DecimalParameter(\n        0.01, 0.20, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_2 = DecimalParameter(\n        42.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_profit_3 = DecimalParameter(\n        0.15, 0.30, default=0.08, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_3 = DecimalParameter(\n        44.0, 58.0, default=56, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_profit_4 = DecimalParameter(\n        0.3, 0.7, default=0.14, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_4 = DecimalParameter(\n        44.0, 60.0, default=58, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_profit_5 = DecimalParameter(\n        0.01, 0.1, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_profit_min_1 = DecimalParameter(\n        0.1, 0.25, default=0.1, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_max_1 = DecimalParameter(\n        0.3, 0.5, default=0.4, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_down_1 = DecimalParameter(\n        0.04, 0.1, default=0.03, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_min_2 = DecimalParameter(\n        0.01, 0.1, default=0.02, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_max_2 = DecimalParameter(\n        0.08, 0.25, default=0.1, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_down_2 = DecimalParameter(\n        0.04, 0.2, default=0.015, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_custom_stoploss_1 = DecimalParameter(\n        -0.15, -0.03, default=-0.05, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n\n    def confirm_trade_exit(\n        self,\n        pair: str,\n        trade: Trade,\n        order_type: str,\n        amount: float,\n        rate: float,\n        time_in_force: str,\n        sell_reason: str,\n        **kwargs,\n    ) -> bool:\n\n        return True\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_1 = dataframe.iloc[-2].squeeze()\n\n        if sell_reason == \"roi\":\n            # Looks like we can get a little have more\n            if (last_candle[\"cmf\"] < -0.1) & (\n                last_candle[\"close\"] > last_candle[\"ema_200_1h\"]\n            ):\n                return False\n\n        return True\n\n    def custom_sell(\n        self,\n        pair: str,\n        trade: \"Trade\",\n        current_time: \"datetime\",\n        current_rate: float,\n        current_profit: float,\n        **kwargs,\n    ):\n\n        # return False\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_2 = dataframe.iloc[-2].squeeze()\n\n        if last_candle is not None:\n            # if (last_candle['high'] > last_candle['bb_upperband']) & (last_candle['volume'] > (last_candle_2['volume'] * 1.5)):\n            # return 'sell_signal_1'\n\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_4.value\n            ):\n                return \"roi_target_4\"\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_3.value\n            ):\n                return \"roi_target_3\"\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_2.value\n            ):\n                return \"roi_target_2\"\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_1.value\n            ):\n                return \"roi_target_1\"\n            elif (\n                (current_profit > 0)\n                & (current_profit < self.sell_custom_roi_profit_5.value)\n                & (last_candle[\"sma_200_dec\"])\n            ):\n                return \"roi_target_5\"\n\n            elif (\n                (current_profit > self.sell_trail_profit_min_1.value)\n                & (current_profit < self.sell_trail_profit_max_1.value)\n                & (\n                    ((trade.max_rate - trade.open_rate) / 100)\n                    > (current_profit + self.sell_trail_down_1.value)\n                )\n            ):\n                return \"trail_target_1\"\n            elif (\n                (current_profit > self.sell_trail_profit_min_2.value)\n                & (current_profit < self.sell_trail_profit_max_2.value)\n                & (\n                    ((trade.max_rate - trade.open_rate) / 100)\n                    > (current_profit + self.sell_trail_down_2.value)\n                )\n            ):\n                return \"trail_target_2\"\n\n        return False\n\n    def custom_stoploss(\n        self,\n        pair: str,\n        trade: \"Trade\",\n        current_time: datetime,\n        current_rate: float,\n        current_profit: float,\n        **kwargs,\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if current_profit > 0:\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=240)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if current_time > trade_time_50:\n\n                try:\n                    number_of_candle_shift = int(\n                        (current_time - trade_time_50).total_seconds() / 300\n                    )\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle[\"rsi_1h\"] < 35:\n                        return 0.99\n\n                    if candle[\"open\"] > candle[\"ema_200\"]:\n                        return 0.1\n\n                    # Are we still sinking?\n                    if current_rate * 1.025 < candle[\"open\"]:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, \"1h\") for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(\n        self, dataframe: DataFrame, metadata: dict\n    ) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(\n            pair=metadata[\"pair\"], timeframe=self.inf_1h\n        )\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h[\"ema_200\"] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h[\"rsi\"] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        informative_1h[\"bb_lowerband\"] = bollinger[\"lower\"]\n        informative_1h[\"bb_middleband\"] = bollinger[\"mid\"]\n        informative_1h[\"bb_upperband\"] = bollinger[\"upper\"]\n\n        # for BinClucMad\n        informative_1h[\"ema_100\"] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h[\"sma_200\"] = ta.SMA(\n            informative_1h, timeperiod=200\n        )  # for BinClucMad\n        informative_1h[\"sma_200_dec\"] = informative_1h[\"sma_200\"] < informative_1h[\n            \"sma_200\"\n        ].shift(\n            20\n        )  # for BinClucMad\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h[\"ssl_down\"] = ssl_down_1h\n        informative_1h[\"ssl_up\"] = ssl_up_1h\n        informative_1h[\"ssl-dir\"] = np.where(ssl_up_1h > ssl_down_1h, \"up\", \"down\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n\n        dataframe[\"volume_mean_slow\"] = dataframe[\"volume\"].rolling(window=48).mean()\n\n        # EMA\n        dataframe[\"ema_200\"] = ta.EMA(dataframe, timeperiod=200)\n        dataframe[\"ema_26\"] = ta.EMA(dataframe, timeperiod=26)\n        dataframe[\"ema_12\"] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD\n        dataframe[\"macd\"], dataframe[\"signal\"], dataframe[\"hist\"] = ta.MACD(\n            dataframe[\"close\"], fastperiod=12, slowperiod=26, signalperiod=9\n        )\n\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chaikin A/D Oscillator\n        dataframe[\"mfv\"] = MFV(dataframe)\n        dataframe[\"cmf\"] = (\n            dataframe[\"mfv\"].rolling(20).sum() / dataframe[\"volume\"].rolling(20).sum()\n        )\n\n        # for BinClucMad\n        dataframe[\"ema_50\"] = ta.EMA(dataframe, timeperiod=50)  # for BinClucMad\n        dataframe[\"sma_5\"] = ta.SMA(dataframe, timeperiod=5)\n        dataframe[\"sma_200\"] = ta.SMA(dataframe, timeperiod=200)\n        dataframe[\"sma_200_dec\"] = dataframe[\"sma_200\"] < dataframe[\"sma_200\"].shift(20)\n        dataframe[\"mfi\"] = ta.MFI(dataframe, timeperiod=14)\n\n        bb_40 = qtpylib.bollinger_bands(dataframe[\"close\"], window=40, stds=2)\n        dataframe[\"lower\"] = bb_40[\"lower\"]\n        dataframe[\"mid\"] = bb_40[\"mid\"]\n        dataframe[\"bbdelta\"] = (bb_40[\"mid\"] - dataframe[\"lower\"]).abs()\n        dataframe[\"closedelta\"] = (\n            dataframe[\"close\"] - dataframe[\"close\"].shift()\n        ).abs()\n        dataframe[\"tail\"] = (dataframe[\"close\"] - dataframe[\"low\"]).abs()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True\n        )\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        # reset additional dataframe rows\n        dataframe.loc[:, \"bzv7_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_5_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_6_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_7_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_8_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_9_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_10_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_11_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_12_enable\"] = False\n        dataframe.loc[:, \"bzv7_buy_condition_13_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"conditions_count\"] = 0\n\n        # Strategy: v8 BUY conditions\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & dataframe[\"lower\"].shift().gt(0)\n                & dataframe[\"bbdelta\"].gt(\n                    dataframe[\"close\"] * self.buy_bb40_bbdelta_close.value\n                )\n                & dataframe[\"closedelta\"].gt(\n                    dataframe[\"close\"] * self.buy_bb40_closedelta_close.value\n                )\n                & dataframe[\"tail\"].lt(\n                    dataframe[\"bbdelta\"] * self.buy_bb40_tail_bbdelta.value\n                )\n                & dataframe[\"close\"].lt(dataframe[\"lower\"].shift())\n                & dataframe[\"close\"].le(dataframe[\"close\"].shift())\n                & (self.v8_buy_condition_0_enable.value == True)\n            ),\n            \"v8_buy_condition_0_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (\n                    dataframe[\"close\"]\n                    < self.buy_bb20_close_bblowerband.value * dataframe[\"bb_lowerband\"]\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (\n                        dataframe[\"volume_mean_slow\"].shift(1)\n                        * self.buy_bb20_volume.value\n                    )\n                )\n                & (self.v8_buy_condition_1_enable.value == True)\n            ),\n            \"v8_buy_condition_1_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - self.buy_rsi_diff.value)\n                & (self.v8_buy_condition_2_enable.value == True)\n            ),\n            \"v8_buy_condition_2_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"sma_200\"] > dataframe[\"sma_200\"].shift(20))\n                & (dataframe[\"sma_200_1h\"] > dataframe[\"sma_200_1h\"].shift(16))\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(24).min() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    > self.buy_min_inc.value\n                )\n                & (dataframe[\"rsi_1h\"] > self.buy_rsi_1h.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi.value)\n                & (dataframe[\"mfi\"] < self.buy_mfi.value)\n                & (self.v8_buy_condition_3_enable.value == True)\n            ),\n            \"v8_buy_condition_3_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    dataframe[\"volume\"].rolling(4).mean() * self.buy_volume_1.value\n                    > dataframe[\"volume\"]\n                )\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_ema_open_mult_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v8_buy_condition_4_enable.value == True)\n            ),\n            \"v8_buy_condition_4_enable\",\n        ] = 1\n\n        # Strategy: v6 BUY conditions\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.99 * dataframe[\"bb_lowerband\"])\n                & (\n                    (\n                        dataframe[\"volume\"]\n                        < (dataframe[\"volume_mean_slow\"].shift(1) * 21)\n                    )\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > (dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                    )\n                )\n                & (self.v6_buy_condition_0_enable.value == True)\n            ),\n            \"v6_buy_condition_0_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.975 * dataframe[\"bb_lowerband\"])\n                & (\n                    (\n                        dataframe[\"volume\"]\n                        < (dataframe[\"volume_mean_slow\"].shift(1) * 20)\n                    )\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                )\n                & (dataframe[\"rsi_1h\"] < 15)  # Don't buy if someone drop the market.\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (self.v6_buy_condition_1_enable.value == True)\n            ),\n            \"v6_buy_condition_1_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * 0.02)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (\n                    (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_2_enable.value == True)\n            ),\n            \"v6_buy_condition_2_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * 0.03)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_3_enable.value == True)\n            ),\n            \"v6_buy_condition_3_enable\",\n        ] = 1\n\n        # Strategy: BigZ07 BUY conditions\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_0_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.bzv7_buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_1_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.bzv7_buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_2_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.bzv7_buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_3_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_4_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.bzv7_buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            \"bzv7_buy_condition_5_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.bzv7_buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_6_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_2.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.bzv7_buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_7_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.bzv7_buy_rsi_1.value) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_8_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.bzv7_buy_rsi_2.value) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_9_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_10_enable.value\n                & (dataframe[\"rsi_1h\"] < self.bzv7_buy_rsi_1h_4.value)\n                & (dataframe[\"close_1h\"] < dataframe[\"bb_lowerband_1h\"])\n                & (dataframe[\"hist\"] > 0)\n                & (dataframe[\"hist\"].shift(2) < 0)\n                & (dataframe[\"rsi\"] < 40.5)\n                & (dataframe[\"hist\"] > dataframe[\"close\"] * 0.0012)\n                & (dataframe[\"open\"] < dataframe[\"close\"])\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"bzv7_buy_condition_10_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_11_enable.value &\n\n                ((dataframe['high'] - dataframe['low']) < dataframe['open']/100) &\n                (dataframe['open'] < dataframe['close']) &\n                ((dataframe['high'].shift() - dataframe['low'].shift()) < dataframe['open'].shift()/100) &\n                ((dataframe['high'].shift(2) - dataframe['low'].shift(2)) < dataframe['open'].shift(2)/100) &\n                ((dataframe['high'].shift(3) - dataframe['low'].shift(3)) < dataframe['open'].shift(3)/100) &\n                ((dataframe['high'].shift(4) - dataframe['low'].shift(4)) < dataframe['open'].shift(4)/100) &\n                ((dataframe['high'].shift(5) - dataframe['low'].shift(5)) < dataframe['open'].shift(5)/100) &\n                ((dataframe['high'].shift(6) - dataframe['low'].shift(6)) < dataframe['open'].shift(6)/100) &\n                ((dataframe['high'].shift(7) - dataframe['low'].shift(7)) < dataframe['open'].shift(7)/100) &\n                ((dataframe['high'].shift(8) - dataframe['low'].shift(8)) < dataframe['open'].shift(8)/100) &\n                ((dataframe['high'].shift(9) - dataframe['low'].shift(9)) < dataframe['open'].shift(9)/100) &\n                (dataframe['bb_middleband'] > dataframe['bb_middleband'].shift(9) * 1.005) &\n                (dataframe['rsi'] < 68) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            \"bzv7_buy_condition_11_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            ),\n            \"bzv7_buy_condition_12_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                self.bzv7_buy_condition_13_enable.value\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"cmf\"] < -0.435)\n                & (dataframe[\"rsi\"] < 22)\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(48)\n                    * self.bzv7_buy_volume_pump_1.value\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"] * self.bzv7_buy_volume_pump_1.value\n                    < dataframe[\"volume_mean_slow\"].shift(48)\n                )\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"bzv7_buy_condition_13_enable\",\n        ] = 1\n\n        # count the amount of conditions met\n        dataframe.loc[:, \"conditions_count\"] = (\n            dataframe[\"bzv7_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_4_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_5_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_6_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_7_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_8_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_9_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_10_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_11_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_12_enable\"].astype(int)\n            + dataframe[\"bzv7_buy_condition_13_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_4_enable\"].astype(int)\n        )\n\n        # append the minimum amount of conditions to be met\n        conditions.append(\n            dataframe[\"conditions_count\"] >= self.buy_minimum_conditions.value\n        )\n        conditions.append(dataframe[\"volume\"].gt(0))\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"buy\"] = 1\n\n        # verbose logging enable only for verbose information or troubleshooting\n        if self.cust_log_verbose == True:\n            for index, row in dataframe.iterrows():\n                if row[\"buy\"] == 1:\n                    buy_cond_details = f\"count={int(row['conditions_count'])}/bzv7_1={int(row['bzv7_buy_condition_1_enable'])}/bzv7_2={int(row['bzv7_buy_condition_2_enable'])}/bzv7_3={int(row['bzv7_buy_condition_3_enable'])}/bzv7_4={int(row['bzv7_buy_condition_4_enable'])}/bzv7_5={int(row['bzv7_buy_condition_5_enable'])}/bzv7_6={int(row['bzv7_buy_condition_6_enable'])}/bzv7_7={int(row['bzv7_buy_condition_7_enable'])}/bzv7_8={int(row['bzv7_buy_condition_8_enable'])}/bzv7_9={int(row['bzv7_buy_condition_9_enable'])}/bzv7_10={int(row['bzv7_buy_condition_10_enable'])}/bzv7_11={int(row['bzv7_buy_condition_11_enable'])}/bzv7_12={int(row['bzv7_buy_condition_12_enable'])}/bzv7_13={int(row['bzv7_buy_condition_13_enable'])}/bzv7_0={int(row['bzv7_buy_condition_0_enable'])}/v6_0={int(row['v6_buy_condition_0_enable'])}/v6_1={int(row['v6_buy_condition_1_enable'])}/v6_2={int(row['v6_buy_condition_2_enable'])}/v6_3={int(row['v6_buy_condition_3_enable'])}/v8_0={int(row['v8_buy_condition_0_enable'])}/v8_1={int(row['v8_buy_condition_1_enable'])}/v8_2={int(row['v8_buy_condition_2_enable'])}/v8_3={int(row['v8_buy_condition_3_enable'])}/v8_4={int(row['v8_buy_condition_4_enable'])}\"\n\n                    logger.info(\n                        f\"{metadata['pair']} - candle: {row['date']} - buy condition - details: {buy_cond_details}\"\n                    )\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        # dataframe.loc[:, \"sell\"] = 0\n\n        if self.bzv7_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_middleband\"] * 1.01)\n                    & (\n                        dataframe[\"volume\"] > 0\n                    )  # Don't be gready, sell fast  # Make sure Volume is not 0\n                )\n            )\n\n        if self.v8_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_upperband\"])\n                    & (dataframe[\"close\"].shift(1) > dataframe[\"bb_upperband\"].shift(1))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_sell_condition_1_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi\"] > self.v8_sell_rsi_main.value)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n\n        return dataframe\n\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(\n        df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN)\n    )\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\n# Chaikin Money Flow Volume\ndef MFV(dataframe):\n    df = dataframe.copy()\n    N = ((df[\"close\"] - df[\"low\"]) - (df[\"high\"] - df[\"close\"])) / (\n        df[\"high\"] - df[\"low\"]\n    )\n    M = N * df[\"volume\"]\n    return M\n"
  },
  {
    "path": "strategies/BcmbigzV1/BcmbigzV1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n\nclass BcmbigzV1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.038,         # I feel lucky!\n        \"10\": 0.028,\n        \"40\": 0.015,\n        \"180\": 0.018,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"bzv7_buy_condition_0_enable\": True,\n        \"bzv7_buy_condition_1_enable\": True,\n        \"bzv7_buy_condition_2_enable\": True,\n        \"bzv7_buy_condition_3_enable\": True,\n        \"bzv7_buy_condition_4_enable\": True,\n        \"bzv7_buy_condition_5_enable\": True,\n        \"bzv7_buy_condition_6_enable\": True,\n        \"bzv7_buy_condition_7_enable\": True,\n        \"bzv7_buy_condition_8_enable\": True,\n        \"bzv7_buy_condition_9_enable\": True,\n        \"bzv7_buy_condition_10_enable\": True,\n        \"bzv7_buy_condition_11_enable\": True,\n        \"bzv7_buy_condition_12_enable\": True,\n        \"bzv7_buy_condition_13_enable\": True,\n    }\n\n    ############################################################################\n\n    # BigZ07 Strategy Buy HyperParam\n\n    bzv7_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    bzv7_buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    bzv7_buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    bzv7_buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    bzv7_buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    bzv7_buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    bzv7_buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    bzv7_buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    bzv7_buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    bzv7_buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n\n        return True\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_1 = dataframe.iloc[-2].squeeze()\n\n        if (sell_reason == 'roi'):\n            # Looks like we can get a little have more\n            if (last_candle['cmf'] < -0.1) & (last_candle['close'] > last_candle['ema_200_1h']):\n                return False\n\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        return False\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_2 = dataframe.iloc[-2].squeeze()\n\n        if (last_candle is not None):\n            if (last_candle['high'] > last_candle['bb_upperband']) & (last_candle['volume'] > (last_candle_2['volume'] * 1.5)):\n                return 'sell_signal_1'\n\n        return False\n\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 40:\n                        return 0.99\n \n                    if candle['open_1h'] > candle['ema_200_1h']:\n                            return 0.1\n\n                    # Are we still sinking?\n                    if current_rate * 1.025 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chaikin A/D Oscillator\n        dataframe['mfv'] = MFV(dataframe)\n        dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_13_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['cmf'] < -0.435) &\n                (dataframe['rsi'] < 22) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.bzv7_buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.bzv7_buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.bzv7_buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.bzv7_buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.bzv7_buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.bzv7_buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.bzv7_buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.bzv7_buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.bzv7_buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.bzv7_buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.bzv7_buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.bzv7_buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.bzv7_buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.bzv7_buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.bzv7_buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.bzv7_buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe\n\n# Chaikin Money Flow Volume\ndef MFV(dataframe):\n    df = dataframe.copy()\n    N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    M = N * df['volume']\n    return M"
  },
  {
    "path": "strategies/BigPete/BigPete.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom typing import Dict, List\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\n\n\n###########################################################################################################\n##                   BigZ04_TSL4 by Perkmeister, based on BigZ04 by ilya                                 ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n##    This is a modified version of BigZ04 that uses custom_stoploss() to implement a hard stoploss      ##\n##    of 8%, and to replace the roi table with a trailing stoploss to extract more profit when prices    ##\n##    start to rise above a profit threshold. It's quite simple and crude and is a 'first stab' at the   ##\n##    hard stoploss problem, use live at your own risk ;). The sell signals from SMAOffsetProtectOptV1   ##\n##    have been added but are currently disabled as had no benefit.                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  hard stoploss function preventing from big fall                                             ##\n##        -  trailing stoploss while in profit                                                           ##\n##        -  no sell signal. Uses custom stoploss                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist it is recommended to use a static pairlst such as iterativ's orginal:                 ##\n##   https://discord.com/channels/700048804539400213/702584639063064586/838038600368783411               ## \n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass BigPete(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 100.0\n    }\n    \n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.003\n    trailing_stop_positive_offset = 0.0187\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    optimize_cond = True\n    opzimize_buy_params = False\n    \n    buy_params = {\n      \"buy_bb20_close_bblowerband_safe_1\": 0.999,\n      \"buy_bb20_close_bblowerband_safe_2\": 1.01,\n      \"buy_condition_0_enable\": True,\n      \"buy_condition_10_enable\": True,\n      \"buy_condition_11_enable\": True,\n      \"buy_condition_12_enable\": True,\n      \"buy_condition_13_enable\": False,\n      \"buy_condition_1_enable\": True,\n      \"buy_condition_2_enable\": True,\n      \"buy_condition_3_enable\": True,\n      \"buy_condition_4_enable\": True,\n      \"buy_condition_5_enable\": True,\n      \"buy_condition_6_enable\": True,\n      \"buy_condition_7_enable\": True,\n      \"buy_condition_8_enable\": True,\n      \"buy_condition_9_enable\": True,\n      \"buy_dip_0\": 1.029,\n      \"buy_macd_1\": 0.05,\n      \"buy_macd_2\": 0.03,\n      \"buy_rsi_0\": 11.2,\n      \"buy_rsi_1\": 15.7,\n      \"buy_rsi_1h_0\": 81.7,\n      \"buy_rsi_1h_1\": 14.2,\n      \"buy_rsi_1h_1a\": 67.8,\n      \"buy_rsi_1h_2\": 23.5,\n      \"buy_rsi_1h_3\": 21.6,\n      \"buy_rsi_1h_4\": 31.5,\n      \"buy_rsi_1h_5\": 31.3,\n      \"buy_rsi_2\": 11.3,\n      \"buy_rsi_3\": 35.6,\n      \"buy_volume_drop_1\": 5.4,\n      \"buy_volume_drop_2\": 1.6,\n      \"buy_volume_drop_3\": 9.7,\n      \"buy_volume_pump_1\": 0.1\n    }\n#   Optimize custom Stop-Loss, trailing + profit threshold\n    opzimize_cSL=True \t\t#default True\n    optimize_trailing=True \t#default True\n    optimize_SLT=False\t\t#default False\n    # V1 original\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 49,\n        \"high_offset\": 1.006,\n        \"narrow_stop\": 1.02,\n        \"pHSL\": -0.08,\n        \"pPF_1\": 0.016,\n        \"pPF_2\": 0.08,\n        \"pSL_1\": 0.011,\n        \"pSL_2\": 0.04,\n        \"rsi_1h_val\": 32,\n        \"trade_time\": 35,\n        \"wide_stop\": 1.035\n\n    }\n    \n    \n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_0_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_1_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_2_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_3_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_4_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_5_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_6_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_7_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_8_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_9_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_10_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_11_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_12_enable'], space='buy', optimize=optimize_cond, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=buy_params['buy_condition_13_enable'], space='buy', optimize=optimize_cond, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.950, 1.050, default=buy_params['buy_bb20_close_bblowerband_safe_1'], decimals=3, space='buy', optimize=opzimize_buy_params, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.700, 1.100, default=buy_params['buy_bb20_close_bblowerband_safe_2'], decimals=2, space='buy', optimize=opzimize_buy_params, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=buy_params['buy_volume_pump_1'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=buy_params['buy_volume_drop_1'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=buy_params['buy_volume_drop_2'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=buy_params['buy_volume_drop_3'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n\n    buy_rsi_1h_0 = DecimalParameter(55.0, 85.0, default=buy_params['buy_rsi_1h_0'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)    \n    buy_rsi_1h_1a = DecimalParameter(65.0, 78.0, default=buy_params['buy_rsi_1h_1a'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=buy_params['buy_rsi_1h_1'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=buy_params['buy_rsi_1h_2'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=buy_params['buy_rsi_1h_3'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=buy_params['buy_rsi_1h_4'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=buy_params['buy_rsi_1h_5'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n\n    buy_rsi_0 = DecimalParameter(10.0, 40.0, default=buy_params['buy_rsi_0'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=buy_params['buy_rsi_1'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=buy_params['buy_rsi_2'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=buy_params['buy_rsi_3'], space='buy', decimals=1, optimize=opzimize_buy_params, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=buy_params['buy_macd_1'], space='buy', decimals=2, optimize=opzimize_buy_params, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=buy_params['buy_macd_2'], space='buy', decimals=2, optimize=opzimize_buy_params, load=True)\n\n    buy_dip_0 = DecimalParameter(1.015, 1.040, default=buy_params['buy_dip_0'], space='buy', decimals=3, optimize=opzimize_buy_params, load=True)\n\n\n    # hyperopt parameters for custom_stoploss()\n    trade_time = IntParameter(25, 65, default=sell_params['trade_time'], space='sell', optimize=opzimize_cSL, load=True)\n    rsi_1h_val = IntParameter(25, 45, default=sell_params['rsi_1h_val'], space='sell', optimize=opzimize_cSL, load=True)\n    narrow_stop = DecimalParameter(1.005, 1.030, default=sell_params['narrow_stop'], space='sell', decimals=3, optimize=opzimize_cSL, load=True)\n    wide_stop = DecimalParameter(1.010, 1.045, default=sell_params['wide_stop'], space='sell', decimals=3, optimize=opzimize_cSL, load=True)\n\n    # hyperopt parameters for SMAOffsetProtectOptV1 sell signal\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False, load=True)\n    high_offset = DecimalParameter(0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=False, load=True)\n\n    # trailing stoploss hyperopt parameters\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=sell_params['pHSL'], decimals=3, space='sell', optimize=optimize_trailing, load=True)\n\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=sell_params['pPF_1'], decimals=3, space='sell', optimize=optimize_SLT, load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=sell_params['pSL_1'], decimals=3, space='sell', optimize=optimize_SLT, load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=sell_params['pPF_2'], decimals=3, space='sell', optimize=optimize_SLT, load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=sell_params['pSL_2'], decimals=3, space='sell', optimize=optimize_SLT, load=True)\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        return False\n\n\n    # new custom stoploss, both hard and trailing functions. Trailing stoploss first rises at a slower\n    # rate than the current rate until a profit threshold is reached, after which it rises at a constant\n    # percentage as per a normal trailing stoploss. This allows more margin for pull-backs during a rise.\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value \n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1)*(SL_2 - SL_1)/(PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n        \n        return stoploss_from_open(sl_profit, current_profit)\n    \n        \n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.SMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # ------ ATR stuff\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        cond13 = (self.buy_condition_12_enable.value & (dataframe['close'] > dataframe['ema_200']) & (dataframe['close'] > dataframe['ema_200_1h']) & \n                            (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                            (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                            (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                            (dataframe['rsi_1h'] < 72.8) &\n                            (dataframe['open'] > dataframe['close']) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                            (dataframe['volume'] > 0).astype(int))\n        \n\n        cond11 = (self.buy_condition_11_enable.value &\n                            (dataframe['close'] > dataframe['ema_200']) &\n                            (dataframe['hist'] > 0) &\n                            (dataframe['hist'].shift() > 0) &\n                            (dataframe['hist'].shift(2) > 0) &\n                            (dataframe['hist'].shift(3) > 0) &\n                            (dataframe['hist'].shift(5) > 0) &\n                            (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                            (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                            ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                            ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                            (dataframe['rsi'] > 51) &\n                            (dataframe['open'] < dataframe['close']) &\n                            (dataframe['open'].shift() > dataframe['close'].shift()) &\n                            (dataframe['close'] > dataframe['bb_middleband']) &\n                            (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                            (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n                            (dataframe['volume'] > 0)).astype(int)  # Make sure Volume is not 0\n        \n\n        cond0 = (self.buy_condition_0_enable.value &\n                            (dataframe['close'] > dataframe['ema_200']) &\n                            (dataframe['rsi'] < self.buy_rsi_0.value) &\n                            ((dataframe['close'] * self.buy_dip_0.value < dataframe['open'].shift(3)) | \n                            (dataframe['close'] * self.buy_dip_0.value< dataframe['open'].shift(2)) |\n                            (dataframe['close'] * self.buy_dip_0.value < dataframe['open'].shift(1))) &\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_0.value) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] > 0)).astype(int)  # Make sure Volume is not 0\n            \n      \n        cond1 = (self.buy_condition_1_enable.value &\n\n                            (dataframe['close'] > dataframe['ema_200']) &\n                            (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                            (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_1a.value) &\n                            (dataframe['open'] > dataframe['close']) &\n                            \n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                            (dataframe['volume'] > 0)).astype(int) \n                    \n\n        cond2 = (self.buy_condition_2_enable.value &(dataframe['close'] > dataframe['ema_200']) &(dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &(dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &(dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &(dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &(dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &(dataframe['volume'] > 0))\n        \n\n        cond3 = (self.buy_condition_3_enable.value &\n                            (dataframe['close'] > dataframe['ema_200_1h']) &\n                            (dataframe['close'] < dataframe['bb_lowerband']) &\n                            (dataframe['rsi'] < self.buy_rsi_3.value) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n                            (dataframe['volume'] > 0)).astype(int) \n        \n\n        cond4 = (self.buy_condition_4_enable.value &\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n                            (dataframe['close'] < dataframe['bb_lowerband']) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            (dataframe['volume'] > 0)).astype(int) \n        \n\n        cond5 = (self.buy_condition_5_enable.value &\n\n                            (dataframe['close'] > dataframe['ema_200']) &\n                            (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                            (dataframe['ema_26'] > dataframe['ema_12']) &\n                            ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                            ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                            (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] > 0)).astype(int) \n            \n\n        cond6 = (self.buy_condition_6_enable.value &\n\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                            (dataframe['ema_26'] > dataframe['ema_12']) &\n                            ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                            ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                            (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            (dataframe['volume'] > 0)).astype(int) \n            \n\n        cond7 = (self.buy_condition_7_enable.value &\n\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                            \n                            (dataframe['ema_26'] > dataframe['ema_12']) &\n                            ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                            ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                            \n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] > 0)).astype(int) \n\n\n        cond8 = (self.buy_condition_8_enable.value &\n\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                            (dataframe['rsi'] < self.buy_rsi_1.value) &\n                            \n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                            (dataframe['volume'] > 0)).astype(int) \n\n        cond9 = (self.buy_condition_9_enable.value &\n\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                            (dataframe['rsi'] < self.buy_rsi_2.value) &\n                            \n                            (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                            (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                            (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                            (dataframe['volume'] > 0)).astype(int) \n\n        cond10 = (self.buy_condition_10_enable.value &\n\n                            (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                            (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                            (dataframe['hist'] > 0) &\n                            (dataframe['hist'].shift(2) < 0) &\n                            (dataframe['rsi'] < 40.5) &\n                            (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                            (dataframe['open'] < dataframe['close']) &\n                            (dataframe['volume'] > 0)).astype(int) \n\n        dataframe.loc[((cond1 + cond2 + cond3 + cond4 + cond5 + cond6 + cond7 + cond8 + cond9 + cond10 + cond11 + cond13) >= 1), 'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n\n        return dataframe"
  },
  {
    "path": "strategies/BigZ03/BigZ03.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\n\n\n###########################################################################################################\n##                                  BigZ03 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ03(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": False,\n        \"buy_condition_11_enable\": False,\n        \"buy_condition_12_enable\": True,\n    }\n\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 35:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.025 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.5\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (    \n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (    \n                self.buy_condition_11_enable.value &\n\n                ((dataframe['high'] - dataframe['low']) < dataframe['open']/100) &\n                (dataframe['open'] < dataframe['close']) &\n                ((dataframe['high'].shift() - dataframe['low'].shift()) < dataframe['open'].shift()/100) &\n                ((dataframe['high'].shift(2) - dataframe['low'].shift(2)) < dataframe['open'].shift(2)/100) &\n                ((dataframe['high'].shift(3) - dataframe['low'].shift(3)) < dataframe['open'].shift(3)/100) &\n                ((dataframe['high'].shift(4) - dataframe['low'].shift(4)) < dataframe['open'].shift(4)/100) &\n                ((dataframe['high'].shift(5) - dataframe['low'].shift(5)) < dataframe['open'].shift(5)/100) &\n                ((dataframe['high'].shift(6) - dataframe['low'].shift(6)) < dataframe['open'].shift(6)/100) &\n                ((dataframe['high'].shift(7) - dataframe['low'].shift(7)) < dataframe['open'].shift(7)/100) &\n                ((dataframe['high'].shift(8) - dataframe['low'].shift(8)) < dataframe['open'].shift(8)/100) &\n                ((dataframe['high'].shift(9) - dataframe['low'].shift(9)) < dataframe['open'].shift(9)/100) &\n                (dataframe['bb_middleband'] > dataframe['bb_middleband'].shift(9) * 1.005) &\n                (dataframe['rsi'] < 68) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (    \n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (    \n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (   \n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/BigZ0307HO/BigZ0307HO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\nfrom technical.indicators import zema\n\n###########################################################################################################\n##                                  BigZ03 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ0307HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.1,         # I feel lucky!\n        \"10\": 0.05,\n        \"40\": 0.02,\n        \"180\": 0.1,        # We're going up?\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_bb20_close_bblowerband_safe_1\": 0.957,\n        \"buy_bb20_close_bblowerband_safe_2\": 0.766,\n        \"buy_volume_drop_1\": 4.0,\n        \"buy_volume_pump_1\": 0.1,\n        \"buy_volume_drop_2\": 1.3,\n        \"buy_volume_drop_3\": 1.4,\n        \"buy_rsi_1h_1\": 38.2,\n        \"buy_rsi_1h_2\": 36.4,\n        \"buy_rsi_1h_3\": 19.1,\n        \"buy_rsi_1h_4\": 37.2,\n        \"buy_rsi_1h_5\": 51.0,\n        \"buy_macd_1\": 0.01,\n        \"buy_macd_2\": 0.01,\n        \"buy_rsi_1\": 16.0,\n        \"buy_rsi_2\": 14.8,\n        \"buy_rsi_3\": 10.8,\n        \"buy_rsi_1h_1\": 39.8,\n        \"buy_rsi_1h_2\": 37.9,\n        \"buy_rsi_1h_3\": 38.2,\n        \"buy_rsi_1h_4\": 38.1,\n        \"buy_rsi_1h_5\": 58.9,\n        \"buy_macd_1\": 0.07,\n        \"buy_macd_2\": 0.02,\n    }\n\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_optimize=True\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=buy_bb20_optimize, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=buy_bb20_optimize, load=True)\n\n    buy_volume_pump_optimize=False\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n\n    buy_rsi_1h_optimize_1=False\n    buy_rsi_1h_optimize_2=False\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_2, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_2, load=True)\n\n    buy_rsi_optimize=False\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n\n    buy_macd_optimize=False\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n\n    buy_condition_12_optimize=False\n    buy_condition_12_bblower_close = DecimalParameter(0.95, 0.995, default=0.993, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_bblower_low = DecimalParameter(0.95, 0.99, default=0.985, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_rsi_1h = DecimalParameter(60, 80, default=72.8, space='buy', decimals=1, optimize=buy_condition_12_optimize, load=True)\n\n    buy_condition_11_optimize=False\n    buy_condition_11_bb_middleband = DecimalParameter(1.001, 1.02, default=1.005, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_rsi = DecimalParameter(60, 76, default=68, space='buy', decimals=2, optimize=buy_condition_11_optimize, load=True)\n\n    buy_condition_0_optimize=False\n    buy_condition_0_rsi = DecimalParameter(26, 34, default=30, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_close = DecimalParameter(1, 1.2, default=1.024, space='buy', decimals=3, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_rsi_1h = DecimalParameter(66, 76, default=71, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    \n    buy_condition_1_rsi_1h = DecimalParameter(63, 75, default=69, space='buy', decimals=1, optimize=False, load=True)\n    \n    buy_condition_10_optimize=False\n    buy_condition_10_rsi = DecimalParameter(35, 45, default=40.5, space='buy', decimals=1, optimize=buy_condition_10_optimize, load=True)\n    buy_condition_10_hist_close = DecimalParameter(0.0001, 0.01, default=0.0012, space='buy', decimals=4, optimize=buy_condition_10_optimize, load=True)\n\n    custom_stoploss_optimize_1=False\n    custom_stoploss_optimize_2=False\n    custom_stoploss_minutes = IntParameter(50, 200, default=50, space='sell', optimize=\n        custom_stoploss_optimize_2, load=True)\n    custom_stoploss_rsi_1h = DecimalParameter(20, 50, default=30, space='sell', decimals=1, optimize=custom_stoploss_optimize_2, load=True)\n    custom_stoploss_current_rates_1 = DecimalParameter(1.001, 1.1, default=1.025, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    custom_stoploss_current_rates_2 = DecimalParameter(1.001, 1.1, default=1.015, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    \n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_optimize=False\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n\n    sell_custom_stoploss_2_optimize=False\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=sell_custom_stoploss_2_optimize, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=sell_custom_stoploss_2_optimize, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=int(self.custom_stoploss_minutes.value))\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < self.custom_stoploss_rsi_1h.value:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * self.custom_stoploss_current_rates_1.value < candle['open']:\n                            return 0.015 \n\n                    if current_rate * self.custom_stoploss_current_rates_2.value < candle['open']:\n                        return 0.015\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.5\n\n        return 0.99\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (    \n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_close.value) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_low.value) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < self.buy_condition_12_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (    \n                self.buy_condition_11_enable.value &\n\n                ((dataframe['high'] - dataframe['low']) < dataframe['open']/100) &\n                (dataframe['open'] < dataframe['close']) &\n                ((dataframe['high'].shift() - dataframe['low'].shift()) < dataframe['open'].shift()/100) &\n                ((dataframe['high'].shift(2) - dataframe['low'].shift(2)) < dataframe['open'].shift(2)/100) &\n                ((dataframe['high'].shift(3) - dataframe['low'].shift(3)) < dataframe['open'].shift(3)/100) &\n                ((dataframe['high'].shift(4) - dataframe['low'].shift(4)) < dataframe['open'].shift(4)/100) &\n                ((dataframe['high'].shift(5) - dataframe['low'].shift(5)) < dataframe['open'].shift(5)/100) &\n                ((dataframe['high'].shift(6) - dataframe['low'].shift(6)) < dataframe['open'].shift(6)/100) &\n                ((dataframe['high'].shift(7) - dataframe['low'].shift(7)) < dataframe['open'].shift(7)/100) &\n                ((dataframe['high'].shift(8) - dataframe['low'].shift(8)) < dataframe['open'].shift(8)/100) &\n                ((dataframe['high'].shift(9) - dataframe['low'].shift(9)) < dataframe['open'].shift(9)/100) &\n                (dataframe['bb_middleband'] > dataframe['bb_middleband'].shift(9) * self.buy_condition_11_bb_middleband.value) &\n                (dataframe['rsi'] < self.buy_condition_11_rsi.value) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (    \n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < self.buy_condition_0_rsi.value) &\n                (dataframe['close'] * self.buy_condition_0_close.value < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < self.buy_condition_0_rsi_1h.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (    \n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < self.buy_condition_1_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (   \n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/BigZ03HO/BigZ03HO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\n\n\n###########################################################################################################\n##                                  BigZ03 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ03HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_bb20_close_bblowerband_safe_1\": 0.957,\n        \"buy_bb20_close_bblowerband_safe_2\": 0.766,\n        \"buy_volume_drop_1\": 4.0,\n        \"buy_volume_pump_1\": 0.1,\n        \"buy_volume_drop_2\": 1.3,\n        \"buy_volume_drop_3\": 1.4,\n        \"buy_rsi_1h_1\": 38.2,\n        \"buy_rsi_1h_2\": 36.4,\n        \"buy_rsi_1h_3\": 19.1,\n        \"buy_rsi_1h_4\": 37.2,\n        \"buy_rsi_1h_5\": 51.0,\n        \"buy_macd_1\": 0.01,\n        \"buy_macd_2\": 0.01,\n        \"buy_rsi_1\": 16.0,\n        \"buy_rsi_2\": 14.8,\n        \"buy_rsi_3\": 10.8,\n        \"buy_rsi_1h_1\": 39.8,\n        \"buy_rsi_1h_2\": 37.9,\n        \"buy_rsi_1h_3\": 38.2,\n        \"buy_rsi_1h_4\": 38.1,\n        \"buy_rsi_1h_5\": 58.9,\n        \"buy_macd_1\": 0.07,\n        \"buy_macd_2\": 0.02,\n    }\n\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 35:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.025 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.5\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (    \n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (    \n                self.buy_condition_11_enable.value &\n\n                ((dataframe['high'] - dataframe['low']) < dataframe['open']/100) &\n                (dataframe['open'] < dataframe['close']) &\n                ((dataframe['high'].shift() - dataframe['low'].shift()) < dataframe['open'].shift()/100) &\n                ((dataframe['high'].shift(2) - dataframe['low'].shift(2)) < dataframe['open'].shift(2)/100) &\n                ((dataframe['high'].shift(3) - dataframe['low'].shift(3)) < dataframe['open'].shift(3)/100) &\n                ((dataframe['high'].shift(4) - dataframe['low'].shift(4)) < dataframe['open'].shift(4)/100) &\n                ((dataframe['high'].shift(5) - dataframe['low'].shift(5)) < dataframe['open'].shift(5)/100) &\n                ((dataframe['high'].shift(6) - dataframe['low'].shift(6)) < dataframe['open'].shift(6)/100) &\n                ((dataframe['high'].shift(7) - dataframe['low'].shift(7)) < dataframe['open'].shift(7)/100) &\n                ((dataframe['high'].shift(8) - dataframe['low'].shift(8)) < dataframe['open'].shift(8)/100) &\n                ((dataframe['high'].shift(9) - dataframe['low'].shift(9)) < dataframe['open'].shift(9)/100) &\n                (dataframe['bb_middleband'] > dataframe['bb_middleband'].shift(9) * 1.005) &\n                (dataframe['rsi'] < 68) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (    \n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (    \n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (   \n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/BigZ04/BigZ04.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n###########################################################################################################\n##                                  BigZ04 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ04(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": False,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        return False\n\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 30:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.025 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe"
  },
  {
    "path": "strategies/BigZ0407/BigZ0407.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                                  BigZ04 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ0407(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.1,         # I feel lucky!\n        \"10\": 0.05,\n        \"40\": 0.02,\n        \"180\": 0.1,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_optimize=False\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=buy_bb20_optimize, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=buy_bb20_optimize, load=True)\n\n    buy_volume_pump_optimize=False\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n\n    buy_rsi_1h_optimize=False\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n\n    buy_rsi_optimize=False\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n\n    buy_macd_optimize=False\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n\n    buy_condition_12_optimize=False\n    buy_condition_12_bblower_close = DecimalParameter(0.95, 0.995, default=0.993, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_bblower_low = DecimalParameter(0.95, 0.99, default=0.985, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_rsi_1h = DecimalParameter(60, 80, default=72.8, space='buy', decimals=1, optimize=buy_condition_12_optimize, load=True)\n\n    buy_condition_11_optimize=False\n    buy_condition_11_close_1 = DecimalParameter(0.05, 0.15, default=0.1, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_close_2 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_rsi = DecimalParameter(49, 53, default=51, space='buy', decimals=2, optimize=buy_condition_11_optimize, load=True)\n\n    buy_condition_0_optimize=False\n    buy_condition_0_rsi = DecimalParameter(26, 34, default=30, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_close = DecimalParameter(1, 1.2, default=1.024, space='buy', decimals=3, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_rsi_1h = DecimalParameter(66, 76, default=71, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    \n    buy_condition_1_optimize=False\n    buy_condition_1_rsi_1h = DecimalParameter(63, 75, default=69, space='buy', decimals=1, optimize=buy_condition_1_optimize, load=True)\n    \n    buy_condition_10_optimize=False\n    buy_condition_10_rsi = DecimalParameter(35, 45, default=40.5, space='buy', decimals=1, optimize=buy_condition_10_optimize, load=True)\n    buy_condition_10_hist_close = DecimalParameter(0.0001, 0.01, default=0.0012, space='buy', decimals=4, optimize=buy_condition_10_optimize, load=True)\n\n    custom_stoploss_optimize_1=True\n    custom_stoploss_minutes = IntParameter(50, 200, default=50, space='sell', optimize=\n        False, load=True)\n    custom_stoploss_rsi_1h = DecimalParameter(20, 50, default=30, space='sell', decimals=1, optimize=False, load=True)\n    custom_stoploss_current_rates_1 = DecimalParameter(1.001, 1.1, default=1.025, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    custom_stoploss_current_rates_2 = DecimalParameter(1.001, 1.1, default=1.015, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    \n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n    \n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n        return True\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=int(self.custom_stoploss_minutes.value))\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < self.custom_stoploss_rsi_1h.value:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * self.custom_stoploss_current_rates_1.value < candle['open']:\n                            return 0.01 \n\n                    if current_rate * self.custom_stoploss_current_rates_2.value < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_close.value) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_low.value) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < self.buy_condition_12_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*self.buy_condition_11_close_1.value)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * self.buy_condition_11_close_2.value)) &\n                (dataframe['rsi'] > self.buy_condition_11_rsi.value) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < self.buy_condition_0_rsi.value) &\n                (dataframe['close'] * self.buy_condition_0_close.value < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < self.buy_condition_0_rsi_1h.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < self.buy_condition_1_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < self.buy_condition_10_rsi.value) &\n                (dataframe['hist'] > dataframe['close'] * self.buy_condition_10_hist_close.value) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/BigZ0407HO/BigZ0407HO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                                  BigZ04 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ0407HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.1,         # I feel lucky!\n        \"10\": 0.05,\n        \"40\": 0.02,\n        \"180\": 0.1,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_bb20_close_bblowerband_safe_1\": 0.931,\n        \"buy_bb20_close_bblowerband_safe_2\": 0.978,\n        \"buy_volume_drop_1\": 6.0,\n        \"buy_volume_drop_2\": 9.5,\n        \"buy_volume_drop_3\": 1.0,\n        \"buy_volume_pump_1\": 0.4,\n        \"buy_rsi_1h_1\": 16.0,\n        \"buy_rsi_1h_2\": 15.4,\n        \"buy_rsi_1h_3\": 19.1,\n        \"buy_rsi_1h_4\": 29.1,\n        \"buy_rsi_1h_5\": 59.1,\n        \"buy_rsi_1\": 27.5,\n        \"buy_rsi_2\": 14.8,\n        \"buy_rsi_3\": 13.7,\n        \"buy_macd_1\": 0.08,\n        \"buy_macd_2\": 0.03,\n        \"buy_condition_12_bblower_close\": 0.989,\n        \"buy_condition_12_bblower_low\": 0.988,\n        \"buy_condition_12_rsi_1h\": 78.4,\n        \"buy_condition_11_close_1\": 0.143,\n        \"buy_condition_11_close_2\": 0.018,\n        \"buy_condition_11_rsi\": 50.27,\n        \"buy_condition_0_close\": 1.046,\n        \"buy_condition_0_rsi\": 31.7,\n        \"buy_condition_0_rsi_1h\": 66.2,\n        \"buy_condition_10_hist_close\": 0.0009,\n        \"buy_condition_10_rsi\": 40.0,\n        \"buy_condition_1_rsi_1h\": 73.1,\n    }\n\n    sell_params = {\n        \"custom_stoploss_minutes\": 75,\n        \"custom_stoploss_rsi_1h\": 36.0,\n        \"custom_stoploss_current_rates_1\": 1.032,\n        \"custom_stoploss_current_rates_2\": 1.014,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_optimize=False\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=buy_bb20_optimize, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=buy_bb20_optimize, load=True)\n\n    buy_volume_pump_optimize=False\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n\n    buy_rsi_1h_optimize_1=False\n    buy_rsi_1h_optimize_2=False\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_2, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_2, load=True)\n\n    buy_rsi_optimize=False\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n\n    buy_macd_optimize=False\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n\n    buy_condition_12_optimize=False\n    buy_condition_12_bblower_close = DecimalParameter(0.95, 0.995, default=0.993, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_bblower_low = DecimalParameter(0.95, 0.99, default=0.985, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_rsi_1h = DecimalParameter(60, 80, default=72.8, space='buy', decimals=1, optimize=buy_condition_12_optimize, load=True)\n\n    buy_condition_11_optimize=False\n    buy_condition_11_close_1 = DecimalParameter(0.05, 0.15, default=0.1, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_close_2 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_rsi = DecimalParameter(49, 53, default=51, space='buy', decimals=2, optimize=buy_condition_11_optimize, load=True)\n\n    buy_condition_0_optimize=False\n    buy_condition_0_rsi = DecimalParameter(26, 34, default=30, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_close = DecimalParameter(1, 1.2, default=1.024, space='buy', decimals=3, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_rsi_1h = DecimalParameter(66, 76, default=71, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    \n    buy_condition_1_rsi_1h = DecimalParameter(63, 75, default=69, space='buy', decimals=1, optimize=False, load=True)\n    \n    buy_condition_10_optimize=False\n    buy_condition_10_rsi = DecimalParameter(35, 45, default=40.5, space='buy', decimals=1, optimize=buy_condition_10_optimize, load=True)\n    buy_condition_10_hist_close = DecimalParameter(0.0001, 0.01, default=0.0012, space='buy', decimals=4, optimize=buy_condition_10_optimize, load=True)\n\n    custom_stoploss_optimize_1=False\n    custom_stoploss_optimize_2=False\n    custom_stoploss_minutes = IntParameter(50, 200, default=50, space='sell', optimize=\n        custom_stoploss_optimize_2, load=True)\n    custom_stoploss_rsi_1h = DecimalParameter(20, 50, default=30, space='sell', decimals=1, optimize=custom_stoploss_optimize_2, load=True)\n    custom_stoploss_current_rates_1 = DecimalParameter(1.001, 1.1, default=1.025, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    custom_stoploss_current_rates_2 = DecimalParameter(1.001, 1.1, default=1.015, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    \n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_optimize=False\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=sell_custom_stoploss_long_optimize, load=True)\n\n    sell_custom_stoploss_2_optimize=False\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=sell_custom_stoploss_2_optimize, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=sell_custom_stoploss_2_optimize, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n    \n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n        return True\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=int(self.custom_stoploss_minutes.value))\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < self.custom_stoploss_rsi_1h.value:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * self.custom_stoploss_current_rates_1.value < candle['open']:\n                            return 0.01 \n\n                    if current_rate * self.custom_stoploss_current_rates_2.value < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_close.value) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_low.value) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < self.buy_condition_12_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*self.buy_condition_11_close_1.value)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * self.buy_condition_11_close_2.value)) &\n                (dataframe['rsi'] > self.buy_condition_11_rsi.value) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < self.buy_condition_0_rsi.value) &\n                (dataframe['close'] * self.buy_condition_0_close.value < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < self.buy_condition_0_rsi_1h.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < self.buy_condition_1_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < self.buy_condition_10_rsi.value) &\n                (dataframe['hist'] > dataframe['close'] * self.buy_condition_10_hist_close.value) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/BigZ04HO/BigZ04HO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n###########################################################################################################\n##                                  BigZ04 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ04HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_bb20_close_bblowerband_safe_1\": 0.951,\n        \"buy_bb20_close_bblowerband_safe_2\": 0.981,\n        \"buy_volume_drop_1\": 8.3,\n        \"buy_volume_pump_1\": 0.4,\n        \"buy_volume_drop_3\": 4.1,\n        \"buy_rsi_1h_1\": 20.3,\n        \"buy_rsi_1h_2\": 17.6,\n        \"buy_rsi_1h_3\": 21.4,\n        \"buy_rsi_1h_4\": 36.2,\n        \"buy_rsi_1h_5\": 35.7,\n        \"buy_macd_1\": 0.01,\n        \"buy_macd_2\": 0.03,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_optimize=False\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n\n    buy_rsi_1h_optimize_1=False\n    buy_rsi_1h_optimize_2=False\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_1, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_2, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize_2, load=True)\n\n    buy_rsi_optimize=False\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n\n    buy_macd_optimize=False\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        return False\n\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 30:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.025 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe"
  },
  {
    "path": "strategies/BigZ04HO2/BigZ04HO2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n###########################################################################################################\n##                                  BigZ04 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ04HO2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_bb20_close_bblowerband_safe_1\": 0.951,\n        \"buy_bb20_close_bblowerband_safe_2\": 0.743,\n        \"buy_volume_drop_1\": 10.0,\n        \"buy_volume_drop_2\": 9.7,\n        \"buy_volume_drop_3\": 4.1,\n        \"buy_volume_pump_1\": 0.1,\n        \"buy_rsi_1h_1\": 20.3,\n        \"buy_rsi_1h_2\": 17.6,\n        \"buy_rsi_1h_3\": 21.4,\n        \"buy_rsi_1h_4\": 36.2,\n        \"buy_rsi_1h_5\": 35.7,\n        \"buy_macd_1\": 0.01,\n        \"buy_macd_2\": 0.03,\n        \"buy_condition_0_close\": 1.044,\n        \"buy_condition_0_rsi\": 34,\n        \"buy_condition_0_rsi_1h\": 73,\n        \"buy_condition_11_close_1\": 0.115,\n        \"buy_condition_11_close_2\": 0.015,\n        \"buy_condition_11_rsi\": 49.19,\n        \"buy_condition_12_bblower_close\": 0.994,\n        \"buy_condition_12_bblower_low\": 0.983,\n        \"buy_condition_12_rsi_1h\": 72.5,\n    }\n\n    sell_params = {\n        \"custom_stoploss_minutes\": 145,\n        \"custom_stoploss_current_rates_1\": 1.056,\n        \"custom_stoploss_current_rates_2\": 1.0,\n        \"custom_stoploss_rsi_1h\": 30,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_optimize=False\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=buy_bb20_optimize, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=buy_bb20_optimize, load=True)\n\n    buy_volume_pump_optimize=False\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=buy_volume_pump_optimize, load=True)\n\n    buy_rsi_1h_optimize=False\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=buy_rsi_1h_optimize, load=True)\n\n    buy_rsi_optimize=False\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=buy_rsi_optimize, load=True)\n\n    buy_macd_optimize=False\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=buy_macd_optimize, load=True)\n\n    buy_condition_12_optimize=False\n    buy_condition_12_bblower_close = DecimalParameter(0.95, 0.995, default=0.993, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_bblower_low = DecimalParameter(0.95, 0.99, default=0.985, space='buy', decimals=3, optimize=buy_condition_12_optimize, load=True)\n    buy_condition_12_rsi_1h = DecimalParameter(60, 80, default=72.8, space='buy', decimals=1, optimize=buy_condition_12_optimize, load=True)\n\n    buy_condition_11_optimize=False\n    buy_condition_11_close_1 = DecimalParameter(0.05, 0.15, default=0.1, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_close_2 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=buy_condition_11_optimize, load=True)\n    buy_condition_11_rsi = DecimalParameter(49, 53, default=51, space='buy', decimals=2, optimize=buy_condition_11_optimize, load=True)\n\n    buy_condition_0_optimize=False\n    buy_condition_0_rsi = DecimalParameter(26, 34, default=30, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_close = DecimalParameter(1, 1.2, default=1.024, space='buy', decimals=3, optimize=buy_condition_0_optimize, load=True)\n    buy_condition_0_rsi_1h = DecimalParameter(66, 76, default=71, space='buy', decimals=1, optimize=buy_condition_0_optimize, load=True)\n    \n    buy_condition_1_optimize=False\n    buy_condition_1_rsi_1h = DecimalParameter(63, 75, default=69, space='buy', decimals=1, optimize=buy_condition_1_optimize, load=True)\n    \n    buy_condition_10_optimize=False\n    buy_condition_10_rsi = DecimalParameter(35, 45, default=40.5, space='buy', decimals=1, optimize=buy_condition_10_optimize, load=True)\n    buy_condition_10_hist_close = DecimalParameter(0.0001, 0.01, default=0.0012, space='buy', decimals=4, optimize=buy_condition_10_optimize, load=True)\n\n    custom_stoploss_optimize_1=True\n    custom_stoploss_minutes = IntParameter(50, 400, default=50, space='sell', optimize=\n        False, load=True)\n    custom_stoploss_rsi_1h = DecimalParameter(20, 50, default=30, space='sell', decimals=1, optimize=False, load=True)\n    custom_stoploss_current_rates_1 = DecimalParameter(1.001, 1.1, default=1.025, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    custom_stoploss_current_rates_2 = DecimalParameter(1.001, 1.1, default=1.015, space='sell', decimals=3, optimize=custom_stoploss_optimize_1, load=True)\n    \n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n        return True\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        return False\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=int(self.custom_stoploss_minutes.value))\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < self.custom_stoploss_rsi_1h.value:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * self.custom_stoploss_current_rates_1.value < candle['open']:\n                            return 0.01 \n\n                    if current_rate * self.custom_stoploss_current_rates_2.value < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_close.value) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * self.buy_condition_12_bblower_low.value) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < self.buy_condition_12_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*self.buy_condition_11_close_1.value)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * self.buy_condition_11_close_2.value)) &\n                (dataframe['rsi'] > self.buy_condition_11_rsi.value) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < self.buy_condition_0_rsi.value) &\n                (dataframe['close'] * self.buy_condition_0_close.value < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < self.buy_condition_0_rsi_1h.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < self.buy_condition_1_rsi_1h.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < self.buy_condition_10_rsi.value) &\n                (dataframe['hist'] > dataframe['close'] * self.buy_condition_10_hist_close.value) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe"
  },
  {
    "path": "strategies/BigZ04_TSL3/BigZ04_TSL3.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\n\n\n###########################################################################################################\n##                   BigZ04_TSL3 by Perkmeister, based on BigZ04 by ilya                                 ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n##    This is a modified version of BigZ04 that uses custom_stoploss() to implement a hard stoploss      ##\n##    of 8%, and to replace the roi table with a trailing stoploss to extract more profit when prices    ##\n##    start to rise above a profit threshold. It's quite simple and crude and is a 'first stab' at the   ##\n##    hard stoploss problem, use live at your own risk ;). The sell signals from SMAOffsetProtectOptV1   ##\n##    have been added but are currently disabled as had no benefit.                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  hard stoploss function preventing from big fall                                             ##\n##        -  trailing stoploss while in profit                                                           ##\n##        -  no sell signal. Uses custom stoploss                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist it is recommended to use a static pairlst such as iterativ's orginal:                 ##\n##   https://discord.com/channels/700048804539400213/702584639063064586/838038600368783411               ## \n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ04_TSL3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 100.0\n    }\n    \n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": False,\n    }\n\n    \n    # V1 original\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 49,\n        \"high_offset\": 1.006,\n        \"pHSL\": -0.08,\n        \"pPF_1\": 0.016,\n        \"pSL_1\": 0.011,\n        \"pPF_2\": 0.080,\n        \"pSL_2\": 0.040,\n    }\n    \n    \n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    # hyperopt parameters for custom_stoploss()\n    trade_time = IntParameter(25, 65, default=35, space='sell', optimize=False, load=True)\n    rsi_1h_val = IntParameter(25, 45, default=32, space='sell', optimize=False, load=True)\n    narrow_stop = DecimalParameter(1.005, 1.030, default=1.020, space='sell', decimals=3, optimize=False, load=True)\n    wide_stop = DecimalParameter(1.010, 1.045, default=1.035, space='sell', decimals=3, optimize=False, load=True)\n\n    # hyperopt parameters for SMAOffsetProtectOptV1 sell signal\n    base_nb_candles_sell = IntParameter(5, 80, default=49, space='sell', optimize=False, load=True)\n    high_offset = DecimalParameter(0.99, 1.1, default=1.006, space='sell', optimize=False, load=True)\n\n    # trailing stoploss hyperopt parameters\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', optimize=False, load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', optimize=False, load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', optimize=False, load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', optimize=False, load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', optimize=False, load=True)\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        return False\n\n\n    # new custom stoploss, both hard and trailing functions. Trailing stoploss first rises at a slower\n    # rate than the current rate until a profit threshold is reached, after which it rises at a constant\n    # percentage as per a normal trailing stoploss. This allows more margin for pull-backs during a rise.\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value \n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1)*(SL_2 - SL_1)/(PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        if (current_profit > PF_1):\n            return stoploss_from_open(sl_profit, current_profit)\n        else:\n            return stoploss_from_open(HSL, current_profit)\n        return stoploss_from_open(HSL, current_profit)\n        \n        \n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # ------ ATR stuff\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        \"\"\"\n        \n        conditions = []\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=0\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BigZ04_TSL4/BigZ04_TSL4.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\n\n\n###########################################################################################################\n##                   BigZ04_TSL4 by Perkmeister, based on BigZ04 by ilya                                 ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n##    This is a modified version of BigZ04 that uses custom_stoploss() to implement a hard stoploss      ##\n##    of 8%, and to replace the roi table with a trailing stoploss to extract more profit when prices    ##\n##    start to rise above a profit threshold. It's quite simple and crude and is a 'first stab' at the   ##\n##    hard stoploss problem, use live at your own risk ;). The sell signals from SMAOffsetProtectOptV1   ##\n##    have been added but are currently disabled as had no benefit.                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  11 buy signals                                                                              ##\n##        -  hard stoploss function preventing from big fall                                             ##\n##        -  trailing stoploss while in profit                                                           ##\n##        -  no sell signal. Uses custom stoploss                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##                                                                                                       ##\n##   As a pairlist it is recommended to use a static pairlst such as iterativ's orginal:                 ##\n##   https://discord.com/channels/700048804539400213/702584639063064586/838038600368783411               ## \n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass BigZ04_TSL4(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 100.0\n    }\n    \n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": False,\n    }\n\n    \n    # V1 original\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 49,\n        \"high_offset\": 1.006,\n        \"pHSL\": -0.08,\n        \"pPF_1\": 0.016,\n        \"pSL_1\": 0.011,\n        \"pPF_2\": 0.080,\n        \"pSL_2\": 0.040,\n    }\n    \n    \n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.950, 1.050, default=0.989, decimals=3, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.700, 1.100, default=0.982, decimals=2, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_0 = DecimalParameter(55.0, 85.0, default=71.0, space='buy', decimals=1, optimize=False, load=True)    \n    buy_rsi_1h_1a = DecimalParameter(65.0, 78.0, default=69.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_0 = DecimalParameter(10.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_dip_0 = DecimalParameter(1.015, 1.040, default=1.024, space='buy', decimals=3, optimize=False, load=True)\n\n\n    # hyperopt parameters for custom_stoploss()\n    trade_time = IntParameter(25, 65, default=35, space='sell', optimize=False, load=True)\n    rsi_1h_val = IntParameter(25, 45, default=32, space='sell', optimize=False, load=True)\n    narrow_stop = DecimalParameter(1.005, 1.030, default=1.020, space='sell', decimals=3, optimize=False, load=True)\n    wide_stop = DecimalParameter(1.010, 1.045, default=1.035, space='sell', decimals=3, optimize=False, load=True)\n\n    # hyperopt parameters for SMAOffsetProtectOptV1 sell signal\n    base_nb_candles_sell = IntParameter(5, 80, default=49, space='sell', optimize=False, load=True)\n    high_offset = DecimalParameter(0.99, 1.1, default=1.006, space='sell', optimize=False, load=True)\n\n    # trailing stoploss hyperopt parameters\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', optimize=False, load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', optimize=False, load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', optimize=False, load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', optimize=False, load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', optimize=False, load=True)\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        return False\n\n\n    # new custom stoploss, both hard and trailing functions. Trailing stoploss first rises at a slower\n    # rate than the current rate until a profit threshold is reached, after which it rises at a constant\n    # percentage as per a normal trailing stoploss. This allows more margin for pull-backs during a rise.\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value \n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1)*(SL_2 - SL_1)/(PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n        \n        return stoploss_from_open(sl_profit, current_profit)\n    \n        \n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.SMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # ------ ATR stuff\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < self.buy_rsi_0.value) &\n\n                ((dataframe['close'] * self.buy_dip_0.value < dataframe['open'].shift(3)) | \n                (dataframe['close'] * self.buy_dip_0.value< dataframe['open'].shift(2)) |\n                (dataframe['close'] * self.buy_dip_0.value < dataframe['open'].shift(1))) &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_0.value) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1a.value) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BigZ06/BigZ06.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n###########################################################################################################\n##                                  BigZ06 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  14 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 3 and 5 open trades.                              ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n##    BigZ06 using market orders.                                                                        ##\n##    Ensure you're familar with https://www.freqtrade.io/en/stable/configuration/#market-order-pricing  ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ06(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        return False\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_2 = dataframe.iloc[-2].squeeze()\n\n        if (last_candle is not None):\n            if (last_candle['high'] > last_candle['bb_upperband']) & (last_candle['volume'] > (last_candle_2['volume'] * 1.5)):\n                return 'sell_signal_1'\n\n        return False\n\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 40:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.035 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.025 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chaikin A/D Oscillator\n        dataframe['mfv'] = MFV(dataframe)\n        dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['cmf'] < -0.435) &\n                (dataframe['rsi'] < 22) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe\n\n# Chaikin Money Flow Volume\ndef MFV(dataframe):\n    df = dataframe.copy()\n    N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    M = N * df['volume']\n    return M\n"
  },
  {
    "path": "strategies/BigZ07/BigZ07.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n###########################################################################################################\n##                                  BigZ07 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  14 buy signals                                                                              ##\n##        -  stoploss function preventing from big fall                                                  ##\n##        -  no sell signal. Whether ROI or stoploss =)                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 3 and 5 open trades.                              ##\n##                                                                                                       ##\n##   As a pairlist you can use VolumePairlist.                                                           ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n##    BigZ06 using market orders.                                                                        ##\n##    Ensure you're familar with https://www.freqtrade.io/en/stable/configuration/#market-order-pricing  ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ07(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n\n        return True\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_1 = dataframe.iloc[-2].squeeze()\n\n        if (sell_reason == 'roi'):\n            # Looks like we can get a little have more\n            if (last_candle['cmf'] < -0.1) & (last_candle['close'] > last_candle['ema_200_1h']):\n                return False\n\n        return True\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        return False\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_2 = dataframe.iloc[-2].squeeze()\n\n        if (last_candle is not None):\n            if (last_candle['high'] > last_candle['bb_upperband']) & (last_candle['volume'] > (last_candle_2['volume'] * 1.5)):\n                return 'sell_signal_1'\n\n        return False\n\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (current_time > trade_time_50):\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 40:\n                        return 0.99\n \n                    if candle['open_1h'] > candle['ema_200_1h']:\n                            return 0.1\n\n                    # Are we still sinking?\n                    if current_rate * 1.025 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chaikin A/D Oscillator\n        dataframe['mfv'] = MFV(dataframe)\n        dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['cmf'] < -0.435) &\n                (dataframe['rsi'] < 22) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 0\n        return dataframe\n\n# Chaikin Money Flow Volume\ndef MFV(dataframe):\n    df = dataframe.copy()\n    N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    M = N * df['volume']\n    return M\n"
  },
  {
    "path": "strategies/BigZ07Next/BigZ07Next.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ07Next(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n    res_timeframe = '30m'\n    info_timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n\n        return True\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_1 = dataframe.iloc[-2].squeeze()\n\n        if (sell_reason == 'roi'):\n            # Looks like we can get a little have more\n            if (last_candle['cmf'] < -0.1) & (last_candle['close'] > last_candle['ema_200_1h']):\n                return False\n\n        return True\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n            elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_t_4'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_24_1_1h']) & (0.1 > current_profit > 0.07) & (last_candle['rsi'] < 56.0) & (current_time - timedelta(minutes=20) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['lower'] = bb_40_std2['lower']\n        dataframe['mid'] = bb_40_std2['mid']\n        dataframe['bbdelta'] = (bb_40_std2['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bb_20_std2['lower']\n        dataframe['bb_middleband'] = bb_20_std2['mid']\n        dataframe['bb_upperband'] = bb_20_std2['upper']\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # Chaikin A/D Oscillator\n        dataframe['mfv'] = MFV(dataframe)\n        dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Volume\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n        btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n        btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        # populate informative indicators\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        # Merge informative into dataframe\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        # resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n        # resampled = self.resampled_tf_indicators(resampled, metadata)\n        # # Merge resampled info dataframe\n        # dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n        # dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n        # dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n        # drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n        # dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['cmf'] < -0.435) &\n                (dataframe['rsi'] < 22) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Chaikin Money Flow Volume\ndef MFV(dataframe):\n    df = dataframe.copy()\n    N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    M = N * df['volume']\n    return M"
  },
  {
    "path": "strategies/BigZ07Next2/BigZ07Next2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass BigZ07Next2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.01,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n    res_timeframe = '30m'\n    info_timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n\n\n        return True\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        last_candle_1 = dataframe.iloc[-2].squeeze()\n\n        if (sell_reason == 'roi'):\n            # Looks like we can get a little have more\n            if (last_candle['cmf'] < -0.1) & (last_candle['close'] > last_candle['ema_200_1h']):\n                return False\n\n        return True\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n            elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_t_4'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_24_1_1h']) & (0.1 > current_profit > 0.07) & (last_candle['rsi'] < 56.0) & (current_time - timedelta(minutes=20) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['lower'] = bb_40_std2['lower']\n        dataframe['mid'] = bb_40_std2['mid']\n        dataframe['bbdelta'] = (bb_40_std2['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bb_20_std2['lower']\n        dataframe['bb_middleband'] = bb_20_std2['mid']\n        dataframe['bb_upperband'] = bb_20_std2['upper']\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # Chaikin A/D Oscillator\n        dataframe['mfv'] = MFV(dataframe)\n        dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Volume\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n        btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n        btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        # populate informative indicators\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        # Merge informative into dataframe\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        # resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n        # resampled = self.resampled_tf_indicators(resampled, metadata)\n        # # Merge resampled info dataframe\n        # dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n        # dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n        # dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n        # drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n        # dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['cmf'] < -0.435) &\n                (dataframe['rsi'] < 22) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift() > 0) &\n                (dataframe['hist'].shift(2) > 0) &\n                (dataframe['hist'].shift(3) > 0) &\n                (dataframe['hist'].shift(5) > 0) &\n\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &\n                (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &\n                ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &\n                ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &\n                (dataframe['rsi'] > 51) &\n\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift() > dataframe['close'].shift()) &\n\n                (dataframe['close'] > dataframe['bb_middleband']) &\n                (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &\n                (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_0_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        conditions.append(\n            (\n\n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n\n                self.buy_condition_10_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &\n\n                (dataframe['hist'] > 0) &\n                (dataframe['hist'].shift(2) < 0) &\n                (dataframe['rsi'] < 40.5) &\n                (dataframe['hist'] > dataframe['close'] * 0.0012) &\n                (dataframe['open'] < dataframe['close']) &\n                \n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Chaikin Money Flow Volume\ndef MFV(dataframe):\n    df = dataframe.copy()\n    N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    M = N * df['volume']\n    return M"
  },
  {
    "path": "strategies/BinClucMad/BinClucMad.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN))\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\nclass BinClucMad(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.038,         # I feel lucky!\n        \"10\": 0.028,\n        \"40\": 0.015,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99  # effectively disabled.\n\n    timeframe = \"5m\"\n    informative_timeframe = \"1h\"\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001  # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        \"buy\": \"market\",\n        \"sell\": \"market\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": False,\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": True,\n        \"v9_buy_condition_2_enable\": True,\n        \"v9_buy_condition_3_enable\": True,\n        \"v9_buy_condition_4_enable\": True,\n        \"v9_buy_condition_5_enable\": True,\n        \"v9_buy_condition_6_enable\": True,\n        \"v9_buy_condition_7_enable\": True,\n        \"v9_buy_condition_8_enable\": True,\n        \"v9_buy_condition_9_enable\": True,\n        \"v9_buy_condition_10_enable\": True,\n        \"v6_buy_condition_0_enable\": True,\n        \"v6_buy_condition_1_enable\": True,\n        \"v6_buy_condition_2_enable\": True,\n        \"v6_buy_condition_3_enable\": True,\n        \"v6_buy_condition_4_enable\": True,\n    }\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"v9_sell_condition_0_enable\": False,\n        \"v8_sell_condition_1_enable\": True,\n        \"v8_sell_condition_2_enable\": False,\n    }\n    ############################################################################\n\n    # Buy  CombinedBinHClucAndMADV9\n    v9_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_4_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_5_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_6_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_7_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_8_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_9_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_10_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_4_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    # Sell\n    v9_sell_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n    v8_sell_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n    v8_sell_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.99, space=\"buy\", optimize=True, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space=\"buy\", optimize=True, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space=\"buy\", decimals=1, optimize=True, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=4, space=\"buy\", decimals=1, optimize=True, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space=\"buy\", decimals=1, optimize=True, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space=\"buy\", decimals=1, optimize=True, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space=\"buy\", decimals=1, optimize=True, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space=\"buy\", decimals=1, optimize=True, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space=\"buy\", decimals=1, optimize=True, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space=\"buy\", decimals=1, optimize=True, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space=\"buy\", decimals=1, optimize=True, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space=\"buy\", decimals=2, optimize=True, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space=\"buy\", decimals=2, optimize=True, load=True)\n\n    v8_sell_rsi_main = DecimalParameter(72.0, 90.0, default=80, space=\"sell\", decimals=2, optimize=True, load=True)\n\n    def custom_stoploss(\n        self, pair: str, trade: \"Trade\", current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if current_profit > 0:\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n            # trade_time_240 = trade.open_date_utc + timedelta(minutes=240)\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if current_time > trade_time_50:\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle[\"rsi_1h\"] < 30:\n                        return 0.99\n\n                    # Are we still sinking?\n                    if candle[\"close\"] > candle[\"ema_200\"]:\n                        if current_rate * 1.025 < candle[\"open\"]:\n                            return 0.01\n\n                    if current_rate * 1.015 < candle[\"open\"]:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata[\"pair\"], timeframe=self.informative_timeframe)\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h[\"ema_200\"] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h[\"rsi\"] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h[\"ssl_down\"] = ssl_down_1h\n        informative_1h[\"ssl_up\"] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n        dataframe[\"volume_mean_slow\"] = dataframe[\"volume\"].rolling(window=30).mean()\n\n        # EMA\n        dataframe[\"ema_200\"] = ta.EMA(dataframe, timeperiod=200)\n        dataframe[\"ema_50\"] = ta.EMA(dataframe, timeperiod=50)\n\n        dataframe[\"ema_26\"] = ta.EMA(dataframe, timeperiod=26)\n        dataframe[\"ema_12\"] = ta.EMA(dataframe, timeperiod=12)\n\n        # SMA\n        dataframe[\"sma_5\"] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # START  VERSION9\n        if self.v9_buy_condition_1_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"] * self.buy_bb20_close_bblowerband_safe_1.value)\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"open\"] - dataframe[\"close\"]\n                        < dataframe[\"bb_upperband\"].shift(2) - dataframe[\"bb_lowerband\"].shift(2)\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_2_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"] * self.buy_bb20_close_bblowerband_safe_2.value)\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"open\"] - dataframe[\"close\"]\n                        < dataframe[\"bb_upperband\"].shift(2) - dataframe[\"bb_lowerband\"].shift(2)\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_3_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                    & (dataframe[\"rsi\"] < self.buy_rsi_3.value)\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_4_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_1.value)\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_5_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_1.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)  # Make sure Volume is not 0\n                )\n            )\n        if self.v9_buy_condition_6_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_2.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_7_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_2.value)\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_1.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_8_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_3.value)\n                    & (dataframe[\"rsi\"] < self.buy_rsi_1.value)\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_9_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_4.value)\n                    & (dataframe[\"rsi\"] < self.buy_rsi_2.value)\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_10_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                    & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - 43.276)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        # END  V9\n        # START  V6\n        if self.v6_buy_condition_0_enable.value:\n            conditions.append(\n                (  # strategy ClucMay72018\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                    & (dataframe[\"close\"] < 0.99 * dataframe[\"bb_lowerband\"])\n                    & (\n                        (dataframe[\"volume\"] < (dataframe[\"volume_mean_slow\"].shift(1) * 21))\n                        | (dataframe[\"volume_mean_slow\"] > (dataframe[\"volume_mean_slow\"].shift(30) * 0.4))\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v6_buy_condition_1_enable.value:\n            conditions.append(\n                (  # strategy ClucMay72018\n                    (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                    & (dataframe[\"close\"] < 0.975 * dataframe[\"bb_lowerband\"])\n                    & (\n                        (dataframe[\"volume\"] < (dataframe[\"volume_mean_slow\"].shift(1) * 20))\n                        | (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                    )\n                    & (dataframe[\"rsi_1h\"] < 15)  # Don't buy if someone drop the market.\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    & (dataframe[\"volume\"] > 0)  # Try to exclude pumping  # Make sure Volume is not 0\n                )\n            )\n        if self.v6_buy_condition_2_enable.value:\n            conditions.append(\n                (  # strategy MACD Low buy\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * 0.02))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (\n                        (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                        | (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                    )\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                    &\n                    #\n                    (dataframe[\"volume\"] > 0)\n                )\n            )\n\n        if self.v6_buy_condition_3_enable.value:\n            conditions.append(\n                (  # strategy MACD Low buy\n                    (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * 0.03))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))  # Don't buy if someone drop the market.\n                    & (dataframe[\"volume\"] > 0)  # Make sure Volume is not 0\n                )\n            )\n\n\n\n        # END  V6\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"buy\"] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        if self.v9_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_middleband\"] * 1.01)\n                    & (dataframe[\"volume\"] > 0)  # Don't be gready, sell fast  # Make sure Volume is not 0\n                )\n            )\n\n        if self.v8_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_upperband\"])\n                    & (dataframe[\"close\"].shift(1) > dataframe[\"bb_upperband\"].shift(1))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_sell_condition_1_enable.value:\n            conditions.append(((dataframe[\"rsi\"] > self.v8_sell_rsi_main.value) & (dataframe[\"volume\"] > 0)))\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BinClucMadDevelop/BinClucMadDevelop.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\nimport logging\n\n# -------------------------------------------------------------------------------------------------\n# --- logger for parameter merging output, only remove if you remove it further down too! ---------\nlogger = logging.getLogger(__name__)\n# -------------------------------------------------------------------------------------------------\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN))\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\nclass BinClucMadDevelop(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # minimal_roi = {\"0\": 0.10, \"10\": 0.028, \"40\": 0.015, \"180\": 0.018 }\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018 }\n    minimal_roi = {\"0\": 0.20, \"38\": 0.074, \"78\": 0.025, \"194\": 0}\n    stoploss = -0.99\n\n    timeframe = \"5m\"\n    informative_timeframe = \"1h\"\n\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.05\n\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        #############\n        # Enable/Disable conditions\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": True,\n        \"v9_buy_condition_2_enable\": True,\n        \"v9_buy_condition_3_enable\": True,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": True,\n        \"v9_buy_condition_6_enable\": True,\n        \"v9_buy_condition_7_enable\": True,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n\n    }\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"v9_sell_condition_0_enable\": False,\n        \"v8_sell_condition_0_enable\": True,\n        \"v8_sell_condition_1_enable\": True,\n    }\n\n    # if you want to see which buy conditions were met\n    # or if there is an trade exit override due to high RSI set to True\n    # logger will output the buy and trade exit conditions\n    cust_log_verbose = False\n\n    ############################################################################\n    # Buy CombinedBinHClucAndMADV6\n    v6_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    # Buy CombinedBinHClucV8\n    v8_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_4_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n\n    v8_sell_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n    v8_sell_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n\n    v8_sell_rsi_main = DecimalParameter(72.0, 90.0, default=80, space=\"sell\", decimals=2, optimize=False, load=True)\n    buy_dip_threshold_0 = DecimalParameter(0.001, 0.1, default=0.015, space=\"buy\", decimals=3, optimize=False, load=True)\n    buy_dip_threshold_1 = DecimalParameter(0.08, 0.2, default=0.12, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.02, 0.4, default=0.28, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.25, 0.44, default=0.36, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.04, default=0.031, space=\"buy\", optimize=False, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.021, space=\"buy\", optimize=False, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.2, 0.4, default=0.264, space=\"buy\", optimize=False, load=True)\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.992, space=\"buy\", optimize=False, load=True)\n    buy_bb20_volume = IntParameter(18, 36, default=29, space=\"buy\", optimize=False, load=True)\n    buy_rsi_diff = DecimalParameter(34.0, 60.0, default=50.48, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_min_inc = DecimalParameter(0.005, 0.05, default=0.01, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_rsi_1h = DecimalParameter(40.0, 70.0, default=67.0, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_rsi = DecimalParameter(30.0, 40.0, default=38.5, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_mfi = DecimalParameter(36.0, 65.0, default=36.0, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_volume_1 = DecimalParameter(1.0, 10.0, default=2.0, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_1 = DecimalParameter(0.01, 0.05, default=0.02, space=\"buy\", decimals=3, optimize=False, load=True)\n    sell_custom_roi_profit_1 = DecimalParameter(\n        0.01, 0.03, default=0.02, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_1 = DecimalParameter(40.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True)\n    sell_custom_roi_profit_2 = DecimalParameter(\n        0.01, 0.20, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_2 = DecimalParameter(42.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True)\n    sell_custom_roi_profit_3 = DecimalParameter(\n        0.15, 0.30, default=0.08, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_3 = DecimalParameter(44.0, 58.0, default=56, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_4 = DecimalParameter(0.3, 0.7, default=0.14, space=\"sell\", decimals=2, optimize=True, load=True)\n    sell_custom_roi_rsi_4 = DecimalParameter(44.0, 60.0, default=58, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_5 = DecimalParameter(0.01, 0.1, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True)\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.1, space=\"sell\", decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.4, space=\"sell\", decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.1, default=0.03, space=\"sell\", decimals=3, optimize=True, load=True)\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.02, space=\"sell\", decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.1, space=\"sell\", decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.015, space=\"sell\", decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_1 = DecimalParameter(\n        -0.15, -0.03, default=-0.05, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    # Buy  CombinedBinHClucAndMADV9\n    v9_buy_condition_0_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_1_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_2_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_3_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_4_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_5_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_6_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_7_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_8_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_9_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_10_enable = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=False, load=True)\n\n    # Sell\n    v9_sell_condition_0_enable = CategoricalParameter([True, False], default=False, space=\"sell\", optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.99, space=\"buy\", optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space=\"buy\", optimize=False, load=True)\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=4, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space=\"buy\", decimals=2, optimize=False, load=True)\n    # minimum conditions to match in buy\n    buy_minimum_conditions = IntParameter(1, 2, default=1, space='buy', optimize=False, load=True)\n\n    # Sell Hyperopt params\n\n    sell_roi_profit_1 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_rsi_1 = DecimalParameter(30.0, 38.0, default=34, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_profit_2 = DecimalParameter(0.02, 0.05, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_rsi_2 = DecimalParameter(34.0, 44.0, default=38, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_profit_3 = DecimalParameter(0.0, 0.0, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_rsi_3 = DecimalParameter(48.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        return True\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        # Prevent sell, if there is more potential, in order to maximize profit\n        if (last_candle is not None):\n            current_profit = trade.calc_profit_ratio(rate)\n            if (sell_reason == 'roi'):\n                if (current_profit > self.sell_roi_profit_1.value):\n                    if (last_candle['rsi'] > self.sell_roi_rsi_1.value):\n                        return False\n                elif (current_profit > self.sell_roi_profit_2.value):\n                    if (last_candle['rsi'] > self.sell_roi_rsi_2.value):\n                        return False\n                elif (current_profit > self.sell_roi_profit_3.value):\n                    if (last_candle['rsi'] > self.sell_roi_rsi_3.value):\n                        return False\n        return True\n\n\n\n    def custom_stoploss(\n        self, pair: str, trade: \"Trade\", current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if current_profit > 0:\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=240)\n            # trade_time_240 = trade.open_date_utc + timedelta(minutes=240)\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if current_time > trade_time_50:\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n                    if (candle[\"sma_200_dec\"]) & (candle[\"sma_200_dec_1h\"]):\n                        return 0.01\n                    # We are at bottom. Wait...\n                    if candle[\"rsi_1h\"] < 30:\n                        return 0.99\n\n                    # Are we still sinking?\n                    if candle[\"close\"] > candle[\"ema_200\"]:\n                        if current_rate * 1.025 < candle[\"open\"]:\n                            return 0.01\n\n                    if current_rate * 1.015 < candle[\"open\"]:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n\n\n    def custom_sell(\n        self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float, current_profit: float, **kwargs\n    ):\n        # return False\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if last_candle is not None:\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_4.value\n            ):\n                return \"roi_target_4\"\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_3.value\n            ):\n                return \"roi_target_3\"\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_2.value\n            ):\n                return \"roi_target_2\"\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_1.value\n            ):\n                return \"roi_target_1\"\n            elif (\n                (current_profit > 0) & (current_profit < self.sell_custom_roi_profit_5.value) & (last_candle[\"sma_200_dec\"])\n            ):\n                return \"roi_target_5\"\n\n            elif (\n                (current_profit > self.sell_trail_profit_min_1.value)\n                & (current_profit < self.sell_trail_profit_max_1.value)\n                & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value))\n            ):\n                return \"trail_target_1\"\n            elif (\n                (current_profit > self.sell_trail_profit_min_2.value)\n                & (current_profit < self.sell_trail_profit_max_2.value)\n                & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value))\n            ):\n                return \"trail_target_2\"\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata[\"pair\"], timeframe=self.informative_timeframe)\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h[\"ema_100\"] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h[\"ema_200\"] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h[\"sma_200\"] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h[\"sma_200_dec\"] = informative_1h[\"sma_200\"] < informative_1h[\"sma_200\"].shift(20)\n        # RSI\n        informative_1h[\"rsi\"] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h[\"ssl_down\"] = ssl_down_1h\n        informative_1h[\"ssl_up\"] = ssl_up_1h\n        informative_1h[\"ssl-dir\"] = np.where(ssl_up_1h > ssl_down_1h, \"up\", \"down\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe[\"close\"], window=40, stds=2)\n        dataframe[\"lower\"] = bb_40[\"lower\"]\n        dataframe[\"mid\"] = bb_40[\"mid\"]\n        dataframe[\"bbdelta\"] = (bb_40[\"mid\"] - dataframe[\"lower\"]).abs()\n        dataframe[\"closedelta\"] = (dataframe[\"close\"] - dataframe[\"close\"].shift()).abs()\n        dataframe[\"tail\"] = (dataframe[\"close\"] - dataframe[\"low\"]).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n\n        dataframe[\"volume_mean_slow\"] = dataframe[\"volume\"].rolling(window=30).mean()\n\n        # EMA\n        dataframe[\"ema_12\"] = ta.EMA(dataframe, timeperiod=12)\n        dataframe[\"ema_26\"] = ta.EMA(dataframe, timeperiod=26)\n        dataframe[\"ema_50\"] = ta.EMA(dataframe, timeperiod=50)\n        dataframe[\"ema_200\"] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe[\"sma_5\"] = ta.EMA(dataframe, timeperiod=5)\n        dataframe[\"sma_200\"] = ta.SMA(dataframe, timeperiod=200)\n        dataframe[\"sma_200_dec\"] = dataframe[\"sma_200\"] < dataframe[\"sma_200\"].shift(20)\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n        # MFI\n        dataframe[\"mfi\"] = ta.MFI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # reset additional dataframe rows\n        dataframe.loc[:, \"v9_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_5_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_6_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_7_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_8_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_9_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_10_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"conditions_count\"] = 0\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_2.value\n                )\n                & dataframe[\"lower\"].shift().gt(0)\n                & dataframe[\"bbdelta\"].gt(dataframe[\"close\"] * self.buy_bb40_bbdelta_close.value)\n                & dataframe[\"closedelta\"].gt(dataframe[\"close\"] * self.buy_bb40_closedelta_close.value)\n                & dataframe[\"tail\"].lt(dataframe[\"bbdelta\"] * self.buy_bb40_tail_bbdelta.value)\n                & dataframe[\"close\"].lt(dataframe[\"lower\"].shift())\n                & dataframe[\"close\"].le(dataframe[\"close\"].shift())\n                & (self.v8_buy_condition_0_enable.value == True)\n            ),\n            \"v8_buy_condition_0_enable\",\n        ] = 1\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_2.value\n                )\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < self.buy_bb20_close_bblowerband.value * dataframe[\"bb_lowerband\"])\n                & (dataframe[\"volume\"] < (dataframe[\"volume_mean_slow\"].shift(1) * self.buy_bb20_volume.value))\n                & (self.v8_buy_condition_1_enable.value == True)\n            ),\n            \"v8_buy_condition_1_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_3.value\n                )\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - self.buy_rsi_diff.value)\n                & (self.v8_buy_condition_2_enable.value == True)\n            ),\n            \"v8_buy_condition_2_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"sma_200\"] > dataframe[\"sma_200\"].shift(20))\n                & (dataframe[\"sma_200_1h\"] > dataframe[\"sma_200_1h\"].shift(16))\n                & (\n                    ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(24).min() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    > self.buy_min_inc.value\n                )\n                & (dataframe[\"rsi_1h\"] > self.buy_rsi_1h.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi.value)\n                & (dataframe[\"mfi\"] < self.buy_mfi.value)\n                & (self.v8_buy_condition_3_enable.value == True)\n            ),\n            \"v8_buy_condition_3_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (\n                    ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    ((dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                    < self.buy_dip_threshold_3.value\n                )\n                & (dataframe[\"volume\"].rolling(4).mean() * self.buy_volume_1.value > dataframe[\"volume\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_ema_open_mult_1.value))\n                & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v8_buy_condition_4_enable.value == True)\n            ),\n            \"v8_buy_condition_4_enable\",\n        ] = 1\n        # start from here\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"] * self.buy_bb20_close_bblowerband_safe_1.value)\n                & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value)\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (\n                    dataframe[\"open\"] - dataframe[\"close\"]\n                    < dataframe[\"bb_upperband\"].shift(2) - dataframe[\"bb_lowerband\"].shift(2)\n                )\n                & (self.v9_buy_condition_1_enable.value == True)\n            ),\n            \"v9_buy_condition_1_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"] * self.buy_bb20_close_bblowerband_safe_2.value)\n                & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value)\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (\n                    dataframe[\"open\"] - dataframe[\"close\"]\n                    < dataframe[\"bb_upperband\"].shift(2) - dataframe[\"bb_lowerband\"].shift(2)\n                )\n                & (self.v9_buy_condition_2_enable.value == True)\n            ),\n            \"v9_buy_condition_2_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                & (dataframe[\"rsi\"] < self.buy_rsi_3.value)\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (self.v9_buy_condition_3_enable.value == True)\n            ),\n            \"v9_buy_condition_3_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_1.value)\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (self.v9_buy_condition_4_enable.value == True)\n            ),\n            \"v9_buy_condition_4_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_1.value))\n                & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value)\n                & (self.v9_buy_condition_5_enable.value == True)\n            ),\n            \"v9_buy_condition_5_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_2.value))\n                & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (self.v9_buy_condition_6_enable.value == True)\n            ),\n            \"v9_buy_condition_6_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_2.value)\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_1.value))\n                & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value)\n                & (self.v9_buy_condition_7_enable.value == True)\n            ),\n            \"v9_buy_condition_7_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_3.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi_1.value)\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value)\n                & (self.v9_buy_condition_8_enable.value == True)\n            ),\n            \"v9_buy_condition_8_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_4.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi_2.value)\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value)\n                & (self.v9_buy_condition_9_enable.value == True)\n            ),\n            \"v9_buy_condition_9_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - 43.276)\n                & (self.v9_buy_condition_10_enable.value == True)\n            ),\n            \"v9_buy_condition_10_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.99 * dataframe[\"bb_lowerband\"])\n                & (\n                    (dataframe[\"volume\"] < (dataframe[\"volume_mean_slow\"].shift(1) * 21))\n                    | (dataframe[\"volume_mean_slow\"] > (dataframe[\"volume_mean_slow\"].shift(30) * 0.4))\n                )\n                & (self.v6_buy_condition_0_enable.value == True)\n            ),\n            \"v6_buy_condition_0_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.975 * dataframe[\"bb_lowerband\"])\n                & (\n                    (dataframe[\"volume\"] < (dataframe[\"volume_mean_slow\"].shift(1) * 20))\n                    | (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                )\n                & (dataframe[\"rsi_1h\"] < 15)  # Don't buy if someone drop the market.\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (self.v6_buy_condition_1_enable.value == True)\n            ),\n            \"v6_buy_condition_1_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * 0.02))\n                & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                & (\n                    (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    | (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_2_enable.value == True)\n            ),\n            \"v6_buy_condition_2_enable\",\n        ] = 1\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * 0.03))\n                & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_3_enable.value == True)\n            ),\n            \"v6_buy_condition_3_enable\",\n        ] = 1\n\n        # count the amount of conditions met\n        dataframe.loc[:, \"conditions_count\"] = (\n            dataframe[\"v9_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_4_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_5_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_6_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_7_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_8_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_9_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_10_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_4_enable\"].astype(int)\n        )\n\n        # append the minimum amount of conditions to be met\n        conditions.append(dataframe[\"conditions_count\"] >= self.buy_minimum_conditions.value)\n        conditions.append(dataframe[\"volume\"].gt(0))\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"buy\"] = 1\n\n        # verbose logging enable only for verbose information or troubleshooting\n        if self.cust_log_verbose == True:\n            for index, row in dataframe.iterrows():\n                if row[\"buy\"] == 1:\n                    # buy_cond_details = f\"count={int(row['conditions_count'])}/bin={int(row['buy_cond_bin'])}/cluc={int(row['buy_cond_cluc'])}/v9_={int(row['buy_cond_long'])}\"\n                    buy_cond_details = f\"count={int(row['conditions_count'])}/v9_1={int(row['v9_buy_condition_1_enable'])}/v9_2={int(row['v9_buy_condition_2_enable'])}/v9_3={int(row['v9_buy_condition_3_enable'])}/v9_4={int(row['v9_buy_condition_4_enable'])}/v9_5={int(row['v9_buy_condition_5_enable'])}/v9_6={int(row['v9_buy_condition_6_enable'])}/v9_7={int(row['v9_buy_condition_7_enable'])}/v9_8={int(row['v9_buy_condition_8_enable'])}/v9_9={int(row['v9_buy_condition_9_enable'])}/v9_10={int(row['v9_buy_condition_10_enable'])}/v6_0={int(row['v6_buy_condition_0_enable'])}/v6_1={int(row['v6_buy_condition_1_enable'])}/v6_2={int(row['v6_buy_condition_2_enable'])}/v6_3={int(row['v6_buy_condition_3_enable'])}/v8_0={int(row['v8_buy_condition_0_enable'])}/v8_1={int(row['v8_buy_condition_1_enable'])}/v8_2={int(row['v8_buy_condition_2_enable'])}/v8_3={int(row['v8_buy_condition_3_enable'])}/v8_4={int(row['v8_buy_condition_4_enable'])}\"\n\n                    logger.info(f\"{metadata['pair']} - candle: {row['date']} - buy condition - details: {buy_cond_details}\")\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        if self.v9_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_middleband\"] * 1.01)\n                    & (dataframe[\"volume\"] > 0)  # Don't be gready, sell fast  # Make sure Volume is not 0\n                )\n            )\n\n        if self.v8_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_upperband\"])\n                    & (dataframe[\"close\"].shift(1) > dataframe[\"bb_upperband\"].shift(1))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_sell_condition_1_enable.value:\n            conditions.append(((dataframe[\"rsi\"] > self.v8_sell_rsi_main.value) & (dataframe[\"volume\"] > 0)))\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n\n        return dataframe\n\n\n# --- custom indicators ---------------------------------------------------------------------------\n\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN))\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n\n    return df[\"sslDown\"], df[\"sslUp\"]\n"
  },
  {
    "path": "strategies/BinClucMadSMADevelop/BinClucMadSMADevelop.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import (\n    merge_informative_pair,\n    CategoricalParameter,\n    DecimalParameter,\n    IntParameter,\n    stoploss_from_open,\n)\nfrom functools import reduce\nimport logging\n# -------------------------------------------------------------------------------------------------\n# --- logger for parameter merging output, only remove if you remove it further down too! ---------\nlogger = logging.getLogger(__name__)\n# -------------------------------------------------------------------------------------------------\n\n\nclass BinClucMadSMADevelop(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018, }\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018, }\n    minimal_roi = {\"0\": 0.20, \"38\": 0.074, \"78\": 0.025, \"194\": 0}\n    stoploss = -0.228  # effectively disabled.\n\n    timeframe = \"5m\"\n    informative_timeframe = \"1h\"\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.049\n\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        #############\n        # Enable/Disable conditions\n        \"smaoffset_buy_condition_0_enable\": True,\n        \"smaoffset_buy_condition_1_enable\": True,\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": False,\n        \"v9_buy_condition_2_enable\": False,\n        \"v9_buy_condition_3_enable\": False,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": False,\n        \"v9_buy_condition_6_enable\": False,\n        \"v9_buy_condition_7_enable\": False,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n    }\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"v9_sell_condition_0_enable\": False,\n        \"v8_sell_condition_0_enable\": True,\n        \"v8_sell_condition_1_enable\": True,\n        \"smaoffset_sell_condition_0_enable\": False,\n    }\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # if you want to see which buy conditions were met\n    # or if there is an trade exit override due to high RSI set to True\n    # logger will output the buy and trade exit conditions\n    cust_log_verbose = False\n\n    ############################################################################\n    # Buy SMAOffsetProtectOpt\n\n    smaoffset_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    smaoffset_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    smaoffset_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n    # hyperopt parameters for SMAOffsetProtectOpt\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, space=\"buy\", optimize=False, load=True\n    )\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=24, space=\"sell\", optimize=False, load=True\n    )\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=0.975, space=\"buy\", optimize=True, load=True\n    )\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=1.012, space=\"sell\", optimize=True, load=True\n    )\n    # Protection\n    fast_ewo = IntParameter(10, 50, default=50, space=\"buy\", optimize=False, load=True)\n    slow_ewo = IntParameter(\n        100, 200, default=200, space=\"buy\", optimize=False, load=True\n    )\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-19.881, space=\"buy\", optimize=True, load=True\n    )\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=5.499, space=\"buy\", optimize=True, load=True\n    )\n    rsi_buy = IntParameter(30, 70, default=50, space=\"buy\", optimize=True, load=True)\n    # Buy CombinedBinHClucAndMADV6\n\n    v6_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    # Buy CombinedBinHClucV8\n    v8_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_4_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n\n    v8_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n    v8_sell_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n\n    v8_sell_rsi_main = DecimalParameter(\n        72.0, 90.0, default=80, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_0 = DecimalParameter(\n        0.001, 0.1, default=0.015, space=\"buy\", decimals=3, optimize=False, load=True\n    )\n    buy_dip_threshold_1 = DecimalParameter(\n        0.08, 0.2, default=0.12, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_2 = DecimalParameter(\n        0.02, 0.4, default=0.28, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_3 = DecimalParameter(\n        0.25, 0.44, default=0.36, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_bb40_bbdelta_close = DecimalParameter(\n        0.005, 0.04, default=0.031, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb40_closedelta_close = DecimalParameter(\n        0.01, 0.03, default=0.021, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb40_tail_bbdelta = DecimalParameter(\n        0.2, 0.4, default=0.264, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_close_bblowerband = DecimalParameter(\n        0.8, 1.1, default=0.992, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_volume = IntParameter(\n        18, 36, default=29, space=\"buy\", optimize=False, load=True\n    )\n    buy_rsi_diff = DecimalParameter(\n        34.0, 60.0, default=50.48, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_min_inc = DecimalParameter(\n        0.005, 0.05, default=0.01, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_rsi_1h = DecimalParameter(\n        40.0, 70.0, default=67.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_rsi = DecimalParameter(\n        30.0, 40.0, default=38.5, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_mfi = DecimalParameter(\n        36.0, 65.0, default=36.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_volume_1 = DecimalParameter(\n        1.0, 10.0, default=2.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_ema_open_mult_1 = DecimalParameter(\n        0.01, 0.05, default=0.02, space=\"buy\", decimals=3, optimize=False, load=True\n    )\n    sell_custom_roi_profit_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_1 = DecimalParameter(\n        40.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_profit_2 = DecimalParameter(\n        0.01, 0.20, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_2 = DecimalParameter(\n        42.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_profit_3 = DecimalParameter(\n        0.15, 0.30, default=0.08, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_3 = DecimalParameter(\n        44.0, 58.0, default=56, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_profit_4 = DecimalParameter(\n        0.3, 0.7, default=0.14, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_4 = DecimalParameter(\n        44.0, 60.0, default=58, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_profit_5 = DecimalParameter(\n        0.01, 0.1, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_profit_min_1 = DecimalParameter(\n        0.1, 0.25, default=0.1, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_max_1 = DecimalParameter(\n        0.3, 0.5, default=0.4, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_down_1 = DecimalParameter(\n        0.04, 0.1, default=0.03, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_min_2 = DecimalParameter(\n        0.01, 0.1, default=0.02, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_max_2 = DecimalParameter(\n        0.08, 0.25, default=0.1, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_down_2 = DecimalParameter(\n        0.04, 0.2, default=0.015, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_custom_stoploss_1 = DecimalParameter(\n        -0.15, -0.03, default=-0.05, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    # Buy  CombinedBinHClucAndMADV9\n    v9_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_4_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_5_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_6_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_7_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_8_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_9_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_10_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n\n    # Sell\n    v9_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=False, space=\"sell\", optimize=False, load=True\n    )\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(\n        0.7, 1.1, default=0.99, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(\n        0.7, 1.1, default=0.982, space=\"buy\", optimize=False, load=True\n    )\n    buy_volume_pump_1 = DecimalParameter(\n        0.1, 0.9, default=0.4, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_volume_drop_1 = DecimalParameter(\n        1, 10, default=4, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_1 = DecimalParameter(\n        10.0, 40.0, default=16.5, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_2 = DecimalParameter(\n        10.0, 40.0, default=15.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_3 = DecimalParameter(\n        10.0, 40.0, default=20.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_4 = DecimalParameter(\n        10.0, 40.0, default=35.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1 = DecimalParameter(\n        10.0, 40.0, default=28.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_2 = DecimalParameter(\n        7.0, 40.0, default=10.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_3 = DecimalParameter(\n        7.0, 40.0, default=14.2, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_macd_1 = DecimalParameter(\n        0.01, 0.09, default=0.02, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_macd_2 = DecimalParameter(\n        0.01, 0.09, default=0.03, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    # minimum conditions to match in buy\n    buy_minimum_conditions = IntParameter(\n        1, 2, default=1, space=\"buy\", optimize=False, load=True\n    )\n\n    def custom_stoploss(\n        self, pair: str, trade: \"Trade\", current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if current_profit > 0:\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=240)\n            # trade_time_240 = trade.open_date_utc + timedelta(minutes=240)\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if current_time > trade_time_50:\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n                    if (candle[\"sma_200_dec\"]) & (candle[\"sma_200_dec_1h\"]):\n                        return 0.01\n                    # We are at bottom. Wait...\n                    if candle[\"rsi_1h\"] < 30:\n                        return 0.99\n\n                    # Are we still sinking?\n                    if candle[\"close\"] > candle[\"ema_200\"]:\n                        if current_rate * 1.025 < candle[\"open\"]:\n                            return 0.01\n\n                    if current_rate * 1.015 < candle[\"open\"]:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n\n\n    def custom_sell(\n        self,\n        pair: str,\n        trade: \"Trade\",\n        current_time: \"datetime\",\n        current_rate: float,\n        current_profit: float,\n        **kwargs,\n    ):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if last_candle is not None:\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_4.value\n            ):\n                return \"roi_target_4\"\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_3.value\n            ):\n                return \"roi_target_3\"\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_2.value\n            ):\n                return \"roi_target_2\"\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_1.value\n            ):\n                return \"roi_target_1\"\n            elif (\n                (current_profit > 0)\n                & (current_profit < self.sell_custom_roi_profit_5.value)\n                & (last_candle[\"sma_200_dec\"])\n            ):\n                return \"roi_target_5\"\n\n            elif (\n                (current_profit > self.sell_trail_profit_min_1.value)\n                & (current_profit < self.sell_trail_profit_max_1.value)\n                & (\n                    ((trade.max_rate - trade.open_rate) / 100)\n                    > (current_profit + self.sell_trail_down_1.value)\n                )\n            ):\n                return \"trail_target_1\"\n            elif (\n                (current_profit > self.sell_trail_profit_min_2.value)\n                & (current_profit < self.sell_trail_profit_max_2.value)\n                & (\n                    ((trade.max_rate - trade.open_rate) / 100)\n                    > (current_profit + self.sell_trail_down_2.value)\n                )\n            ):\n                return \"trail_target_2\"\n        # Sell any positions at a loss if they are held for more than one day.\n        # if current_profit < 0.0 and (current_time - trade.open_date_utc).days >= 2:\n        #     return 'unclog'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(\n        self, dataframe: DataFrame, metadata: dict\n    ) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(\n            pair=metadata[\"pair\"], timeframe=self.informative_timeframe\n        )\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h[\"ema_100\"] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h[\"ema_200\"] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h[\"sma_200\"] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h[\"sma_200_dec\"] = informative_1h[\"sma_200\"] < informative_1h[\n            \"sma_200\"\n        ].shift(20)\n        # RSI\n        informative_1h[\"rsi\"] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h[\"ssl_down\"] = ssl_down_1h\n        informative_1h[\"ssl_up\"] = ssl_up_1h\n        informative_1h[\"ssl-dir\"] = np.where(ssl_up_1h > ssl_down_1h, \"up\", \"down\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe[\"close\"], window=40, stds=2)\n        dataframe[\"lower\"] = bb_40[\"lower\"]\n        dataframe[\"mid\"] = bb_40[\"mid\"]\n        dataframe[\"bbdelta\"] = (bb_40[\"mid\"] - dataframe[\"lower\"]).abs()\n        dataframe[\"closedelta\"] = (\n            dataframe[\"close\"] - dataframe[\"close\"].shift()\n        ).abs()\n        dataframe[\"tail\"] = (dataframe[\"close\"] - dataframe[\"low\"]).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n\n        dataframe[\"volume_mean_slow\"] = dataframe[\"volume\"].rolling(window=30).mean()\n\n        # EMA\n        dataframe[\"ema_12\"] = ta.EMA(dataframe, timeperiod=12)\n        dataframe[\"ema_26\"] = ta.EMA(dataframe, timeperiod=26)\n        dataframe[\"ema_50\"] = ta.EMA(dataframe, timeperiod=50)\n        dataframe[\"ema_200\"] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe[\"sma_5\"] = ta.EMA(dataframe, timeperiod=5)\n        dataframe[\"sma_200\"] = ta.SMA(dataframe, timeperiod=200)\n        dataframe[\"sma_200_dec\"] = dataframe[\"sma_200\"] < dataframe[\"sma_200\"].shift(20)\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n        # MFI\n        dataframe[\"mfi\"] = ta.MFI(dataframe, timeperiod=14)\n        # ------ ATR stuff\n        dataframe[\"atr\"] = ta.ATR(dataframe, timeperiod=14)\n\n        # ------ SMAOffsetProtectOpt\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f\"ma_buy_{val}\"] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f\"ma_sell_{val}\"] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe[\"EWO\"] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe,\n            informative,\n            self.timeframe,\n            self.informative_timeframe,\n            ffill=True,\n        )\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # reset additional dataframe rows\n        dataframe.loc[:, \"v9_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_5_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_6_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_7_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_8_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_9_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_10_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"smaoffset_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"smaoffset_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"conditions_count\"] = 0\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        dataframe[\"ma_buy\"] = (\n            dataframe[f\"ma_buy_{self.base_nb_candles_buy.value}\"]\n            * self.low_offset.value\n        )\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ma_buy\"])\n                & (dataframe[\"EWO\"] > self.ewo_high.value)\n                & (dataframe[\"rsi\"] < self.rsi_buy.value)\n                & (self.smaoffset_buy_condition_0_enable.value == True)\n            ),\n            ['smaoffset_buy_condition_0_enable', 'buy_tag']] = (1, 'buy_signal_smaoffset_0')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ma_buy\"])\n                & (dataframe[\"EWO\"] < self.ewo_low.value)\n                & (self.smaoffset_buy_condition_1_enable.value == True)\n            ),\n            ['smaoffset_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_smaoffset_1')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & dataframe[\"lower\"].shift().gt(0)\n                & dataframe[\"bbdelta\"].gt(\n                    dataframe[\"close\"] * self.buy_bb40_bbdelta_close.value\n                )\n                & dataframe[\"closedelta\"].gt(\n                    dataframe[\"close\"] * self.buy_bb40_closedelta_close.value\n                )\n                & dataframe[\"tail\"].lt(\n                    dataframe[\"bbdelta\"] * self.buy_bb40_tail_bbdelta.value\n                )\n                & dataframe[\"close\"].lt(dataframe[\"lower\"].shift())\n                & dataframe[\"close\"].le(dataframe[\"close\"].shift())\n                & (self.v8_buy_condition_0_enable.value == True)\n            ),\n            ['v8_buy_condition_0_enable', 'buy_tag']] = (1, 'buy_signal_v8_0')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (\n                    dataframe[\"close\"]\n                    < self.buy_bb20_close_bblowerband.value * dataframe[\"bb_lowerband\"]\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (\n                        dataframe[\"volume_mean_slow\"].shift(1)\n                        * self.buy_bb20_volume.value\n                    )\n                )\n                & (self.v8_buy_condition_1_enable.value == True)\n            ),\n            ['v8_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_v8_1')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - self.buy_rsi_diff.value)\n                & (self.v8_buy_condition_2_enable.value == True)\n            ),\n            ['v8_buy_condition_2_enable', 'buy_tag']] = (1, 'buy_signal_v8_2')\n\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"sma_200\"] > dataframe[\"sma_200\"].shift(20))\n                & (dataframe[\"sma_200_1h\"] > dataframe[\"sma_200_1h\"].shift(16))\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(24).min() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    > self.buy_min_inc.value\n                )\n                & (dataframe[\"rsi_1h\"] > self.buy_rsi_1h.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi.value)\n                & (dataframe[\"mfi\"] < self.buy_mfi.value)\n                & (self.v8_buy_condition_3_enable.value == True)\n            ),\n            ['v8_buy_condition_3_enable', 'buy_tag']] = (1, 'buy_signal_v8_3')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    dataframe[\"volume\"].rolling(4).mean() * self.buy_volume_1.value\n                    > dataframe[\"volume\"]\n                )\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_ema_open_mult_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v8_buy_condition_4_enable.value == True)\n            ),\n            ['v8_buy_condition_4_enable', 'buy_tag']] = (1, 'buy_signal_v8_4')\n        # start from here\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    dataframe[\"close\"]\n                    < dataframe[\"bb_lowerband\"]\n                    * self.buy_bb20_close_bblowerband_safe_1.value\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"open\"] - dataframe[\"close\"]\n                    < dataframe[\"bb_upperband\"].shift(2)\n                    - dataframe[\"bb_lowerband\"].shift(2)\n                )\n                & (self.v9_buy_condition_1_enable.value == True)\n            ),\n            ['v9_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_v9_1')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (\n                    dataframe[\"close\"]\n                    < dataframe[\"bb_lowerband\"]\n                    * self.buy_bb20_close_bblowerband_safe_2.value\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"open\"] - dataframe[\"close\"]\n                    < dataframe[\"bb_upperband\"].shift(2)\n                    - dataframe[\"bb_lowerband\"].shift(2)\n                )\n                & (self.v9_buy_condition_2_enable.value == True)\n            ),\n            ['v9_buy_condition_2_enable', 'buy_tag']] = (1, 'buy_signal_v9_2')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                & (dataframe[\"rsi\"] < self.buy_rsi_3.value)\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (self.v9_buy_condition_3_enable.value == True)\n            ),\n            ['v9_buy_condition_3_enable', 'buy_tag']] = (1, 'buy_signal_v9_3')\n\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_1.value)\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (self.v9_buy_condition_4_enable.value == True)\n            ),\n            ['v9_buy_condition_4_enable', 'buy_tag']] = (1, 'buy_signal_v9_4')\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_macd_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_5_enable.value == True)\n            ),\n            ['v9_buy_condition_5_enable', 'buy_tag']] = (1, 'buy_signal_v9_5')\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_macd_2.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (self.v9_buy_condition_6_enable.value == True)\n            ),\n            ['v9_buy_condition_6_enable', 'buy_tag']] = (1, 'buy_signal_v9_6')\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_2.value)\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_macd_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_7_enable.value == True)\n            ),\n            ['v9_buy_condition_7_enable', 'buy_tag']] = (1, 'buy_signal_v9_7')\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_3.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi_1.value)\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_8_enable.value == True)\n            ),\n            ['v9_buy_condition_8_enable', 'buy_tag']] = (1, 'buy_signal_v9_8')\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_4.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi_2.value)\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_9_enable.value == True)\n            ),\n            ['v9_buy_condition_9_enable', 'buy_tag']] = (1, 'buy_signal_v9_9')\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - 43.276)\n                & (self.v9_buy_condition_10_enable.value == True)\n            ),\n            ['v9_buy_condition_10_enable', 'buy_tag']] = (1, 'buy_signal_v9_10')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.99 * dataframe[\"bb_lowerband\"])\n                & (\n                    (\n                        dataframe[\"volume\"]\n                        < (dataframe[\"volume_mean_slow\"].shift(1) * 21)\n                    )\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > (dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                    )\n                )\n                & (self.v6_buy_condition_0_enable.value == True)\n            ),\n            ['v6_buy_condition_0_enable', 'buy_tag']] = (1, 'buy_signal_v6_0')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.975 * dataframe[\"bb_lowerband\"])\n                & (\n                    (\n                        dataframe[\"volume\"]\n                        < (dataframe[\"volume_mean_slow\"].shift(1) * 20)\n                    )\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                )\n                & (dataframe[\"rsi_1h\"] < 15)  # Don't buy if someone drop the market.\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (self.v6_buy_condition_1_enable.value == True)\n            ),\n            ['v6_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_v6_1')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * 0.02)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (\n                    (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_2_enable.value == True)\n            ),\n            ['v6_buy_condition_2_enable', 'buy_tag']] = (1, 'buy_signal_v6_2')\n\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * 0.03)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_3_enable.value == True)\n            ),\n            ['v6_buy_condition_3_enable', 'buy_tag']] = (1, 'buy_signal_v6_3')\n\n\n        # count the amount of conditions met\n        dataframe.loc[:, \"conditions_count\"] = (\n            dataframe[\"v9_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_4_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_5_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_6_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_7_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_8_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_9_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_10_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_4_enable\"].astype(int)\n            + dataframe[\"smaoffset_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"smaoffset_buy_condition_1_enable\"].astype(int)\n        )\n\n        # append the minimum amount of conditions to be met\n        conditions.append(\n            dataframe[\"conditions_count\"] >= self.buy_minimum_conditions.value\n        )\n        conditions.append(dataframe[\"volume\"].gt(0))\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"buy\"] = 1\n\n        # verbose logging enable only for verbose information or troubleshooting\n        if self.cust_log_verbose == True:\n            for index, row in dataframe.iterrows():\n                if row[\"buy\"] == 1:\n                    buy_cond_details = f\"count={int(row['conditions_count'])}/v9_1={int(row['v9_buy_condition_1_enable'])}/v9_2={int(row['v9_buy_condition_2_enable'])}/v9_3={int(row['v9_buy_condition_3_enable'])}/v9_4={int(row['v9_buy_condition_4_enable'])}/v9_5={int(row['v9_buy_condition_5_enable'])}/v9_6={int(row['v9_buy_condition_6_enable'])}/v9_7={int(row['v9_buy_condition_7_enable'])}/v9_8={int(row['v9_buy_condition_8_enable'])}/v9_9={int(row['v9_buy_condition_9_enable'])}/v9_10={int(row['v9_buy_condition_10_enable'])}/v6_0={int(row['v6_buy_condition_0_enable'])}/v6_1={int(row['v6_buy_condition_1_enable'])}/v6_2={int(row['v6_buy_condition_2_enable'])}/v6_3={int(row['v6_buy_condition_3_enable'])}/v8_0={int(row['v8_buy_condition_0_enable'])}/v8_1={int(row['v8_buy_condition_1_enable'])}/v8_2={int(row['v8_buy_condition_2_enable'])}/v8_3={int(row['v8_buy_condition_3_enable'])}/v8_4={int(row['v8_buy_condition_4_enable'])}/sma_0={int(row['smaoffset_buy_condition_0_enable'])}/sma_1={int(row['smaoffset_buy_condition_1_enable'])}\"\n\n                    logger.info(\n                        f\"{metadata['pair']} - candle: {row['date']} - buy condition - details: {buy_cond_details}\"\n                    )\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe[\"ma_sell\"] = (\n            dataframe[f\"ma_sell_{self.base_nb_candles_sell.value}\"]\n            * self.high_offset.value\n        )\n        if self.smaoffset_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (qtpylib.crossed_below(dataframe[\"close\"], dataframe[\"ma_sell\"]))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_middleband\"] * 1.01)\n                    & (\n                        dataframe[\"volume\"] > 0\n                    )  # Don't be gready, sell fast  # Make sure Volume is not 0\n                )\n            )\n\n        if self.v8_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_upperband\"])\n                    & (dataframe[\"close\"].shift(1) > dataframe[\"bb_upperband\"].shift(1))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_sell_condition_1_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] > self.v8_sell_rsi_main.value)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n\n        return dataframe\n\n\n# --- custom indicators ---------------------------------------------------------------------------\n\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(\n        df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN)\n    )\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(\n        df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN)\n    )\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df[\"close\"] * 100\n    return emadif\n"
  },
  {
    "path": "strategies/BinClucMadV1/BinClucMadV1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter\nfrom functools import reduce\n\n\n###############################################################################\n#   this is the final adjustment version for all clucbinmad snip.\n#  here i am goin to ad (v5&v6) & v8 &v9 lets see what we can achive\n#   remember its production version no dev. should be lightweight\n#\n################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN))\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\nclass BinClucMadV1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # minimal_roi = {\n    #     \"0\": 0.028,  # I feel lucky!\n    #     \"10\": 0.018,\n    #     \"40\": 0.005,\n    # }\n    minimal_roi = {\n        \"0\": 0.038,  # I feel lucky!\n        \"10\": 0.028,\n        \"40\": 0.015,\n        \"180\": 0.018,  # We're going up?\n    }\n\n    stoploss = -0.99  # effectively disabled.\n\n    timeframe = \"5m\"\n    informative_timeframe = \"1h\"\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001  # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"v6_buy_condition_0_enable\": True,\n        \"v6_buy_condition_1_enable\": True,\n        \"v6_buy_condition_2_enable\": True,\n        \"v6_buy_condition_3_enable\": True,\n        \"v8_buy_condition_0_enable\": True,\n        \"v8_buy_condition_1_enable\": True,\n        \"v8_buy_condition_2_enable\": True,\n        \"v8_buy_condition_3_enable\": True,\n        \"v8_buy_condition_4_enable\": True,\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": False,\n        \"v9_buy_condition_2_enable\": False,\n        \"v9_buy_condition_3_enable\": False,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": False,\n        \"v9_buy_condition_6_enable\": False,\n        \"v9_buy_condition_7_enable\": False,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n    }\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"v9_sell_condition_0_enable\": False,\n        \"v8_sell_condition_0_enable\": True,\n        \"v8_sell_condition_1_enable\": False,\n    }\n    ############################################################################\n\n    # Buy CombinedBinHClucAndMADV6\n    v6_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v6_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    # Buy CombinedBinHClucV8\n    v8_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v8_buy_condition_4_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n\n    v8_sell_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n    v8_sell_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n\n    v8_sell_rsi_main = DecimalParameter(72.0, 90.0, default=80, space=\"sell\", decimals=2, optimize=False, load=True)\n    buy_dip_threshold_0 = DecimalParameter(0.001, 0.1, default=0.015, space=\"buy\", decimals=3, optimize=False, load=True)\n    buy_dip_threshold_1 = DecimalParameter(0.08, 0.2, default=0.12, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.02, 0.4, default=0.28, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.25, 0.44, default=0.36, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.04, default=0.031, space=\"buy\", optimize=False, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.021, space=\"buy\", optimize=False, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.2, 0.4, default=0.264, space=\"buy\", optimize=False, load=True)\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.992, space=\"buy\", optimize=False, load=True)\n    buy_bb20_volume = IntParameter(18, 36, default=29, space=\"buy\", optimize=False, load=True)\n    buy_rsi_diff = DecimalParameter(34.0, 60.0, default=50.48, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_min_inc = DecimalParameter(0.005, 0.05, default=0.01, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_rsi_1h = DecimalParameter(40.0, 70.0, default=67.0, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_rsi = DecimalParameter(30.0, 40.0, default=38.5, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_mfi = DecimalParameter(36.0, 65.0, default=36.0, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_volume_1 = DecimalParameter(1.0, 10.0, default=2.0, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_1 = DecimalParameter(0.01, 0.05, default=0.02, space=\"buy\", decimals=3, optimize=False, load=True)\n\n    sell_custom_roi_profit_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_rsi_1 = DecimalParameter(40.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_2 = DecimalParameter(\n        0.01, 0.20, default=0.04, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_rsi_2 = DecimalParameter(42.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_3 = DecimalParameter(\n        0.15, 0.30, default=0.08, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_rsi_3 = DecimalParameter(44.0, 58.0, default=56, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_4 = DecimalParameter(0.3, 0.7, default=0.14, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_4 = DecimalParameter(44.0, 60.0, default=58, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_5 = DecimalParameter(0.01, 0.1, default=0.04, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.1, space=\"sell\", decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.4, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.1, default=0.03, space=\"sell\", decimals=3, optimize=False, load=True)\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.02, space=\"sell\", decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.1, space=\"sell\", decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.015, space=\"sell\", decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_1 = DecimalParameter(\n        -0.15, -0.03, default=-0.05, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n\n    # Buy  CombinedBinHClucAndMADV9\n    v9_buy_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_1_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_2_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_3_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_4_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_5_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_6_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_7_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_8_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_9_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n    v9_buy_condition_10_enable = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False, load=True)\n\n    # Sell\n    v9_sell_condition_0_enable = CategoricalParameter([True, False], default=True, space=\"sell\", optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.99, space=\"buy\", optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space=\"buy\", optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=4, space=\"buy\", decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space=\"buy\", decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space=\"buy\", decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space=\"buy\", decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space=\"buy\", decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space=\"buy\", decimals=2, optimize=False, load=True)\n\n    def custom_stoplossv8(\n        self, pair: str, trade: \"Trade\", current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if current_profit > 0:\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=50)\n            # trade_time_240 = trade.open_date_utc + timedelta(minutes=240)\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if current_time > trade_time_50:\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n                    if (candle[\"sma_200_dec\"]) & (candle[\"sma_200_dec_1h\"]):\n                        return 0.01\n                    # We are at bottom. Wait...\n                    if candle[\"rsi_1h\"] < 30:\n                        return 0.99\n\n                    # Are we still sinking?\n                    if candle[\"close\"] > candle[\"ema_200\"]:\n                        if current_rate * 1.025 < candle[\"open\"]:\n                            return 0.01\n\n                    if current_rate * 1.015 < candle[\"open\"]:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n    def custom_stoploss(\n        self, pair: str, trade: \"Trade\", current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=280) > trade.open_date_utc):\n            return 0.01\n        elif current_profit < self.sell_custom_stoploss_1.value:\n            dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n            candle = dataframe.iloc[-1].squeeze()\n            if candle is not None:\n                # if (candle[\"sma_200_dec\"]) & (candle[\"sma_200_dec_1h\"]):\n                #     return 0.01\n                # We are at bottom. Wait...\n                if candle[\"rsi_1h\"] < 30:\n                    return 0.99\n                # Are we still sinking?\n                if candle[\"close\"] > candle[\"ema_200\"]:\n                    if current_rate * 1.025 < candle[\"open\"]:\n                        return 0.01\n                if current_rate * 1.015 < candle[\"open\"]:\n                    return 0.01\n\n        return 0.99\n\n    def custom_sell(\n        self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float, current_profit: float, **kwargs\n    ):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if last_candle is not None:\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_4.value\n            ):\n                return \"roi_target_4\"\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_3.value\n            ):\n                return \"roi_target_3\"\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_2.value\n            ):\n                return \"roi_target_2\"\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_1.value\n            ):\n                return \"roi_target_1\"\n            elif (\n                (current_profit > 0) & (current_profit < self.sell_custom_roi_profit_5.value) & (last_candle[\"sma_200_dec\"])\n            ):\n                return \"roi_target_5\"\n\n            elif (\n                (current_profit > self.sell_trail_profit_min_1.value)\n                & (current_profit < self.sell_trail_profit_max_1.value)\n                & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value))\n            ):\n                return \"trail_target_1\"\n            elif (\n                (current_profit > self.sell_trail_profit_min_2.value)\n                & (current_profit < self.sell_trail_profit_max_2.value)\n                & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value))\n            ):\n                return \"trail_target_2\"\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata[\"pair\"], timeframe=self.informative_timeframe)\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h[\"ema_100\"] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h[\"ema_200\"] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h[\"sma_200\"] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h[\"sma_200_dec\"] = informative_1h[\"sma_200\"] < informative_1h[\"sma_200\"].shift(20)\n        # RSI\n        informative_1h[\"rsi\"] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h[\"ssl_down\"] = ssl_down_1h\n        informative_1h[\"ssl_up\"] = ssl_up_1h\n        informative_1h[\"ssl-dir\"] = np.where(ssl_up_1h > ssl_down_1h, \"up\", \"down\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe[\"close\"], window=40, stds=2)\n        dataframe[\"lower\"] = bb_40[\"lower\"]\n        dataframe[\"mid\"] = bb_40[\"mid\"]\n        dataframe[\"bbdelta\"] = (bb_40[\"mid\"] - dataframe[\"lower\"]).abs()\n        dataframe[\"closedelta\"] = (dataframe[\"close\"] - dataframe[\"close\"].shift()).abs()\n        dataframe[\"tail\"] = (dataframe[\"close\"] - dataframe[\"low\"]).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n\n        dataframe[\"volume_mean_slow\"] = dataframe[\"volume\"].rolling(window=30).mean()\n\n        # EMA\n        dataframe[\"ema_12\"] = ta.EMA(dataframe, timeperiod=12)\n        dataframe[\"ema_26\"] = ta.EMA(dataframe, timeperiod=26)\n        dataframe[\"ema_50\"] = ta.EMA(dataframe, timeperiod=50)\n        dataframe[\"ema_200\"] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe[\"sma_5\"] = ta.EMA(dataframe, timeperiod=5)\n        dataframe[\"sma_200\"] = ta.SMA(dataframe, timeperiod=200)\n        dataframe[\"sma_200_dec\"] = dataframe[\"sma_200\"] < dataframe[\"sma_200\"].shift(20)\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n        # MFI\n        dataframe[\"mfi\"] = ta.MFI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        # START  V6\n        if self.v6_buy_condition_0_enable.value:\n            conditions.append(\n                (  # strategy ClucMay72018\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                    & (dataframe[\"close\"] < 0.99 * dataframe[\"bb_lowerband\"])\n                    & (  # Guard is on, candle should dig not so hard (0,99)\n                        dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                    &  # Try to exclude pumping\n                    # (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                        # Don't buy if someone drop the market.\n                    (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v6_buy_condition_1_enable.value:\n            conditions.append(\n                (  # strategy ClucMay72018\n                    (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                    & (dataframe[\"close\"] < 0.975 * dataframe[\"bb_lowerband\"])\n                    & (  # Guard is off, candle should dig hard (0,975)\n                        dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4)\n                    )\n                    & (dataframe[\"rsi_1h\"] < 15)  # Don't buy if someone drop the market.\n                    & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4)  # Buy only at dip\n                    & (dataframe[\"volume\"] > 0)  # Try to exclude pumping  # Make sure Volume is not 0\n                )\n            )\n        if self.v6_buy_condition_2_enable.value:\n            conditions.append(\n                (  # strategy MACD Low buy\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * 0.02))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))  # Don't buy if someone drop the market.\n                    & (dataframe[\"volume_mean_slow\"] > dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                    & (dataframe[\"volume\"] > 0)  # Try to exclude pumping  # Make sure Volume is not 0\n                )\n            )\n        if self.v6_buy_condition_3_enable.value:\n            conditions.append(\n                (  # strategy MACD Low buy\n                    (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * 0.03))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))  # Don't buy if someone drop the market.\n                    & (dataframe[\"volume\"] > 0)  # Make sure Volume is not 0\n                )\n            )\n        # END  V6\n        if self.v8_buy_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                    & (\n                        ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_1.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_2.value\n                    )\n                    & dataframe[\"lower\"].shift().gt(0)\n                    & dataframe[\"bbdelta\"].gt(dataframe[\"close\"] * self.buy_bb40_bbdelta_close.value)\n                    & dataframe[\"closedelta\"].gt(dataframe[\"close\"] * self.buy_bb40_closedelta_close.value)\n                    & dataframe[\"tail\"].lt(dataframe[\"bbdelta\"] * self.buy_bb40_tail_bbdelta.value)\n                    & dataframe[\"close\"].lt(dataframe[\"lower\"].shift())\n                    & dataframe[\"close\"].le(dataframe[\"close\"].shift())\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_buy_condition_1_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                    & (\n                        ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_1.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_2.value\n                    )\n                    & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                    & (dataframe[\"close\"] < self.buy_bb20_close_bblowerband.value * dataframe[\"bb_lowerband\"])\n                    & (dataframe[\"volume\"] < (dataframe[\"volume_mean_slow\"].shift(1) * self.buy_bb20_volume.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_buy_condition_2_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                    & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                    & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                    & (\n                        ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_1.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_2.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_3.value\n                    )\n                    & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - self.buy_rsi_diff.value)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_buy_condition_3_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"sma_200\"] > dataframe[\"sma_200\"].shift(20))\n                    & (dataframe[\"sma_200_1h\"] > dataframe[\"sma_200_1h\"].shift(16))\n                    & (\n                        ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_1.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_2.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_3.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(24).min() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        > self.buy_min_inc.value\n                    )\n                    & (dataframe[\"rsi_1h\"] > self.buy_rsi_1h.value)\n                    & (dataframe[\"rsi\"] < self.buy_rsi.value)\n                    & (dataframe[\"mfi\"] < self.buy_mfi.value)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_buy_condition_4_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_100_1h\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                    & (\n                        ((dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_1.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_2.value\n                    )\n                    & (\n                        ((dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"]) / dataframe[\"close\"])\n                        < self.buy_dip_threshold_3.value\n                    )\n                    & (dataframe[\"volume\"].rolling(4).mean() * self.buy_volume_1.value > dataframe[\"volume\"])\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_ema_open_mult_1.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n\n        # START  VERSION9\n        if self.v9_buy_condition_1_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"] * self.buy_bb20_close_bblowerband_safe_1.value)\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"open\"] - dataframe[\"close\"]\n                        < dataframe[\"bb_upperband\"].shift(2) - dataframe[\"bb_lowerband\"].shift(2)\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_2_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"] * self.buy_bb20_close_bblowerband_safe_2.value)\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"open\"] - dataframe[\"close\"]\n                        < dataframe[\"bb_upperband\"].shift(2) - dataframe[\"bb_lowerband\"].shift(2)\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_3_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                    & (dataframe[\"rsi\"] < self.buy_rsi_3.value)\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_4_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_1.value)\n                    & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_5_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                    & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_1.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)  # Make sure Volume is not 0\n                )\n            )\n        if self.v9_buy_condition_6_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_2.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_7_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_2.value)\n                    & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                    & ((dataframe[\"ema_26\"] - dataframe[\"ema_12\"]) > (dataframe[\"open\"] * self.buy_macd_1.value))\n                    & ((dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift()) > (dataframe[\"open\"] / 100))\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_8_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_3.value)\n                    & (dataframe[\"rsi\"] < self.buy_rsi_1.value)\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_9_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_4.value)\n                    & (dataframe[\"rsi\"] < self.buy_rsi_2.value)\n                    & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value))\n                    & (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * self.buy_volume_pump_1.value\n                    )\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_buy_condition_10_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                    & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                    & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                    & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - 43.276)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        # END  V9\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"buy\"] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        if self.v9_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_middleband\"] * 1.01)\n                    & (dataframe[\"volume\"] > 0)  # Don't be gready, sell fast  # Make sure Volume is not 0\n                )\n            )\n\n        if self.v8_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_upperband\"])\n                    & (dataframe[\"close\"].shift(1) > dataframe[\"bb_upperband\"].shift(1))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_sell_condition_1_enable.value:\n            conditions.append(\n                (qtpylib.crossed_above(dataframe[\"rsi\"], self.v8_sell_rsi_main.value) & (dataframe[\"volume\"] > 0))\n            )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/BinHV27/BinHV27.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\n\nclass BinHV27(IStrategy):\n    \"\"\"\n\n        strategy sponsored by user BinH from slack\n\n    \"\"\"\n\n    minimal_roi = {\n        \"0\": 1\n    }\n\n    stoploss = -0.50\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = numpy.nan_to_num(ta.RSI(dataframe, timeperiod=5))\n        rsiframe = DataFrame(dataframe['rsi']).rename(columns={'rsi': 'close'})\n        dataframe['emarsi'] = numpy.nan_to_num(ta.EMA(rsiframe, timeperiod=5))\n        dataframe['adx'] = numpy.nan_to_num(ta.ADX(dataframe))\n        dataframe['minusdi'] = numpy.nan_to_num(ta.MINUS_DI(dataframe))\n        minusdiframe = DataFrame(dataframe['minusdi']).rename(columns={'minusdi': 'close'})\n        dataframe['minusdiema'] = numpy.nan_to_num(ta.EMA(minusdiframe, timeperiod=25))\n        dataframe['plusdi'] = numpy.nan_to_num(ta.PLUS_DI(dataframe))\n        plusdiframe = DataFrame(dataframe['plusdi']).rename(columns={'plusdi': 'close'})\n        dataframe['plusdiema'] = numpy.nan_to_num(ta.EMA(plusdiframe, timeperiod=5))\n        dataframe['lowsma'] = numpy.nan_to_num(ta.EMA(dataframe, timeperiod=60))\n        dataframe['highsma'] = numpy.nan_to_num(ta.EMA(dataframe, timeperiod=120))\n        dataframe['fastsma'] = numpy.nan_to_num(ta.SMA(dataframe, timeperiod=120))\n        dataframe['slowsma'] = numpy.nan_to_num(ta.SMA(dataframe, timeperiod=240))\n        dataframe['bigup'] = dataframe['fastsma'].gt(dataframe['slowsma']) & ((dataframe['fastsma'] - dataframe['slowsma']) > dataframe['close'] / 300)\n        dataframe['bigdown'] = ~dataframe['bigup']\n        dataframe['trend'] = dataframe['fastsma'] - dataframe['slowsma']\n        dataframe['preparechangetrend'] = dataframe['trend'].gt(dataframe['trend'].shift())\n        dataframe['preparechangetrendconfirm'] = dataframe['preparechangetrend'] & dataframe['trend'].shift().gt(dataframe['trend'].shift(2))\n        dataframe['continueup'] = dataframe['slowsma'].gt(dataframe['slowsma'].shift()) & dataframe['slowsma'].shift().gt(dataframe['slowsma'].shift(2))\n        dataframe['delta'] = dataframe['fastsma'] - dataframe['fastsma'].shift()\n        dataframe['slowingdown'] = dataframe['delta'].lt(dataframe['delta'].shift())\n        return dataframe\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            dataframe['slowsma'].gt(0) &\n            dataframe['close'].lt(dataframe['highsma']) &\n            dataframe['close'].lt(dataframe['lowsma']) &\n            dataframe['minusdi'].gt(dataframe['minusdiema']) &\n            dataframe['rsi'].ge(dataframe['rsi'].shift()) &\n            (\n              (\n                ~dataframe['preparechangetrend'] &\n                ~dataframe['continueup'] &\n                dataframe['adx'].gt(25) &\n                dataframe['bigdown'] &\n                dataframe['emarsi'].le(20)\n              ) |\n              (\n                ~dataframe['preparechangetrend'] &\n                dataframe['continueup'] &\n                dataframe['adx'].gt(30) &\n                dataframe['bigdown'] &\n                dataframe['emarsi'].le(20)\n              ) |\n              (\n                ~dataframe['continueup'] &\n                dataframe['adx'].gt(35) &\n                dataframe['bigup'] &\n                dataframe['emarsi'].le(20)\n              ) |\n              (\n                dataframe['continueup'] &\n                dataframe['adx'].gt(30) &\n                dataframe['bigup'] &\n                dataframe['emarsi'].le(25)\n              )\n            ),\n            'buy'] = 1\n        return dataframe\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n              (\n                ~dataframe['preparechangetrendconfirm'] &\n                ~dataframe['continueup'] &\n                (dataframe['close'].gt(dataframe['lowsma']) | dataframe['close'].gt(dataframe['highsma'])) &\n                dataframe['highsma'].gt(0) &\n                dataframe['bigdown']\n              ) |\n              (\n                ~dataframe['preparechangetrendconfirm'] &\n                ~dataframe['continueup'] &\n                dataframe['close'].gt(dataframe['highsma']) &\n                dataframe['highsma'].gt(0) &\n                (dataframe['emarsi'].ge(75) | dataframe['close'].gt(dataframe['slowsma'])) &\n                dataframe['bigdown']\n              ) |\n              (\n                ~dataframe['preparechangetrendconfirm'] &\n                dataframe['close'].gt(dataframe['highsma']) &\n                dataframe['highsma'].gt(0) &\n                dataframe['adx'].gt(30) &\n                dataframe['emarsi'].ge(80) &\n                dataframe['bigup']\n              ) |\n              (\n                dataframe['preparechangetrendconfirm'] &\n                ~dataframe['continueup'] &\n                dataframe['slowingdown'] &\n                dataframe['emarsi'].ge(75) &\n                dataframe['slowsma'].gt(0)\n              ) |\n              (\n                dataframe['preparechangetrendconfirm'] &\n                dataframe['minusdi'].lt(dataframe['plusdi']) &\n                dataframe['close'].gt(dataframe['lowsma']) &\n                dataframe['slowsma'].gt(0)\n              )\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/BinHV45/BinHV45.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import IntParameter\nfrom pandas import DataFrame\nimport numpy as np\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n\n    return rolling_mean, lower_band\n\n\nclass BinHV45(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.0125\n    }\n\n    stoploss = -0.05\n    timeframe = '1m'\n\n    buy_bbdelta = IntParameter(low=1, high=15, default=30, space='buy', optimize=True)\n    buy_closedelta = IntParameter(low=15, high=20, default=30, space='buy', optimize=True)\n    buy_tail = IntParameter(low=20, high=30, default=30, space='buy', optimize=True)\n\n    # Hyperopt parameters\n    buy_params = {\n        \"buy_bbdelta\": 7,\n        \"buy_closedelta\": 17,\n        \"buy_tail\": 25,\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n\n        dataframe['upper'] = bollinger['upper']\n        dataframe['mid'] = bollinger['mid']\n        dataframe['lower'] = bollinger['lower']\n        dataframe['bbdelta'] = (dataframe['mid'] - dataframe['lower']).abs()\n        dataframe['pricedelta'] = (dataframe['open'] - dataframe['close']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bbdelta.value / 1000) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_closedelta.value / 1000) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_tail.value / 1000) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift())\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        no sell signal\n        \"\"\"\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/BinHV45HO/BinHV45HO.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\nfrom freqtrade.strategy import DecimalParameter\nimport numpy as np\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n\n    return rolling_mean, lower_band\n\n\nclass BinHV45HO(IStrategy):\n    buy_params = {\n        \"df_close_bbdelta\": 0.057,\n        \"df_close_closedelta\": 0.016,\n        \"df_tail_bbdelta\": 0.293,\n    }\n\n    minimal_roi = {\n        \"0\": 0.0125\n    }\n\n    stoploss = -0.19\n    timeframe = '1m'\n\n    df_close_bbdelta = DecimalParameter(0.005, 0.06, default=0.008, space='buy', optimize=False, load=True)\n    df_close_closedelta = DecimalParameter(0.01, 0.03, default=0.0175, space='buy', optimize=False, load=True)\n    df_tail_bbdelta = DecimalParameter(0.15, 0.45, default=0.25, space='buy', optimize=False, load=True)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['mid'] = np.nan_to_num(mid)\n        dataframe['lower'] = np.nan_to_num(lower)\n        dataframe['bbdelta'] = (dataframe['mid'] - dataframe['lower']).abs()\n        dataframe['pricedelta'] = (dataframe['open'] - dataframe['close']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.df_close_bbdelta.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.df_close_closedelta.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.df_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift())\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        no sell signal\n        \"\"\"\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/BreakEven/BreakEven.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n\nclass BreakEven(IStrategy):\n    \"\"\"\n    author@: lenik\n\n    Sometimes I want to close the bot ASAP, but not have the positions floating around.\n\n    I can \"/stopbuy\" and wait for the positions to get closed by the bot rules, which is\n    waiting for some profit, etc -- this usually takes too long...\n    \n    What I would prefer is to close everything that is over 0% profit to avoid the losses.\n\n    Here's a simple strategy with empty buy/sell signals and \"minimal_roi = { 0 : 0 }\" that\n    sells everything already at profit and wait until the positions at loss will come to break\n    even point (or the small profit you provide in ROI table).\n    \n    You may restart the bot with the new strategy as a command-line parameter.\n\n    Another way would be to specify the original strategy in the config file, then change to\n    this one and simply \"/reload_config\" from the Telegram bot.\n\n    \"\"\"\n\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01,      # at least 1% at first\n        \"10\": 0         # after 10min, everything goes \n    }\n\n    # This is more radical version that sells everything above the profit level\n#    minimal_roi = {\n#        \"0\": 0\n#    }\n\n    # And this is basically \"/forcesell all\", that sells no matter what profit\n#    minimal_roi = {\n#        \"0\": -1\n#    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # don't generate any buy or sell signals, everything is handled by ROI and stop_loss\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'buy'] = 0\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/BuyAllSellAllStrategy/BuyAllSellAllStrategy.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\nimport numpy as np\n\n\nclass BuyAllSellAllStrategy(IStrategy):\n    stoploss = -0.25\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe[\"buy\"] = np.random.randint(0, 2, size=len(dataframe))\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe[\"sell\"] = 0\n        return dataframe\n\n    def custom_sell(\n        self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        if (last_candle is not None):\n            return True\n        return None\n"
  },
  {
    "path": "strategies/BuyOnly/BuyOnly.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass BuyOnly(IStrategy):\n    \"\"\"\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\"60\": 0.01, \"30\": 0.02, \"0\": 0.04}\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = \"15m\"\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        \"buy\": \"limit\",\n        \"sell\": \"limit\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": True,\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\"buy\": \"gtc\", \"sell\": \"gtc\"}\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        \"main_plot\": {\n            \"tema\": {},\n            \"sar\": {\"color\": \"white\"},\n        },\n        \"subplots\": {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                \"macd\": {\"color\": \"blue\"},\n                \"macdsignal\": {\"color\": \"orange\"},\n            },\n            \"RSI\": {\n                \"rsi\": {\"color\": \"red\"},\n            },\n        },\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        # dataframe[\"adx\"] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        # stoch_fast = ta.STOCHF(dataframe)\n        # dataframe[\"fastd\"] = stoch_fast[\"fastd\"]\n        # dataframe[\"fastk\"] = stoch_fast[\"fastk\"]\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe[\"macd\"] = macd[\"macd\"]\n        dataframe[\"macdsignal\"] = macd[\"macdsignal\"]\n        dataframe[\"macdhist\"] = macd[\"macdhist\"]\n\n        # MFI\n        # dataframe[\"mfi\"] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n        dataframe[\"bb_percent\"] = (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) / (\n            dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]\n        )\n        dataframe[\"bb_width\"] = (\n            dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]\n        ) / dataframe[\"bb_middleband\"]\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe[\"sar\"] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe[\"tema\"] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        # hilbert = ta.HT_SINE(dataframe)\n        # dataframe[\"htsine\"] = hilbert[\"sine\"]\n        # dataframe[\"htleadsine\"] = hilbert[\"leadsine\"]\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # Signals\n                (qtpylib.crossed_above(dataframe[\"rsi\"], 30))\n                & (dataframe[\"open\"] <= dataframe[\"bb_lowerband\"])\n                # Guards\n                & (dataframe[\"tema\"] > dataframe[\"tema\"].shift(1))\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"buy\",\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        HODL\n        \"\"\"\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CBPete9/CBPete9.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter\n\n\n###########################################################################################################\n##                CombinedBinHClucAndMADV9 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  10 buy signals                                                                              ##\n##        -  new stoploss function, preventing from big fall                                             ##\n##                                                                                                       ##\n###########################################################################################################\n##      How to use:                                                                                      ##\n##        - no need to HyperOpt                                                                          ##\n##        - before use it check the docs -                                                               ##\n##          https://www.freqtrade.io/en/stable/configuration/#market-order-pricing                       ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##   With my pairlist which can be found in this repo.                                                   ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass CBPete9(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,          # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = False\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.003\n    trailing_stop_positive_offset = 0.0187\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": False,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n    }\n\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.99, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # Are we still sinking?\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 5%\n                    return 0.01\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (    \n                self.buy_condition_1_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * self.buy_volume_pump_1.value) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * self.buy_volume_pump_1.value) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_4_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_5_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * self.buy_volume_pump_1.value) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (   \n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * self.buy_volume_pump_1.value) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (   \n                self.buy_condition_8_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * self.buy_volume_pump_1.value) &\n                (dataframe['volume'] > 0)\n            )\n            |   \n            (   \n                self.buy_condition_9_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * self.buy_volume_pump_1.value) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - 43.276) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CCIStrategy/CCIStrategy.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass CCIStrategy(IStrategy):\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.02\n\n    # Optimal timeframe for the strategy\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = self.resample(dataframe, self.timeframe, 5)\n\n        dataframe['cci_one'] = ta.CCI(dataframe, timeperiod=170)\n        dataframe['cci_two'] = ta.CCI(dataframe, timeperiod=34)\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        dataframe['cmf'] = self.chaikin_mf(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['cci_one'] < -100)\n                    & (dataframe['cci_two'] < -100)\n                    & (dataframe['cmf'] < -0.1)\n                    & (dataframe['mfi'] < 25)\n\n                    # insurance\n                    & (dataframe['resample_medium'] > dataframe['resample_short'])\n                    & (dataframe['resample_long'] < dataframe['close'])\n\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['cci_one'] > 100)\n                    & (dataframe['cci_two'] > 100)\n                    & (dataframe['cmf'] > 0.3)\n                    & (dataframe['resample_sma'] < dataframe['resample_medium'])\n                    & (dataframe['resample_medium'] < dataframe['resample_short'])\n\n            ),\n            'sell'] = 1\n        return dataframe\n\n    def chaikin_mf(self, df, periods=20):\n        close = df['close']\n        low = df['low']\n        high = df['high']\n        volume = df['volume']\n\n        mfv = ((close - low) - (high - close)) / (high - low)\n        mfv = mfv.fillna(0.0)  # float division by zero\n        mfv *= volume\n        cmf = mfv.rolling(periods).sum() / volume.rolling(periods).sum()\n\n        return Series(cmf, name='cmf')\n\n    def resample(self, dataframe, interval, factor):\n        # defines the reinforcement logic\n        # resampled dataframe to establish if we are in an uptrend, downtrend or sideways trend\n        df = dataframe.copy()\n        df = df.set_index(DatetimeIndex(df['date']))\n        ohlc_dict = {\n            'open': 'first',\n            'high': 'max',\n            'low': 'min',\n            'close': 'last'\n        }\n        df = df.resample(str(int(interval[:-1]) * factor) + 'min', label=\"right\").agg(ohlc_dict)\n        df['resample_sma'] = ta.SMA(df, timeperiod=100, price='close')\n        df['resample_medium'] = ta.SMA(df, timeperiod=50, price='close')\n        df['resample_short'] = ta.SMA(df, timeperiod=25, price='close')\n        df['resample_long'] = ta.SMA(df, timeperiod=200, price='close')\n        df = df.drop(columns=['open', 'high', 'low', 'close'])\n        df = df.resample(interval[:-1] + 'min')\n        df = df.interpolate(method='time')\n        df['date'] = df.index\n        df.index = range(len(df))\n        dataframe = merge(dataframe, df, on='date', how='left')\n        return dataframe\n"
  },
  {
    "path": "strategies/CMCWinner/CMCWinner.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n\n# This class is a sample. Feel free to customize it.\nclass CMCWinner(IStrategy):\n    \"\"\"\n    This is a test strategy to inspire you.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"40\": 0.0,\n        \"30\": 0.02,\n        \"20\": 0.03,\n        \"0\": 0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '15m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # Commodity Channel Index: values Oversold:<-100, Overbought:>100\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n\t\t# CMO\n        dataframe['cmo'] = ta.CMO(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['cci'].shift(1) < -100) &\n                (dataframe['mfi'].shift(1) < 20) &\n                (dataframe['cmo'].shift(1) < -50)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['cci'].shift(1) > 100) &\n                (dataframe['mfi'].shift(1) > 80) &\n                (dataframe['cmo'].shift(1) > 50)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Cci/Cci.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Cci(IStrategy):\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.18967,\n        \"28\": 0.07749,\n        \"72\": 0.03823,\n        \"180\": 0\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.23\n\n    # Optimal timeframe for the strategy\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = self.resample(dataframe, self.timeframe, 5)\n\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=18)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['cci'] < -198)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['cci'] > 197)\n            ),\n            'sell'] = 1\n        return dataframe\n\n\n    def resample(self, dataframe, interval, factor):\n        # defines the reinforcement logic\n        # resampled dataframe to establish if we are in an uptrend, downtrend or sideways trend\n        df = dataframe.copy()\n        df = df.set_index(DatetimeIndex(df['date']))\n        ohlc_dict = {\n            'open': 'first',\n            'high': 'max',\n            'low': 'min',\n            'close': 'last'\n        }\n        df = df.resample(str(int(interval[:-1]) * factor) + 'min', label=\"right\").agg(ohlc_dict)\n        df['resample_sma'] = ta.SMA(df, timeperiod=100, price='close')\n        df['resample_medium'] = ta.SMA(df, timeperiod=50, price='close')\n        df['resample_short'] = ta.SMA(df, timeperiod=25, price='close')\n        df['resample_long'] = ta.SMA(df, timeperiod=200, price='close')\n        df = df.drop(columns=['open', 'high', 'low', 'close'])\n        df = df.resample(interval[:-1] + 'min')\n        df = df.interpolate(method='time')\n        df['date'] = df.index\n        df.index = range(len(df))\n        dataframe = merge(dataframe, df, on='date', how='left')\n        return dataframe"
  },
  {
    "path": "strategies/Chandem/Chandem.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Chandem(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.28396,\n        \"974\": 0.09268,\n        \"1740\": 0.06554,\n        \"3087\": 0\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.28031\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01013\n    trailing_stop_positive_offset = 0.10858\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 50)\n        # Bollinger bands\n        \n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=25, stds=3.5)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        bollingerTA = ta.BBANDS(dataframe, timeperiod=25, nbdevup=3.2, nbdevdn=3.2, matype=0)\n        \n        dataframe['bb_lowerbandTA'] = bollingerTA['lowerband']\n        dataframe['bb_middlebandTA'] = bollingerTA['middleband']\n        dataframe['bb_upperbandTA'] = bollingerTA['upperband']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        dataframe.loc[\n            (\n                 (qtpylib.crossed_above(dataframe[\"CMO\"].shift(1), 0)) & \n                 (dataframe[\"CMO\"]>=0)\n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['close'],dataframe['bb_upperband']))\n                \n                \n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/Chandemtwo/Chandemtwo.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Chandemtwo(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.75242,\n        \"827\": 0.39114,\n        \"2168\": 0.34123,\n        \"3527\": 0\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.33572\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01523\n    trailing_stop_positive_offset = 0.10329\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 50)\n        # Bollinger bands\n        \n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=25, stds=3.5)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        bollingerTA = ta.BBANDS(dataframe, timeperiod=25, nbdevup=3.2, nbdevdn=3.2, matype=0)\n        \n        dataframe['bb_lowerbandTA'] = bollingerTA['lowerband']\n        dataframe['bb_middlebandTA'] = bollingerTA['middleband']\n        dataframe['bb_upperbandTA'] = bollingerTA['upperband']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        dataframe.loc[\n            (\n                 (qtpylib.crossed_above(dataframe[\"CMO\"].shift(2), 0)) & \n                 (dataframe[\"CMO\"].shift(1) >=0) &\n                 (dataframe[\"CMO\"]>=0)\n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['close'],dataframe['bb_upperband']))\n                | (qtpylib.crossed_below(dataframe[\"CMO\"], -35))\n                \n                \n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/Chispei/Chispei.py",
    "content": "# Freqtrade_backtest_validation_freqtrade1.py\n# This script is 1 of a pair the other being freqtrade_backtest_validation_tradingview1\n# These should be executed on their respective platforms for the same coin/period/resolution\n# The purpose is to test Freqtrade backtest provides like results to a known industry platform.\n#\n# --- Do not remove these libs ---\n#\n#\n#\n# - EDIT: \"Maybe the sucess of a trading system is part of strategy and also a good config.son too!\"\n#\n#\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\n\n\nclass Chispei(IStrategy):\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n\t    \"5127\": 0,\n\t    \"1836\": 0.676,\n\t    \"2599\": 0.079,\n        \"120\": 0.10,\n\t    \"60\": 0.10,\n        \"30\": 0.05,\n        \"20\": 0.05,\n        \"0\": 0.04\n    }\n\n    stoploss = -0.32336\n    ticker_interval = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # SMA - Simple Moving Average\n        dataframe['fastMA'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['slowMA'] = ta.SMA(dataframe, timeperiod=25)\n        dataframe['mom'] = ta.MOM(dataframe, timeperiod=21)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['mom'] < 15) &\n                (dataframe['fastMA'] > dataframe['slowMA'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['mom'] < 80) &\n                (dataframe['fastMA'] < dataframe['slowMA'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Cluc4/Cluc4.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\nclass Cluc4(IStrategy):\n    minimal_roi = {\n        \"0\": 0.015,\n        \"20\": 0.005,\n        \"30\": 0.001\n    }\n\n    stoploss = -0.01\n    \n    timeframe = '1m'\n\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['rocr'] = ta.ROCR(dataframe, timeperiod=28)\n        inf_tf = '1h'\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        informative['rocr'] = ta.ROCR(informative, timeperiod=168)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                dataframe['rocr_1h'].gt(0.65)\n            ) &\n            ((      dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * 0.006) &\n                    dataframe['closedelta'].gt(dataframe['close'] * 0.013) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * 0.968) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (       (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < 0.013 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 28))\n            )),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n            #((qtpylib.crossed_above(dataframe['close'],(dataframe['bb_middleband'] * 1.1))) &\n            ((qtpylib.crossed_above(dataframe['close'],dataframe['bb_middleband'])) &\n            (dataframe['volume'] > 0))\n            ,\n            'sell'\n        ] = 1\n        return dataframe"
  },
  {
    "path": "strategies/Cluc4werk/Cluc4werk.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\nclass Cluc4werk(IStrategy):\n\n    # Used for \"informative pairs\"\n    stake = 'BTC'\n    fiat  = 'USD'\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.00793,\n        'bbdelta-tail': 0.83802,\n        'close-bblower': 0.0034,\n        'closedelta-close': 0.00613,\n        'rocr-1h': 0.64081,\n        'volume': 21\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'sell-bbmiddle-close': 0.97703\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.0155,\n        \"109\": 0.01075,\n        \"393\": 0.00771,\n        \"587\": 0.00643,\n        \"711\": 0.00377,\n        \"770\": 0.00114,\n        \"1039\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.31742\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.31289\n    trailing_stop_positive_offset = 0.33275\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '1m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.0\n    ignore_roi_if_buy_signal = True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        \"\"\"\n        Idea is to have \"STAKE/USD\" and \"COIN/USD\" as informative pairs as they move inverse of COIN/STAKE.\n        For example, stake currency is BTC, whitelist is */BTC\n        Current pair being examined (metadata['pair']) is XLM/BTC\n        Be able to have informative pairs BTC/USD and XLM/USD available for use with some indicators for all pairs in the whitelist.\n        Ideally have this work gracefully with a change to the stake/whitelist in the config file.\n        If a desired informative pair does not exist (e.g. if exchange doesnt trade XLM/USD in this example), simply ignore those indicators without errors.\n        \"\"\"\n\n        coin, stake = metadata['pair'].split('/')\n        \n        informative_pairs += [(\"ETH/USD\", timeframe),\n                              (\"BTC/USD\", timeframe),\n                             ]\n\n        \n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['rocr'] = ta.ROCR(dataframe, timeperiod=28)\n        \n        inf_tf = '1h'\n        \n        \"\"\"\n        informative = self.dp.get_pair_dataframe(pair=\"ETH/USDT\", timeframe=\"5m\")\n        # ETH/USDT RSI based on 5m candles\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, '5m', ffill=True)\n        \"\"\"\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        informative['rocr'] = ta.ROCR(informative, timeperiod=168)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            (\n                dataframe['rocr_1h'].gt(params['rocr-1h'])\n            ) &\n            ((      \n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * params['bbdelta-close']) &\n                    dataframe['closedelta'].gt(dataframe['close'] * params['closedelta-close']) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * params['bbdelta-tail']) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (       \n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < params['close-bblower'] * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * params['volume']))\n            )),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            #(dataframe['high'].le(dataframe['high'].shift(1))) &\n            #(dataframe['close'] > dataframe['bb_middleband']) &\n            (qtpylib.crossed_above((dataframe['close'] * params['sell-bbmiddle-close']),dataframe['bb_middleband'])) &\n            #(qtpylib.crossed_above(dataframe['close'],dataframe['bb_middleband'])) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/Cluc5werk/Cluc5werk.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\nclass Cluc5werk(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n\n    # 989/1000:    331 trades. 305/9/17 Wins/Draws/Losses. Avg profit   1.54%. Median profit   2.13%. Total profit  0.00510181 BTC ( 509.36Σ%). Avg duration 367.3 min. Objective: -0.69786\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.01853,\n        'bbdelta-tail': 0.78758,\n        'close-bblower': 0.00931,\n        'closedelta-close': 0.00169,\n        'rocr-1h': 0.8973,\n        'volume': 35\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'sell-bbmiddle-close': 0.97103\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.02134,\n        \"275\": 0.01745,\n        \"559\": 0.01618,\n        \"621\": 0.0131,\n        \"791\": 0.00843,\n        \"1048\": 0.00443,\n        \"1074\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.22405\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.18622\n    trailing_stop_positive_offset = 0.23091\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '1m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.0\n    ignore_roi_if_buy_signal = True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['rocr'] = ta.ROCR(dataframe, timeperiod=28)\n        \n        inf_tf = '1h'\n        \n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        informative['rocr'] = ta.ROCR(informative, timeperiod=168)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            (\n                dataframe['rocr_1h'].gt(params['rocr-1h'])\n            ) &\n            ((      \n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * params['bbdelta-close']) &\n                    dataframe['closedelta'].gt(dataframe['close'] * params['closedelta-close']) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * params['bbdelta-tail']) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (       \n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < params['close-bblower'] * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * params['volume']))\n            )),\n            'fake_buy'\n        ] = 1\n\n        dataframe.loc[\n            (dataframe['fake_buy'].shift(1).eq(1)) &            \n            (dataframe['fake_buy'].eq(1)) &\n            (dataframe['volume'] > 0)\n            ,\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            (dataframe['high'].le(dataframe['high'].shift(1))) &\n            (dataframe['high'].shift(1).le(dataframe['high'].shift(2))) &\n            (dataframe['close'].le(dataframe['close'].shift(1))) &\n            ((dataframe['close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\nclass Cluc5werk_ETH(Cluc5werk):\n\n    # hyperopt --config user_data/config-backtest-USD.json --hyperopt Cluc5werkHyperopt --hyperopt-loss OnlyProfitHyperOptLoss --strategy Cluc5werk_USD -e 1000 --spaces buy --timeframe 1m --timerange 20210101- \n    # 677/1000:    618 trades. 581/20/17 Wins/Draws/Losses. Avg profit   1.23%. Median profit   1.65%. Total profit  379.36403713 USD ( 757.52Σ%). Avg duration 297.5 min. Objective: -1.52505\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.00902,\n        'bbdelta-tail': 0.91508,\n        'close-bblower': 0.00603,                                                                                                                                                              \n        'closedelta-close': 0.00424,\n        'rocr-1h': 0.93725,\n        'volume': 38\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'sell-bbmiddle-close': 0.97181\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01648,\n        \"38\": 0.01484,\n        \"303\": 0.01317,\n        \"597\": 0.00952,\n        \"869\": 0.00724,\n        \"896\": 0.00253,\n        \"1062\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.33703\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.29564\n    trailing_stop_positive_offset = 0.38855\n    trailing_only_offset_is_reached = False\n\nclass Cluc5werk_BTC(Cluc5werk):\n\n    # hyperopt --config user_data/config-backtest-BTC.json --hyperopt Cluc5werkHyperopt --hyperopt-loss OnlyProfitHyperOptLoss --strategy Cluc5werk_BTC -e 500 --spaces all --timeframe 1m --timerange 20210101-\n    # 125/500:    422 trades. 369/14/39 Wins/Draws/Losses. Avg profit   0.97%. Median profit   2.18%. Total profit  0.00408737 BTC ( 408.13Σ%). Avg duration 307.8 min. Objective: -0.36043\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.01511,\n        'bbdelta-tail': 0.90705,\n        'close-bblower': 0.01972,\n        'closedelta-close': 0.00099,\n        'rocr-1h': 0.97131,\n        'volume': 27\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'sell-bbmiddle-close': 0.97906\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.0218,\n        \"242\": 0.02079,\n        \"308\": 0.01803,\n        \"372\": 0.01325,\n        \"390\": 0.00905,\n        \"619\": 0.00467,\n        \"737\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.14515\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.03046\n    trailing_stop_positive_offset = 0.04631\n    trailing_only_offset_is_reached = True\n\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\nclass Cluc5werk_USD(Cluc5werk):\n\n    # hyperopt --config user_data/config-backtest-USD.json --hyperopt Cluc5werkHyperopt --hyperopt-loss OnlyProfitHyperOptLoss --strategy Cluc5werk_USD -e 1000 --spaces buy --timeframe 1m --timerange 20210101- \n    # 677/1000:    618 trades. 581/20/17 Wins/Draws/Losses. Avg profit   1.23%. Median profit   1.65%. Total profit  379.36403713 USD ( 757.52Σ%). Avg duration 297.5 min. Objective: -1.52505\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.00902,\n        'bbdelta-tail': 0.91508,\n        'close-bblower': 0.00603,                                                                                                                                                              \n        'closedelta-close': 0.00424,\n        'rocr-1h': 0.93725,\n        'volume': 38\n    }\n\n    # hyperopt --config user_data/config-backtest-USD.json --hyperopt Cluc5werkHyperopt --hyperopt-loss OnlyProfitHyperOptLoss --strategy Cluc5werk_USD -e 250 --spaces sell --timeframe 1m --timerange 20210101- \n    # 38/250:    609 trades. 573/20/16 Wins/Draws/Losses. Avg profit   1.25%. Median profit   1.65%. Total profit  382.03235064 USD ( 762.84Σ%). Avg duration 304.3 min. Objective: -1.54281\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-bbmiddle-close': 0.97008\n    }\n\n    # hyperopt --config user_data/config-backtest-USD.json --hyperopt Cluc5werkHyperopt --hyperopt-loss OnlyProfitHyperOptLoss --strategy Cluc5werk_USD -e 250 --spaces roi --timeframe 1m --timerange 20210101- \n    # 139/250:    575 trades. 531/28/16 Wins/Draws/Losses. Avg profit   1.38%. Median profit   1.88%. Total profit  396.08871240 USD ( 790.91Σ%). Avg duration 330.9 min. Objective: -1.63637\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01887,\n        \"150\": 0.016,\n        \"243\": 0.01193,\n        \"471\": 0.0103,\n        \"475\": 0.00687,\n        \"744\": 0.00271,\n        \"793\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.33703\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.29564\n    trailing_stop_positive_offset = 0.38855\n    trailing_only_offset_is_reached = False"
  },
  {
    "path": "strategies/Cluc7werk/Cluc7werk.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\n\nclass Cluc7werk(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.00732,\n        'bbdelta-tail': 0.94138,\n        'close-bblower': 0.0199,\n        'closedelta-close': 0.01825,\n        'fisher': -0.22987,\n        'volume': 16\n    }\n\t\n    # Sell hyperspace params:\n    sell_params = {\n\t\t'sell-bbmiddle-close': 0.99184, \n\t\t'sell-fisher': 0.26832\n    }\n\t\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.15373,\n        \"14\": 0.1105,\n        \"57\": 0.08376,\n        \"147\": 0.03427,\n        \"201\": 0.01352,\n        \"366\": 0.00667,\n        \"469\": 0\n    }\n\t\n    # Stoploss:\n    stoploss = -0.02\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01007\n    trailing_stop_positive_offset = 0.01258\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '1m'\n\n    startup_candle_count: int = 72\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Set Up Bollinger Bands\n        upper_bb1, mid_bb1, lower_bb1 = ta.BBANDS(dataframe['close'], timeperiod=40)\n        upper_bb2, mid_bb2, lower_bb2 = ta.BBANDS(qtpylib.typical_price(dataframe), timeperiod=20)\n\n        # only putting some bands into dataframe as the others are not used elsewhere in the strategy\n        dataframe['lower-bb1'] = lower_bb1\n        dataframe['lower-bb2'] = lower_bb2\n        dataframe['mid-bb2'] = mid_bb2\n       \n        dataframe['bb1-delta'] = (mid_bb1 - dataframe['lower-bb1']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['close'], timeperiod=6)\n        dataframe['ema_slow'] = ta.EMA(dataframe['close'], timeperiod=48)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=24).mean()\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=9)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher-rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            (\n                dataframe['fisher-rsi'].lt(params['fisher'])\n            ) &\n            ((      \n                    dataframe['bb1-delta'].gt(dataframe['close'] * params['bbdelta-close']) &\n                    dataframe['closedelta'].gt(dataframe['close'] * params['closedelta-close']) &\n                    dataframe['tail'].lt(dataframe['bb1-delta'] * params['bbdelta-tail']) &\n                    dataframe['close'].lt(dataframe['lower-bb1'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (       \n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < params['close-bblower'] * dataframe['lower-bb2']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * params['volume']))\n            )),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            ((dataframe['close'] * params['sell-bbmiddle-close']) > dataframe['mid-bb2']) &\n            dataframe['ema_fast'].gt(dataframe['close']) &\n            dataframe['fisher-rsi'].gt(params['sell-fisher']) &\n            dataframe['volume'].gt(0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/ClucFiatROI/ClucFiatROI.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nfrom functools import reduce\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame, Series\n\nclass ClucFiatROI(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.00642,\n        'bbdelta-tail': 0.75559,\n        'close-bblower': 0.01415,\n        'closedelta-close': 0.00883,\n        'fisher': -0.97101,\n        'volume': 18\n    }\n\t\n    # Sell hyperspace params:\n    sell_params = {\n\t\t'sell-bbmiddle-close': 0.95153, \n\t\t'sell-fisher': 0.60924\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.04354,\n        \"5\": 0.03734,\n        \"8\": 0.02569,\n        \"10\": 0.019,\n        \"76\": 0.01283,\n        \"235\": 0.007,\n        \"415\": 0\n    }\n\t\n    # Stoploss:\n    stoploss = -0.34299\n\t\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01057\n    trailing_stop_positive_offset = 0.03668\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 48\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Set Up Bollinger Bands\n        upper_bb1, mid_bb1, lower_bb1 = ta.BBANDS(dataframe['close'], timeperiod=40)\n        upper_bb2, mid_bb2, lower_bb2 = ta.BBANDS(qtpylib.typical_price(dataframe), timeperiod=20)\n\n        # only putting some bands into dataframe as the others are not used elsewhere in the strategy\n        dataframe['lower-bb1'] = lower_bb1\n        dataframe['lower-bb2'] = lower_bb2\n        dataframe['mid-bb2'] = mid_bb2\n       \n        dataframe['bb1-delta'] = (mid_bb1 - dataframe['lower-bb1']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['close'], timeperiod=6)\n        dataframe['ema_slow'] = ta.EMA(dataframe['close'], timeperiod=48)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=24).mean()\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=9)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher-rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # These indicators are used to persist a buy signal in live trading only\n        # They dramatically slow backtesting down\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe['sar'] = ta.SAR(dataframe)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        active_trade = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n\n        conditions = []\n\n        \"\"\"\n        If this is a fresh buy, apple additional conditions.\n        Idea is to leverage \"ignore_roi_if_buy_signal = True\" functionality by using certain\n        indicators for active trades while applying additional protections to new trades.\n        \"\"\"\n        if not active_trade:\n            conditions.append(\n                (\n                    dataframe['fisher-rsi'].lt(params['fisher'])\n                ) &\n                ((      \n                        dataframe['bb1-delta'].gt(dataframe['close'] * params['bbdelta-close']) &\n                        dataframe['closedelta'].gt(dataframe['close'] * params['closedelta-close']) &\n                        dataframe['tail'].lt(dataframe['bb1-delta'] * params['bbdelta-tail']) &\n                        dataframe['close'].lt(dataframe['lower-bb1'].shift()) &\n                        dataframe['close'].le(dataframe['close'].shift())\n                ) |\n                (       \n                        (dataframe['close'] < dataframe['ema_slow']) &\n                        (dataframe['close'] < params['close-bblower'] * dataframe['lower-bb2']) &\n                        (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * params['volume']))\n                ))\n            )\n\n        else:\n            conditions.append(dataframe['close'] > dataframe['close'].shift())\n            conditions.append(dataframe['close'] > dataframe['sar'])\n\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            ((dataframe['close'] * params['sell-bbmiddle-close']) > dataframe['mid-bb2']) &\n            dataframe['ema_fast'].gt(dataframe['close']) &\n            dataframe['fisher-rsi'].gt(params['sell-fisher']) &\n            dataframe['volume'].gt(0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\n    \"\"\"\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n\n    Custom Order Timeouts\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n"
  },
  {
    "path": "strategies/ClucFiatSlow/ClucFiatSlow.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame, Series\n\nclass ClucFiatSlow(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.00642,\n        'bbdelta-tail': 0.75559,\n        'close-bblower': 0.01415,\n        'closedelta-close': 0.00883,\n        'fisher': -0.97101,\n        'volume': 18\n    }\n\t\n    # Sell hyperspace params:\n    sell_params = {\n\t\t'sell-bbmiddle-close': 0.95153, \n\t\t'sell-fisher': 0.60924\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.04354,\n        \"5\": 0.03734,\n        \"8\": 0.02569,\n        \"10\": 0.019,\n        \"76\": 0.01283,\n        \"235\": 0.007,\n        \"415\": 0\n    }\n\t\n    # Stoploss:\n    stoploss = -0.34299\n\t\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01057\n    trailing_stop_positive_offset = 0.03668\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 48\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Set Up Bollinger Bands\n        upper_bb1, mid_bb1, lower_bb1 = ta.BBANDS(dataframe['close'], timeperiod=40)\n        upper_bb2, mid_bb2, lower_bb2 = ta.BBANDS(qtpylib.typical_price(dataframe), timeperiod=20)\n\n        # only putting some bands into dataframe as the others are not used elsewhere in the strategy\n        dataframe['lower-bb1'] = lower_bb1\n        dataframe['lower-bb2'] = lower_bb2\n        dataframe['mid-bb2'] = mid_bb2\n       \n        dataframe['bb1-delta'] = (mid_bb1 - dataframe['lower-bb1']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['close'], timeperiod=6)\n        dataframe['ema_slow'] = ta.EMA(dataframe['close'], timeperiod=48)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=24).mean()\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=9)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher-rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            (\n                dataframe['fisher-rsi'].lt(params['fisher'])\n            ) &\n            ((      \n                    dataframe['bb1-delta'].gt(dataframe['close'] * params['bbdelta-close']) &\n                    dataframe['closedelta'].gt(dataframe['close'] * params['closedelta-close']) &\n                    dataframe['tail'].lt(dataframe['bb1-delta'] * params['bbdelta-tail']) &\n                    dataframe['close'].lt(dataframe['lower-bb1'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (       \n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < params['close-bblower'] * dataframe['lower-bb2']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * params['volume']))\n            )),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            ((dataframe['close'] * params['sell-bbmiddle-close']) > dataframe['mid-bb2']) &\n            dataframe['ema_fast'].gt(dataframe['close']) &\n            dataframe['fisher-rsi'].gt(params['sell-fisher']) &\n            dataframe['volume'].gt(0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\n    \"\"\"\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n\n    Custom Order Timeouts\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n"
  },
  {
    "path": "strategies/ClucHAnix/ClucHAnix.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, stoploss_from_open\nfrom pandas import DataFrame, Series\nfrom datetime import datetime\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n\nclass ClucHAnix(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    Can be overridden for specific sub-strategies (stake currencies) at the bottom.\n    \"\"\"\n\n    buy_params = {\n        'bbdelta-close': 0.01965,\n        'bbdelta-tail': 0.95089,\n        'close-bblower': 0.00799,\n        'closedelta-close': 0.00556,\n        'rocr-1h': 0.54904\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        # custom stoploss params, come from BB_RPB_TSL\n        \"pHSL\": -0.35,\n        \"pPF_1\": 0.02,\n        \"pPF_2\": 0.05,\n        \"pSL_1\": 0.02,\n        \"pSL_2\": 0.04,\n\n        'sell-fisher': 0.38414, \n        'sell-bbmiddle-close': 1.07634\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    # Stoploss:\n    stoploss = -0.99   # use custom stoploss\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.012\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '1m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    process_only_new_candles = True\n    startup_candle_count = 168\n\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'emergencysell': 'market',\n        'forcebuy': \"market\",\n        'forcesell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n    \n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if current_profit > PF_2:\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif current_profit > PF_1:\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if sl_profit >= current_profit:\n            return -0.99\n    \n        return stoploss_from_open(sl_profit, current_profit)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n        \n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n\n        dataframe['bb_lowerband'] = dataframe['lower']\n        dataframe['bb_middleband'] = dataframe['mid']\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        rsi = ta.RSI(dataframe)\n        dataframe[\"rsi\"] = rsi\n        rsi = 0.1 * (rsi - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n        \n        inf_tf = '1h'\n        \n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        \n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n     \n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            (\n                dataframe['rocr_1h'].gt(params['rocr-1h'])\n            ) &\n            ((      \n                    (dataframe['lower'].shift().gt(0)) &\n                    (dataframe['bbdelta'].gt(dataframe['ha_close'] * params['bbdelta-close'])) &\n                    (dataframe['closedelta'].gt(dataframe['ha_close'] * params['closedelta-close'])) &\n                    (dataframe['tail'].lt(dataframe['bbdelta'] * params['bbdelta-tail'])) &\n                    (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                    (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n            ) |\n            (       \n                    (dataframe['ha_close'] < dataframe['ema_slow']) &\n                    (dataframe['ha_close'] < params['close-bblower'] * dataframe['bb_lowerband']) \n            )),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            (dataframe['fisher'] > params['sell-fisher']) &\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ClucHAnix5m/ClucHAnix5m.py",
    "content": "from datetime import datetime, timedelta, timezone\nfrom functools import reduce\nfrom typing import List\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom pandas import DataFrame, Series\nimport logging\nimport pandas as pd\nimport numpy as np\nfrom freqtrade.persistence import Trade\nimport time\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas_ta as pta\nimport talib.abstract as ta\nimport technical.indicators as ftt\nfrom freqtrade.persistence import Trade, PairLocks\nfrom freqtrade.strategy import (BooleanParameter, DecimalParameter,\n                                IntParameter, stoploss_from_open, merge_informative_pair)\nfrom skopt.space import Dimension, Integer\n\nlogger = logging.getLogger(__name__)\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\nclass ClucHAnix5m(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"antipump_threshold\": 0.133,\n        \"buy_btc_safe_1d\": -0.311,\n        \"clucha_bbdelta_close\": 0.04796,\n        \"clucha_bbdelta_tail\": 0.93112,\n        \"clucha_close_bblower\": 0.01645,\n        \"clucha_closedelta_close\": 0.00931,\n        \"clucha_enabled\": False,\n        \"clucha_rocr_1h\": 0.41663,\n        \"cofi_adx\": 8,\n        \"cofi_ema\": 0.639,\n        \"cofi_enabled\": False,\n        \"cofi_ewo_high\": 5.6,\n        \"cofi_fastd\": 40,\n        \"cofi_fastk\": 13,\n        \"ewo_1_enabled\": False,\n        \"ewo_1_rsi_14\": 45,\n        \"ewo_1_rsi_4\": 7,\n        \"ewo_candles_buy\": 13,\n        \"ewo_candles_sell\": 19,\n        \"ewo_high\": 5.249,\n        \"ewo_high_offset\": 1.04116,\n        \"ewo_low\": -11.424,\n        \"ewo_low_enabled\": True,\n        \"ewo_low_offset\": 0.97463,\n        \"ewo_low_rsi_4\": 35,\n        \"lambo1_ema_14_factor\": 1.054,\n        \"lambo1_enabled\": False,\n        \"lambo1_rsi_14_limit\": 26,\n        \"lambo1_rsi_4_limit\": 18,\n        \"lambo2_ema_14_factor\": 0.981,\n        \"lambo2_enabled\": True,\n        \"lambo2_rsi_14_limit\": 39,\n        \"lambo2_rsi_4_limit\": 44,\n        \"local_trend_bb_factor\": 0.823,\n        \"local_trend_closedelta\": 19.253,\n        \"local_trend_ema_diff\": 0.125,\n        \"local_trend_enabled\": True,\n        \"nfi32_cti_limit\": -1.09639,\n        \"nfi32_enabled\": True,\n        \"nfi32_rsi_14\": 15,\n        \"nfi32_rsi_4\": 49,\n        \"nfi32_sma_factor\": 0.93391,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        # custom stoploss params, come from BB_RPB_TSL\n      \"pHSL\": -0.23,\n      \"pPF_1\": 0.02,\n      \"pPF_2\": 0.047,\n      \"pSL_1\": 0.02,\n      \"pSL_2\": 0.046,\n\n        'sell-fisher': 0.38414, \n        'sell-bbmiddle-close': 1.07634\n    }\n\n    # ROI table:\n    minimal_roi = {\n      \"0\": 0.10347601757573865,\n      \"3\": 0.050495605759981035,\n      \"5\": 0.03350898081823659,\n      \"61\": 0.0275218557571848,\n      \"125\": 0.011112591523667215,\n      \"292\": 0.005185372158403069,\n      \"399\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.99   # use custom stoploss\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.012\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'emergencysell': 'market',\n        'forcebuy': \"market\",\n        'forcesell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n    \n    # buy param\n    # ClucHA\n    clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=buy_params['clucha_bbdelta_close'], decimals=5, space='buy', optimize=True)\n    clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=buy_params['clucha_bbdelta_tail'], decimals=5, space='buy', optimize=True)\n    clucha_close_bblower = DecimalParameter(0.001, 0.05, default=buy_params['clucha_close_bblower'], decimals=5, space='buy', optimize=True)\n    clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=buy_params['clucha_closedelta_close'], decimals=5, space='buy', optimize=True)\n    clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=buy_params['clucha_rocr_1h'], decimals=5, space='buy', optimize=True)\n\n    # lambo1\n    lambo1_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo1_ema_14_factor'], space='buy', optimize=True)\n    lambo1_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_4_limit'], space='buy', optimize=True)\n    lambo1_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_14_limit'], space='buy', optimize=True)\n\n    # lambo2\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\n\n    # local_uptrend\n    local_trend_ema_diff = DecimalParameter(0, 0.2, default=buy_params['local_trend_ema_diff'], space='buy', optimize=True)\n    local_trend_bb_factor = DecimalParameter(0.8, 1.2, default=buy_params['local_trend_bb_factor'], space='buy', optimize=True)\n    local_trend_closedelta = DecimalParameter(5.0, 30.0, default=buy_params['local_trend_closedelta'], space='buy', optimize=True)\n\n    # ewo_1 and ewo_low\n    ewo_candles_buy = IntParameter(2, 30, default=buy_params['ewo_candles_buy'], space='buy', optimize=True)\n    ewo_candles_sell = IntParameter(2, 35, default=buy_params['ewo_candles_sell'], space='buy', optimize=True)\n    ewo_low_offset = DecimalParameter(0.7, 1.2, default=buy_params['ewo_low_offset'], decimals=5, space='buy', optimize=True)\n    ewo_high_offset = DecimalParameter(0.75, 1.5, default=buy_params['ewo_high_offset'], decimals=5, space='buy', optimize=True)\n    ewo_high = DecimalParameter(2.0, 15.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    ewo_1_rsi_14 = IntParameter(10, 100, default=buy_params['ewo_1_rsi_14'], space='buy', optimize=True)\n    ewo_1_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_1_rsi_4'], space='buy', optimize=True)\n    ewo_low_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_low_rsi_4'], space='buy', optimize=True)\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\n\n    # cofi\n    cofi_ema = DecimalParameter(0.6, 1.4, default=buy_params['cofi_ema'] , space='buy', optimize=True)\n    cofi_fastk = IntParameter(1, 100, default=buy_params['cofi_fastk'], space='buy', optimize=True)\n    cofi_fastd = IntParameter(1, 100, default=buy_params['cofi_fastd'], space='buy', optimize=True)\n    cofi_adx = IntParameter(1, 100, default=buy_params['cofi_adx'], space='buy', optimize=True)\n    cofi_ewo_high = DecimalParameter(1.0, 15.0, default=buy_params['cofi_ewo_high'], space='buy', optimize=True)\n\n    # nfi32\n    nfi32_rsi_4 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\n    nfi32_rsi_14 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\n    nfi32_sma_factor = DecimalParameter(0.7, 1.2, default=buy_params['nfi32_sma_factor'], decimals=5, space='buy', optimize=True)\n    nfi32_cti_limit = DecimalParameter(-1.2, 0, default=buy_params['nfi32_cti_limit'], decimals=5, space='buy', optimize=True)\n\n    buy_btc_safe_1d = DecimalParameter(-0.5, -0.015, default=buy_params['buy_btc_safe_1d'], optimize=True)\n    antipump_threshold = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold'], space='buy', optimize=True)\n\n    ewo_1_enabled = BooleanParameter(default=buy_params['ewo_1_enabled'], space='buy', optimize=True)\n    ewo_low_enabled = BooleanParameter(default=buy_params['ewo_low_enabled'], space='buy', optimize=True)\n    cofi_enabled = BooleanParameter(default=buy_params['cofi_enabled'], space='buy', optimize=True)\n    lambo1_enabled = BooleanParameter(default=buy_params['lambo1_enabled'], space='buy', optimize=True)\n    lambo2_enabled = BooleanParameter(default=buy_params['lambo2_enabled'], space='buy', optimize=True)\n    local_trend_enabled = BooleanParameter(default=buy_params['local_trend_enabled'], space='buy', optimize=True)\n    nfi32_enabled = BooleanParameter(default=buy_params['nfi32_enabled'], space='buy', optimize=True)\n    clucha_enabled = BooleanParameter(default=buy_params['clucha_enabled'], space='buy', optimize=True)\n\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n\n        return informative_pairs\n\n\n    ############################################################################\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n       \n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n    \n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n\n        # # ClucHA\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['bb_lowerband'] = dataframe['lower']\n        dataframe['bb_middleband'] = dataframe['mid']\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        rsi = ta.RSI(dataframe)\n        dataframe[\"rsi\"] = rsi\n        rsi = 0.1 * (rsi - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        inf_tf = '1h'\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n\n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        ### BTC protection\n        dataframe['btc_1m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='1m')['close']\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\n        dataframe = merge_informative_pair(dataframe, btc_1d, '1m', '1d', ffill=True)\n\n        # Pump strength\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n\n        #NOTE: dynamic offset\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\n        dataframe['norm_perc'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_buy.value))\n        dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_sell.value))\n\n        is_btc_safe = (\n            (pct_change(dataframe['btc_1d'], dataframe['btc_1m']).fillna(0) > self.buy_btc_safe_1d.value) &\n            (dataframe['volume'] > 0)           # Make sure Volume is not 0\n        )\n\n        is_pump_safe = (\n            (dataframe['pump_strength'] < self.antipump_threshold.value)\n        )\n\n        lambo1 = (\n            bool(self.lambo1_enabled.value) &\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo1_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < int(self.lambo1_rsi_4_limit.value)) &\n            (dataframe['rsi_14'] < int(self.lambo1_rsi_14_limit.value))\n        )\n        dataframe.loc[lambo1, 'buy_tag'] += 'lambo1_'\n        conditions.append(lambo1)\n\n        lambo2 = (\n            bool(self.lambo2_enabled.value) &\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value)) &\n            (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value))\n        )\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2_'\n        conditions.append(lambo2)\n\n        local_uptrend = (\n            bool(self.local_trend_enabled.value) &\n            (dataframe['ema_26'] > dataframe['ema_14']) &\n            (dataframe['ema_26'] - dataframe['ema_14'] > dataframe['open'] * self.local_trend_ema_diff.value) &\n            (dataframe['ema_26'].shift() - dataframe['ema_14'].shift() > dataframe['open'] / 100) &\n            (dataframe['close'] < dataframe['bb_lowerband2'] * self.local_trend_bb_factor.value) &\n            (dataframe['closedelta'] > dataframe['close'] * self.local_trend_closedelta.value / 1000 )\n        )\n        dataframe.loc[local_uptrend, 'buy_tag'] += 'local_uptrend_'\n        conditions.append(local_uptrend)\n\n        nfi_32 = (\n            bool(self.nfi32_enabled.value) &\n            (dataframe['rsi_20'] < dataframe['rsi_20'].shift(1)) &\n            (dataframe['rsi_4'] < self.nfi32_rsi_4.value) &\n            (dataframe['rsi_14'] > self.nfi32_rsi_14.value) &\n            (dataframe['close'] < dataframe['sma_15'] * self.nfi32_sma_factor.value) &\n            (dataframe['cti'] < self.nfi32_cti_limit.value)\n        )\n        dataframe.loc[nfi_32, 'buy_tag'] += 'nfi_32_'\n        conditions.append(nfi_32)\n\n        ewo_1 = (\n            bool(self.ewo_1_enabled.value) &\n            (dataframe['rsi_4'] < self.ewo_1_rsi_4.value) &\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\n            (dataframe['EWO'] > self.ewo_high.value) &\n            (dataframe['rsi_14'] < self.ewo_1_rsi_14.value) &\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\n        )\n        dataframe.loc[ewo_1, 'buy_tag'] += 'ewo1_'\n        conditions.append(ewo_1)\n\n        ewo_low = (\n            bool(self.ewo_low_enabled.value) &\n            (dataframe['rsi_4'] <  self.ewo_low_rsi_4.value) &\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\n            (dataframe['EWO'] < self.ewo_low.value) &\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\n        )\n        dataframe.loc[ewo_low, 'buy_tag'] += 'ewo_low_'\n        conditions.append(ewo_low)\n\n        cofi = (\n            bool(self.cofi_enabled.value) &\n            (dataframe['open'] < dataframe['ema_8'] * self.cofi_ema.value) &\n            (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n            (dataframe['fastk'] < self.cofi_fastk.value) &\n            (dataframe['fastd'] < self.cofi_fastd.value) &\n            (dataframe['adx'] > self.cofi_adx.value) &\n            (dataframe['EWO'] > self.cofi_ewo_high.value)\n        )\n        dataframe.loc[cofi, 'buy_tag'] += 'cofi_'\n        conditions.append(cofi)\n\n        clucHA = (\n            bool(self.clucha_enabled.value) &\n            (dataframe['rocr_1h'].gt(self.clucha_rocr_1h.value)) &\n            ((\n                (dataframe['lower'].shift().gt(0)) &\n                (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.clucha_bbdelta_close.value)) &\n                (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.clucha_closedelta_close.value)) &\n                (dataframe['tail'].lt(dataframe['bbdelta'] * self.clucha_bbdelta_tail.value)) &\n                (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n            ) |\n            (\n                (dataframe['ha_close'] < dataframe['ema_slow']) &\n                (dataframe['ha_close'] < self.clucha_close_bblower.value * dataframe['bb_lowerband'])\n            ))\n        )\n        dataframe.loc[clucHA, 'buy_tag'] += 'clucHA_'\n        conditions.append(clucHA)\n\n        dataframe.loc[\n              is_btc_safe & # broken?\n              is_pump_safe &\n            reduce(lambda x, y: x | y, conditions),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        \n        dataframe.loc[\n            (dataframe['fisher'] > params['sell-fisher']) &\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\n\n        return True\n\ndef pct_change(a, b):\n    return (b - a) / a\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\nclass ClucHAnix_BB_RPB_MOD2_ROI_DYNAMIC_TB(ClucHAnix5m):\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = True\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.01  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.002  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': True,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = abs((last_candle['norm_perc']))\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\n        #default_offset = adapt*0.01\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n        \n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n                            \n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n        \n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/ClucHAnix_5m/ClucHAnix_5m.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, stoploss_from_open, RealParameter\nfrom pandas import DataFrame, Series\nfrom datetime import datetime\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\nclass ClucHAnix_5m(IStrategy):\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    Can be overridden for specific sub-strategies (stake currencies) at the bottom.\n    \"\"\"\n    \n    #hypered params\n    buy_params = {\n        \"bbdelta_close\": 0.01889,\n        \"bbdelta_tail\": 0.72235,\n        \"close_bblower\": 0.0127,\n        \"closedelta_close\": 0.00916,\n        \"rocr_1h\": 0.79492,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        # custom stoploss params, come from BB_RPB_TSL\n        \"pHSL\": -0.35,\n        \"pPF_1\": 0.011,\n        \"pPF_2\": 0.064,\n        \"pSL_1\": 0.011,\n        \"pSL_2\": 0.062,\n\n        # sell signal params\n        'sell_fisher': 0.39075,\n        'sell_bbmiddle_close': 0.99754\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    # Stoploss:\n    stoploss = -0.99  # use custom stoploss\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.012\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    process_only_new_candles = True\n    startup_candle_count = 168\n\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'emergencysell': 'limit',\n        'forcebuy': \"limit\",\n        'forcesell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # buy params\n    rocr_1h = RealParameter(0.5, 1.0, default=0.54904, space='buy', optimize=True)\n    bbdelta_close = RealParameter(0.0005, 0.02, default=0.01965, space='buy', optimize=True)\n    closedelta_close = RealParameter(0.0005, 0.02, default=0.00556, space='buy', optimize=True)\n    bbdelta_tail = RealParameter(0.7, 1.0, default=0.95089, space='buy', optimize=True)\n    close_bblower = RealParameter(0.0005, 0.02, default=0.00799, space='buy', optimize=True)\n\n    # sell params\n    sell_fisher = RealParameter(0.1, 0.5, default=0.38414, space='sell', optimize=True)\n    sell_bbmiddle_close = RealParameter(0.97, 1.1, default=1.07634, space='sell', optimize=True)\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    # come from BB_RPB_TSL\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if current_profit > PF_2:\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif current_profit > PF_1:\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if sl_profit >= current_profit:\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n\n        dataframe['bb_lowerband'] = dataframe['lower']\n        dataframe['bb_middleband'] = dataframe['mid']\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        rsi = ta.RSI(dataframe)\n        dataframe[\"rsi\"] = rsi\n        rsi = 0.1 * (rsi - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        inf_tf = '1h'\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n\n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                dataframe['rocr_1h'].gt(self.rocr_1h.value)\n            ) &\n            ((\n                     (dataframe['lower'].shift().gt(0)) &\n                     (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.bbdelta_close.value)) &\n                     (dataframe['closedelta'].gt(dataframe['ha_close'] * self.closedelta_close.value)) &\n                     (dataframe['tail'].lt(dataframe['bbdelta'] * self.bbdelta_tail.value)) &\n                     (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                     (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n             ) |\n             (\n                     (dataframe['ha_close'] < dataframe['ema_slow']) &\n                     (dataframe['ha_close'] < self.close_bblower.value * dataframe['bb_lowerband'])\n             )),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (dataframe['fisher'] > self.sell_fisher.value) &\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\n            ((dataframe['ha_close'] * self.sell_bbmiddle_close.value) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0),\n            'sell'\n        ] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/ClucHAnix_5m1/ClucHAnix_5m1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport numpy as np\r\nimport talib.abstract as ta\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, stoploss_from_open, RealParameter\r\nfrom pandas import DataFrame, Series\r\nfrom datetime import datetime\r\nfrom typing import Dict, List\r\nfrom datetime import datetime, timezone\r\nfrom freqtrade.persistence import Trade\r\nimport logging\r\n\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\n\r\ndef bollinger_bands(stock_price, window_size, num_of_std):\r\n    rolling_mean = stock_price.rolling(window=window_size).mean()\r\n    rolling_std = stock_price.rolling(window=window_size).std()\r\n    lower_band = rolling_mean - (rolling_std * num_of_std)\r\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\r\n\r\n\r\ndef ha_typical_price(bars):\r\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\r\n    return Series(index=bars.index, data=res)\r\n\r\n\r\nclass ClucHAnix_5m1(IStrategy):\r\n    \"\"\"\r\n    PASTE OUTPUT FROM HYPEROPT HERE\r\n    Can be overridden for specific sub-strategies (stake currencies) at the bottom.\r\n    \"\"\"\r\n    \r\n    #hypered params\r\n    buy_params = {\r\n        \"bbdelta_close\": 0.01889,\r\n        \"bbdelta_tail\": 0.72235,\r\n        \"close_bblower\": 0.0127,\r\n        \"closedelta_close\": 0.00916,\r\n        \"rocr_1h\": 0.79492,\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n        # custom stoploss params, come from BB_RPB_TSL\r\n        \"pHSL\": -0.10,\r\n        \"pPF_1\": 0.011,\r\n        \"pPF_2\": 0.064,\r\n        \"pSL_1\": 0.011,\r\n        \"pSL_2\": 0.062,\r\n\r\n        # sell signal params\r\n        'sell_fisher': 0.39075,\r\n        'sell_bbmiddle_close': 0.99754\r\n    }\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 100\r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.99  # use custom stoploss\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.001\r\n    trailing_stop_positive_offset = 0.012\r\n    trailing_only_offset_is_reached = False\r\n\r\n    \"\"\"\r\n    END HYPEROPT\r\n    \"\"\"\r\n\r\n    timeframe = '5m'\r\n\r\n    # Make sure these match or are not overridden in config\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Custom stoploss\r\n    use_custom_stoploss = True\r\n\r\n    process_only_new_candles = True\r\n    startup_candle_count = 168\r\n\r\n    order_types = {\r\n        'buy': 'market',\r\n        'sell': 'market',\r\n        'emergencysell': 'market',\r\n        'forcebuy': \"market\",\r\n        'forcesell': 'market',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False,\r\n\r\n        'stoploss_on_exchange_interval': 60,\r\n        'stoploss_on_exchange_limit_ratio': 0.99\r\n    }\r\n\r\n    # buy params\r\n    rocr_1h = RealParameter(0.5, 1.0, default=0.54904, space='buy', optimize=True)\r\n    bbdelta_close = RealParameter(0.0005, 0.02, default=0.01965, space='buy', optimize=True)\r\n    closedelta_close = RealParameter(0.0005, 0.02, default=0.00556, space='buy', optimize=True)\r\n    bbdelta_tail = RealParameter(0.7, 1.0, default=0.95089, space='buy', optimize=True)\r\n    close_bblower = RealParameter(0.0005, 0.02, default=0.00799, space='buy', optimize=True)\r\n\r\n    # sell params\r\n    sell_fisher = RealParameter(0.1, 0.5, default=0.38414, space='sell', optimize=True)\r\n    sell_bbmiddle_close = RealParameter(0.97, 1.1, default=1.07634, space='sell', optimize=True)\r\n\r\n    # hard stoploss profit\r\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\r\n    # profit threshold 1, trigger point, SL_1 is used\r\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\r\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\r\n\r\n    # profit threshold 2, SL_2 is used\r\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\r\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\r\n\r\n    def informative_pairs(self):\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, '1h') for pair in pairs]\r\n        return informative_pairs\r\n\r\n    # come from BB_RPB_TSL\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\r\n                        current_rate: float, current_profit: float, **kwargs) -> float:\r\n\r\n        # hard stoploss profit\r\n        HSL = self.pHSL.value\r\n        PF_1 = self.pPF_1.value\r\n        SL_1 = self.pSL_1.value\r\n        PF_2 = self.pPF_2.value\r\n        SL_2 = self.pSL_2.value\r\n\r\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\r\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\r\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\r\n\r\n        if current_profit > PF_2:\r\n            sl_profit = SL_2 + (current_profit - PF_2)\r\n        elif current_profit > PF_1:\r\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\r\n        else:\r\n            sl_profit = HSL\r\n\r\n        # Only for hyperopt invalid return\r\n        if sl_profit >= current_profit:\r\n            return -0.99\r\n\r\n        return stoploss_from_open(sl_profit, current_profit)\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # # Heikin Ashi Candles\r\n        heikinashi = qtpylib.heikinashi(dataframe)\r\n        dataframe['ha_open'] = heikinashi['open']\r\n        dataframe['ha_close'] = heikinashi['close']\r\n        dataframe['ha_high'] = heikinashi['high']\r\n        dataframe['ha_low'] = heikinashi['low']\r\n\r\n        # Set Up Bollinger Bands\r\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\r\n        dataframe['lower'] = lower\r\n        dataframe['mid'] = mid\r\n\r\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\r\n        dataframe['closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\r\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\r\n\r\n        dataframe['bb_lowerband'] = dataframe['lower']\r\n        dataframe['bb_middleband'] = dataframe['mid']\r\n\r\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\r\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\r\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\r\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\r\n\r\n        rsi = ta.RSI(dataframe)\r\n        dataframe[\"rsi\"] = rsi\r\n        rsi = 0.1 * (rsi - 50)\r\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\r\n\r\n        inf_tf = '1h'\r\n\r\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\r\n\r\n        inf_heikinashi = qtpylib.heikinashi(informative)\r\n\r\n        informative['ha_close'] = inf_heikinashi['close']\r\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\r\n\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\r\n\r\n        #NOTE: dynamic offset\r\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\r\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\r\n        dataframe['norm_perc'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\r\n        \r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        dataframe.loc[\r\n            (\r\n                dataframe['rocr_1h'].gt(self.rocr_1h.value)\r\n            ) &\r\n            ((\r\n                     (dataframe['lower'].shift().gt(0)) &\r\n                     (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.bbdelta_close.value)) &\r\n                     (dataframe['closedelta'].gt(dataframe['ha_close'] * self.closedelta_close.value)) &\r\n                     (dataframe['tail'].lt(dataframe['bbdelta'] * self.bbdelta_tail.value)) &\r\n                     (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\r\n                     (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\r\n             ) |\r\n             (\r\n                     (dataframe['ha_close'] < dataframe['ema_slow']) &\r\n                     (dataframe['ha_close'] < self.close_bblower.value * dataframe['bb_lowerband'])\r\n             )),\r\n            'buy'\r\n        ] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        dataframe.loc[\r\n            (dataframe['fisher'] > self.sell_fisher.value) &\r\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\r\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\r\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\r\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\r\n            ((dataframe['ha_close'] * self.sell_bbmiddle_close.value) > dataframe['bb_middleband']) &\r\n            (dataframe['volume'] > 0),\r\n            'sell'\r\n        ] = 1\r\n\r\n        return dataframe\r\n\r\n\r\n\r\nclass ClucHAnix_5mTB1(ClucHAnix_5m1):\r\n\r\n    process_only_new_candles = True\r\n\r\n    custom_info_trail_buy = dict()\r\n\r\n    # Trailing buy parameters\r\n    trailing_buy_order_enabled = True\r\n    trailing_expire_seconds = 300\r\n\r\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\r\n    trailing_buy_uptrend_enabled = True\r\n    trailing_expire_seconds_uptrend = 90\r\n    min_uptrend_trailing_profit = 0.02\r\n\r\n    debug_mode = True\r\n    trailing_buy_max_stop = 0.01  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\r\n    trailing_buy_max_buy = 0.002  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\r\n\r\n    init_trailing_dict = {\r\n        'trailing_buy_order_started': False,\r\n        'trailing_buy_order_uplimit': 0,\r\n        'start_trailing_price': 0,\r\n        'buy_tag': None,\r\n        'start_trailing_time': None,\r\n        'offset': 0,\r\n        'allow_trailing': False,\r\n    }\r\n\r\n    def trailing_buy(self, pair, reinit=False):\r\n        # returns trailing buy info for pair (init if necessary)\r\n        if not pair in self.custom_info_trail_buy:\r\n            self.custom_info_trail_buy[pair] = dict()\r\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\r\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\r\n        return self.custom_info_trail_buy[pair]['trailing_buy']\r\n\r\n    def trailing_buy_info(self, pair: str, current_price: float):\r\n        # current_time live, dry run\r\n        current_time = datetime.now(timezone.utc)\r\n        if not self.debug_mode:\r\n            return\r\n        trailing_buy = self.trailing_buy(pair)\r\n\r\n        duration = 0\r\n        try:\r\n            duration = (current_time - trailing_buy['start_trailing_time'])\r\n        except TypeError:\r\n            duration = 0\r\n        finally:\r\n            logger.info(\r\n                f\"pair: {pair} : \"\r\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\r\n                f\"duration: {duration}, \"\r\n                f\"current: {current_price:.4f}, \"\r\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\r\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\r\n                f\"offset: {trailing_buy['offset']}\")\r\n\r\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if trailing_buy['trailing_buy_order_started']:\r\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\r\n        else:\r\n            return 0\r\n\r\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\r\n        # return rebound limit before a buy in % of initial price, function of current price\r\n        # return None to stop trailing buy (will start again at next buy signal)\r\n        # return 'forcebuy' to force immediate buy\r\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\r\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\r\n        last_candle = dataframe.iloc[-1]\r\n        adapt  = abs((last_candle['perc_norm']))\r\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\r\n        #default_offset = adapt*0.01\r\n\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if not trailing_buy['trailing_buy_order_started']:\r\n            return default_offset\r\n\r\n        # example with duration and indicators\r\n        # dry run, live only\r\n        last_candle = dataframe.iloc[-1]\r\n        current_time = datetime.now(timezone.utc)\r\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\r\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\r\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\r\n                # more than 1h, price under first signal, buy signal still active -> buy\r\n                return 'forcebuy'\r\n            else:\r\n                # wait for next signal\r\n                return None\r\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\r\n            # less than 90s and price is rising, buy\r\n            return 'forcebuy'\r\n\r\n        if current_trailing_profit_ratio < 0:\r\n            # current price is higher than initial price\r\n            return default_offset\r\n\r\n        trailing_buy_offset = {\r\n            0.06: 0.02,\r\n            0.03: 0.01,\r\n            0: default_offset,\r\n        }\r\n\r\n        for key in trailing_buy_offset:\r\n            if current_trailing_profit_ratio > key:\r\n                return trailing_buy_offset[key]\r\n\r\n        return default_offset\r\n\r\n    # end of trailing buy parameters\r\n    # -----------------------------------------------------\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_indicators(dataframe, metadata)\r\n        self.trailing_buy(metadata['pair'])\r\n        return dataframe\r\n\r\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\r\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\r\n        \r\n        if val:\r\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\r\n                val = False\r\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n                if(len(dataframe) >= 1):\r\n                    last_candle = dataframe.iloc[-1].squeeze()\r\n                    current_price = rate\r\n                    trailing_buy = self.trailing_buy(pair)\r\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\r\n\r\n                    if trailing_buy['allow_trailing']:\r\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\r\n                            # start trailing buy\r\n\r\n                            trailing_buy['trailing_buy_order_started'] = True\r\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            trailing_buy['start_trailing_price'] = last_candle['close']\r\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\r\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            trailing_buy['offset'] = 0\r\n                            \r\n                            self.trailing_buy_info(pair, current_price)\r\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\r\n\r\n                        elif trailing_buy['trailing_buy_order_started']:\r\n                            if trailing_buy_offset == 'forcebuy':\r\n                                # buy in custom conditions\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\r\n\r\n                            elif trailing_buy_offset is None:\r\n                                # stop trailing buy custom conditions\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\r\n\r\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\r\n                                # update uplimit\r\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\r\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\r\n                                # buy ! current price > uplimit && lower thant starting price\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\r\n\r\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\r\n                                # stop trailing buy because price is too high\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\r\n                            else:\r\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'price too high for {pair} !')\r\n\r\n                    else:\r\n                        logger.info(f\"Wait for next buy signal for {pair}\")\r\n\r\n                if (val == True):\r\n                    self.trailing_buy_info(pair, rate)\r\n                    self.trailing_buy(pair, reinit=True)\r\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\r\n        \r\n        return val\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_buy_trend(dataframe, metadata)\r\n\r\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \r\n            last_candle = dataframe.iloc[-1].squeeze()\r\n            trailing_buy = self.trailing_buy(metadata['pair'])\r\n            if (last_candle['buy'] == 1):\r\n                if not trailing_buy['trailing_buy_order_started']:\r\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\r\n                    if not open_trades:\r\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\r\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\r\n                        trailing_buy['allow_trailing'] = True\r\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\r\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\r\n            else:\r\n                if (trailing_buy['trailing_buy_order_started'] == True):\r\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\r\n                    dataframe.loc[:,'buy'] = 1\r\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\r\n                    # dataframe['buy'] = 1\r\n\r\n        return dataframe\r\n\r\n"
  },
  {
    "path": "strategies/ClucHAnix_BB_RPB_MOD/ClucHAnix_BB_RPB_MOD.py",
    "content": "from datetime import datetime, timedelta, timezone\nfrom functools import reduce\nfrom typing import List\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport pandas as pd\nimport pandas_ta as pta\nimport talib.abstract as ta\nimport technical.indicators as ftt\nfrom freqtrade.persistence import Trade, PairLocks\nfrom freqtrade.strategy import (BooleanParameter, DecimalParameter,\n                                IntParameter, stoploss_from_open, merge_informative_pair)\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nfrom skopt.space import Dimension, Integer\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\nclass ClucHAnix_BB_RPB_MOD(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"antipump_threshold\": 0.133,\n        \"buy_btc_safe_1d\": -0.311,\n        \"clucha_bbdelta_close\": 0.04796,\n        \"clucha_bbdelta_tail\": 0.93112,\n        \"clucha_close_bblower\": 0.01645,\n        \"clucha_closedelta_close\": 0.00931,\n        \"clucha_enabled\": False,\n        \"clucha_rocr_1h\": 0.41663,\n        \"cofi_adx\": 8,\n        \"cofi_ema\": 0.639,\n        \"cofi_enabled\": False,\n        \"cofi_ewo_high\": 5.6,\n        \"cofi_fastd\": 40,\n        \"cofi_fastk\": 13,\n        \"ewo_1_enabled\": False,\n        \"ewo_1_rsi_14\": 45,\n        \"ewo_1_rsi_4\": 7,\n        \"ewo_candles_buy\": 13,\n        \"ewo_candles_sell\": 19,\n        \"ewo_high\": 5.249,\n        \"ewo_high_offset\": 1.04116,\n        \"ewo_low\": -11.424,\n        \"ewo_low_enabled\": True,\n        \"ewo_low_offset\": 0.97463,\n        \"ewo_low_rsi_4\": 35,\n        \"lambo1_ema_14_factor\": 1.054,\n        \"lambo1_enabled\": False,\n        \"lambo1_rsi_14_limit\": 26,\n        \"lambo1_rsi_4_limit\": 18,\n        \"lambo2_ema_14_factor\": 0.981,\n        \"lambo2_enabled\": True,\n        \"lambo2_rsi_14_limit\": 39,\n        \"lambo2_rsi_4_limit\": 44,\n        \"local_trend_bb_factor\": 0.823,\n        \"local_trend_closedelta\": 19.253,\n        \"local_trend_ema_diff\": 0.125,\n        \"local_trend_enabled\": True,\n        \"nfi32_cti_limit\": -1.09639,\n        \"nfi32_enabled\": True,\n        \"nfi32_rsi_14\": 15,\n        \"nfi32_rsi_4\": 49,\n        \"nfi32_sma_factor\": 0.93391,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        # custom stoploss params, come from BB_RPB_TSL\n        \"pHSL\": -0.32,\n        \"pPF_1\": 0.02,\n        \"pPF_2\": 0.047,\n        \"pSL_1\": 0.02,\n        \"pSL_2\": 0.046, \n\n        'sell-fisher': 0.38414, \n        'sell-bbmiddle-close': 1.07634\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"70\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.99   # use custom stoploss\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.012\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '1m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'emergencysell': 'market',\n        'forcebuy': \"market\",\n        'forcesell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n    \n    # buy param\n    # ClucHA\n    clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=buy_params['clucha_bbdelta_close'], decimals=5, space='buy', optimize=True)\n    clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=buy_params['clucha_bbdelta_tail'], decimals=5, space='buy', optimize=True)\n    clucha_close_bblower = DecimalParameter(0.001, 0.05, default=buy_params['clucha_close_bblower'], decimals=5, space='buy', optimize=True)\n    clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=buy_params['clucha_closedelta_close'], decimals=5, space='buy', optimize=True)\n    clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=buy_params['clucha_rocr_1h'], decimals=5, space='buy', optimize=True)\n\n    # lambo1\n    lambo1_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo1_ema_14_factor'], space='buy', optimize=True)\n    lambo1_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_4_limit'], space='buy', optimize=True)\n    lambo1_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_14_limit'], space='buy', optimize=True)\n\n    # lambo2\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\n\n    # local_uptrend\n    local_trend_ema_diff = DecimalParameter(0, 0.2, default=buy_params['local_trend_ema_diff'], space='buy', optimize=True)\n    local_trend_bb_factor = DecimalParameter(0.8, 1.2, default=buy_params['local_trend_bb_factor'], space='buy', optimize=True)\n    local_trend_closedelta = DecimalParameter(5.0, 30.0, default=buy_params['local_trend_closedelta'], space='buy', optimize=True)\n\n    # ewo_1 and ewo_low\n    ewo_candles_buy = IntParameter(2, 30, default=buy_params['ewo_candles_buy'], space='buy', optimize=True)\n    ewo_candles_sell = IntParameter(2, 35, default=buy_params['ewo_candles_sell'], space='buy', optimize=True)\n    ewo_low_offset = DecimalParameter(0.7, 1.2, default=buy_params['ewo_low_offset'], decimals=5, space='buy', optimize=True)\n    ewo_high_offset = DecimalParameter(0.75, 1.5, default=buy_params['ewo_high_offset'], decimals=5, space='buy', optimize=True)\n    ewo_high = DecimalParameter(2.0, 15.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    ewo_1_rsi_14 = IntParameter(10, 100, default=buy_params['ewo_1_rsi_14'], space='buy', optimize=True)\n    ewo_1_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_1_rsi_4'], space='buy', optimize=True)\n    ewo_low_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_low_rsi_4'], space='buy', optimize=True)\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\n\n    # cofi\n    cofi_ema = DecimalParameter(0.6, 1.4, default=buy_params['cofi_ema'] , space='buy', optimize=True)\n    cofi_fastk = IntParameter(1, 100, default=buy_params['cofi_fastk'], space='buy', optimize=True)\n    cofi_fastd = IntParameter(1, 100, default=buy_params['cofi_fastd'], space='buy', optimize=True)\n    cofi_adx = IntParameter(1, 100, default=buy_params['cofi_adx'], space='buy', optimize=True)\n    cofi_ewo_high = DecimalParameter(1.0, 15.0, default=buy_params['cofi_ewo_high'], space='buy', optimize=True)\n\n    # nfi32\n    nfi32_rsi_4 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\n    nfi32_rsi_14 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\n    nfi32_sma_factor = DecimalParameter(0.7, 1.2, default=buy_params['nfi32_sma_factor'], decimals=5, space='buy', optimize=True)\n    nfi32_cti_limit = DecimalParameter(-1.2, 0, default=buy_params['nfi32_cti_limit'], decimals=5, space='buy', optimize=True)\n\n    buy_btc_safe_1d = DecimalParameter(-0.5, -0.015, default=buy_params['buy_btc_safe_1d'], optimize=True)\n    antipump_threshold = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold'], space='buy', optimize=True)\n\n    ewo_1_enabled = BooleanParameter(default=buy_params['ewo_1_enabled'], space='buy', optimize=True)\n    ewo_low_enabled = BooleanParameter(default=buy_params['ewo_low_enabled'], space='buy', optimize=True)\n    cofi_enabled = BooleanParameter(default=buy_params['cofi_enabled'], space='buy', optimize=True)\n    lambo1_enabled = BooleanParameter(default=buy_params['lambo1_enabled'], space='buy', optimize=True)\n    lambo2_enabled = BooleanParameter(default=buy_params['lambo2_enabled'], space='buy', optimize=True)\n    local_trend_enabled = BooleanParameter(default=buy_params['local_trend_enabled'], space='buy', optimize=True)\n    nfi32_enabled = BooleanParameter(default=buy_params['nfi32_enabled'], space='buy', optimize=True)\n    clucha_enabled = BooleanParameter(default=buy_params['clucha_enabled'], space='buy', optimize=True)\n\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n\n        return informative_pairs\n\n\n    ############################################################################\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n       \n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n    \n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n\n        # # ClucHA\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['bb_lowerband'] = dataframe['lower']\n        dataframe['bb_middleband'] = dataframe['mid']\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        rsi = ta.RSI(dataframe)\n        dataframe[\"rsi\"] = rsi\n        rsi = 0.1 * (rsi - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        inf_tf = '1h'\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n\n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        ### BTC protection\n        dataframe['btc_1m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='1m')['close']\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\n        dataframe = merge_informative_pair(dataframe, btc_1d, '1m', '1d', ffill=True)\n\n        # Pump strength\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_buy.value))\n        dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_sell.value))\n\n        is_btc_safe = (\n            (pct_change(dataframe['btc_1d'], dataframe['btc_1m']).fillna(0) > self.buy_btc_safe_1d.value) &\n            (dataframe['volume'] > 0)           # Make sure Volume is not 0\n        )\n\n        is_pump_safe = (\n            (dataframe['pump_strength'] < self.antipump_threshold.value)\n        )\n\n        lambo1 = (\n            bool(self.lambo1_enabled.value) &\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo1_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < int(self.lambo1_rsi_4_limit.value)) &\n            (dataframe['rsi_14'] < int(self.lambo1_rsi_14_limit.value))\n        )\n        dataframe.loc[lambo1, 'buy_tag'] += 'lambo1_'\n        conditions.append(lambo1)\n\n        lambo2 = (\n            bool(self.lambo2_enabled.value) &\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value)) &\n            (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value))\n        )\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2_'\n        conditions.append(lambo2)\n\n        local_uptrend = (\n            bool(self.local_trend_enabled.value) &\n            (dataframe['ema_26'] > dataframe['ema_14']) &\n            (dataframe['ema_26'] - dataframe['ema_14'] > dataframe['open'] * self.local_trend_ema_diff.value) &\n            (dataframe['ema_26'].shift() - dataframe['ema_14'].shift() > dataframe['open'] / 100) &\n            (dataframe['close'] < dataframe['bb_lowerband2'] * self.local_trend_bb_factor.value) &\n            (dataframe['closedelta'] > dataframe['close'] * self.local_trend_closedelta.value / 1000 )\n        )\n        dataframe.loc[local_uptrend, 'buy_tag'] += 'local_uptrend_'\n        conditions.append(local_uptrend)\n\n        nfi_32 = (\n            bool(self.nfi32_enabled.value) &\n            (dataframe['rsi_20'] < dataframe['rsi_20'].shift(1)) &\n            (dataframe['rsi_4'] < self.nfi32_rsi_4.value) &\n            (dataframe['rsi_14'] > self.nfi32_rsi_14.value) &\n            (dataframe['close'] < dataframe['sma_15'] * self.nfi32_sma_factor.value) &\n            (dataframe['cti'] < self.nfi32_cti_limit.value)\n        )\n        dataframe.loc[nfi_32, 'buy_tag'] += 'nfi_32_'\n        conditions.append(nfi_32)\n\n        ewo_1 = (\n            bool(self.ewo_1_enabled.value) &\n            (dataframe['rsi_4'] < self.ewo_1_rsi_4.value) &\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\n            (dataframe['EWO'] > self.ewo_high.value) &\n            (dataframe['rsi_14'] < self.ewo_1_rsi_14.value) &\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\n        )\n        dataframe.loc[ewo_1, 'buy_tag'] += 'ewo1_'\n        conditions.append(ewo_1)\n\n        ewo_low = (\n            bool(self.ewo_low_enabled.value) &\n            (dataframe['rsi_4'] <  self.ewo_low_rsi_4.value) &\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\n            (dataframe['EWO'] < self.ewo_low.value) &\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\n        )\n        dataframe.loc[ewo_low, 'buy_tag'] += 'ewo_low_'\n        conditions.append(ewo_low)\n\n        cofi = (\n            bool(self.cofi_enabled.value) &\n            (dataframe['open'] < dataframe['ema_8'] * self.cofi_ema.value) &\n            (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n            (dataframe['fastk'] < self.cofi_fastk.value) &\n            (dataframe['fastd'] < self.cofi_fastd.value) &\n            (dataframe['adx'] > self.cofi_adx.value) &\n            (dataframe['EWO'] > self.cofi_ewo_high.value)\n        )\n        dataframe.loc[cofi, 'buy_tag'] += 'cofi_'\n        conditions.append(cofi)\n\n        clucHA = (\n            bool(self.clucha_enabled.value) &\n            (dataframe['rocr_1h'].gt(self.clucha_rocr_1h.value)) &\n            ((\n                (dataframe['lower'].shift().gt(0)) &\n                (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.clucha_bbdelta_close.value)) &\n                (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.clucha_closedelta_close.value)) &\n                (dataframe['tail'].lt(dataframe['bbdelta'] * self.clucha_bbdelta_tail.value)) &\n                (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n            ) |\n            (\n                (dataframe['ha_close'] < dataframe['ema_slow']) &\n                (dataframe['ha_close'] < self.clucha_close_bblower.value * dataframe['bb_lowerband'])\n            ))\n        )\n        dataframe.loc[clucHA, 'buy_tag'] += 'clucHA_'\n        conditions.append(clucHA)\n\n        dataframe.loc[\n            # is_btc_safe &  # broken?\n            # is_pump_safe &\n            reduce(lambda x, y: x | y, conditions),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        \n        dataframe.loc[\n            (dataframe['fisher'] > params['sell-fisher']) &\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\n\n        return True\n\ndef pct_change(a, b):\n    return (b - a) / a\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n"
  },
  {
    "path": "strategies/ClucHAnix_BB_RPB_MOD2_ROI/ClucHAnix_BB_RPB_MOD2_ROI.py",
    "content": "from datetime import datetime, timedelta, timezone\nfrom functools import reduce\nfrom typing import List\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom pandas import DataFrame, Series\n# --------------------------------\nimport logging\nimport pandas as pd\nimport numpy as np\nfrom freqtrade.persistence import Trade\nimport time\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas_ta as pta\nimport talib.abstract as ta\nimport technical.indicators as ftt\nfrom freqtrade.persistence import Trade, PairLocks\nfrom freqtrade.strategy import (BooleanParameter, DecimalParameter,\n                                IntParameter, stoploss_from_open, merge_informative_pair)\nfrom skopt.space import Dimension, Integer\n\nlogger = logging.getLogger(__name__)\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\nclass ClucHAnix_BB_RPB_MOD2_ROI(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"antipump_threshold\": 0.133,\n        \"buy_btc_safe_1d\": -0.311,\n        \"clucha_bbdelta_close\": 0.04796,\n        \"clucha_bbdelta_tail\": 0.93112,\n        \"clucha_close_bblower\": 0.01645,\n        \"clucha_closedelta_close\": 0.00931,\n        \"clucha_enabled\": False,\n        \"clucha_rocr_1h\": 0.41663,\n        \"cofi_adx\": 8,\n        \"cofi_ema\": 0.639,\n        \"cofi_enabled\": False,\n        \"cofi_ewo_high\": 5.6,\n        \"cofi_fastd\": 40,\n        \"cofi_fastk\": 13,\n        \"ewo_1_enabled\": False,\n        \"ewo_1_rsi_14\": 45,\n        \"ewo_1_rsi_4\": 7,\n        \"ewo_candles_buy\": 13,\n        \"ewo_candles_sell\": 19,\n        \"ewo_high\": 5.249,\n        \"ewo_high_offset\": 1.04116,\n        \"ewo_low\": -11.424,\n        \"ewo_low_enabled\": True,\n        \"ewo_low_offset\": 0.97463,\n        \"ewo_low_rsi_4\": 35,\n        \"lambo1_ema_14_factor\": 1.054,\n        \"lambo1_enabled\": False,\n        \"lambo1_rsi_14_limit\": 26,\n        \"lambo1_rsi_4_limit\": 18,\n        \"lambo2_ema_14_factor\": 0.981,\n        \"lambo2_enabled\": True,\n        \"lambo2_rsi_14_limit\": 39,\n        \"lambo2_rsi_4_limit\": 44,\n        \"local_trend_bb_factor\": 0.823,\n        \"local_trend_closedelta\": 19.253,\n        \"local_trend_ema_diff\": 0.125,\n        \"local_trend_enabled\": True,\n        \"nfi32_cti_limit\": -1.09639,\n        \"nfi32_enabled\": True,\n        \"nfi32_rsi_14\": 15,\n        \"nfi32_rsi_4\": 49,\n        \"nfi32_sma_factor\": 0.93391,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        # custom stoploss params, come from BB_RPB_TSL\n        \"pHSL\": -0.32,\n        \"pPF_1\": 0.02,\n        \"pPF_2\": 0.047,\n        \"pSL_1\": 0.02,\n        \"pSL_2\": 0.046, \n\n        'sell-fisher': 0.38414, \n        'sell-bbmiddle-close': 1.07634\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.05,\n        \"15\": 0.04,\n        \"51\": 0.03,\n        \"81\": 0.02,\n        \"112\": 0.01,\n        \"154\": 0.0001,\n        \"240\": -10\n    }\n\n    # Stoploss:\n    stoploss = -0.99   # use custom stoploss\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.012\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'emergencysell': 'market',\n        'forcebuy': \"market\",\n        'forcesell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n    \n    # buy param\n    # ClucHA\n    clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=buy_params['clucha_bbdelta_close'], decimals=5, space='buy', optimize=True)\n    clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=buy_params['clucha_bbdelta_tail'], decimals=5, space='buy', optimize=True)\n    clucha_close_bblower = DecimalParameter(0.001, 0.05, default=buy_params['clucha_close_bblower'], decimals=5, space='buy', optimize=True)\n    clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=buy_params['clucha_closedelta_close'], decimals=5, space='buy', optimize=True)\n    clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=buy_params['clucha_rocr_1h'], decimals=5, space='buy', optimize=True)\n\n    # lambo1\n    lambo1_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo1_ema_14_factor'], space='buy', optimize=True)\n    lambo1_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_4_limit'], space='buy', optimize=True)\n    lambo1_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_14_limit'], space='buy', optimize=True)\n\n    # lambo2\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\n\n    # local_uptrend\n    local_trend_ema_diff = DecimalParameter(0, 0.2, default=buy_params['local_trend_ema_diff'], space='buy', optimize=True)\n    local_trend_bb_factor = DecimalParameter(0.8, 1.2, default=buy_params['local_trend_bb_factor'], space='buy', optimize=True)\n    local_trend_closedelta = DecimalParameter(5.0, 30.0, default=buy_params['local_trend_closedelta'], space='buy', optimize=True)\n\n    # ewo_1 and ewo_low\n    ewo_candles_buy = IntParameter(2, 30, default=buy_params['ewo_candles_buy'], space='buy', optimize=True)\n    ewo_candles_sell = IntParameter(2, 35, default=buy_params['ewo_candles_sell'], space='buy', optimize=True)\n    ewo_low_offset = DecimalParameter(0.7, 1.2, default=buy_params['ewo_low_offset'], decimals=5, space='buy', optimize=True)\n    ewo_high_offset = DecimalParameter(0.75, 1.5, default=buy_params['ewo_high_offset'], decimals=5, space='buy', optimize=True)\n    ewo_high = DecimalParameter(2.0, 15.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    ewo_1_rsi_14 = IntParameter(10, 100, default=buy_params['ewo_1_rsi_14'], space='buy', optimize=True)\n    ewo_1_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_1_rsi_4'], space='buy', optimize=True)\n    ewo_low_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_low_rsi_4'], space='buy', optimize=True)\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\n\n    # cofi\n    cofi_ema = DecimalParameter(0.6, 1.4, default=buy_params['cofi_ema'] , space='buy', optimize=True)\n    cofi_fastk = IntParameter(1, 100, default=buy_params['cofi_fastk'], space='buy', optimize=True)\n    cofi_fastd = IntParameter(1, 100, default=buy_params['cofi_fastd'], space='buy', optimize=True)\n    cofi_adx = IntParameter(1, 100, default=buy_params['cofi_adx'], space='buy', optimize=True)\n    cofi_ewo_high = DecimalParameter(1.0, 15.0, default=buy_params['cofi_ewo_high'], space='buy', optimize=True)\n\n    # nfi32\n    nfi32_rsi_4 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\n    nfi32_rsi_14 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\n    nfi32_sma_factor = DecimalParameter(0.7, 1.2, default=buy_params['nfi32_sma_factor'], decimals=5, space='buy', optimize=True)\n    nfi32_cti_limit = DecimalParameter(-1.2, 0, default=buy_params['nfi32_cti_limit'], decimals=5, space='buy', optimize=True)\n\n    buy_btc_safe_1d = DecimalParameter(-0.5, -0.015, default=buy_params['buy_btc_safe_1d'], optimize=True)\n    antipump_threshold = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold'], space='buy', optimize=True)\n\n    ewo_1_enabled = BooleanParameter(default=buy_params['ewo_1_enabled'], space='buy', optimize=True)\n    ewo_low_enabled = BooleanParameter(default=buy_params['ewo_low_enabled'], space='buy', optimize=True)\n    cofi_enabled = BooleanParameter(default=buy_params['cofi_enabled'], space='buy', optimize=True)\n    lambo1_enabled = BooleanParameter(default=buy_params['lambo1_enabled'], space='buy', optimize=True)\n    lambo2_enabled = BooleanParameter(default=buy_params['lambo2_enabled'], space='buy', optimize=True)\n    local_trend_enabled = BooleanParameter(default=buy_params['local_trend_enabled'], space='buy', optimize=True)\n    nfi32_enabled = BooleanParameter(default=buy_params['nfi32_enabled'], space='buy', optimize=True)\n    clucha_enabled = BooleanParameter(default=buy_params['clucha_enabled'], space='buy', optimize=True)\n\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n\n        return informative_pairs\n\n\n    ############################################################################\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n       \n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n    \n        return stoploss_from_open(sl_profit, current_profit)\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n\n        # # ClucHA\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['bb_lowerband'] = dataframe['lower']\n        dataframe['bb_middleband'] = dataframe['mid']\n\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        rsi = ta.RSI(dataframe)\n        dataframe[\"rsi\"] = rsi\n        rsi = 0.1 * (rsi - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        inf_tf = '1h'\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n\n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        ### BTC protection\n        dataframe['btc_1m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='1m')['close']\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\n        dataframe = merge_informative_pair(dataframe, btc_1d, '1m', '1d', ffill=True)\n\n        # Pump strength\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n\n        #NOTE: dynamic offset\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\n        dataframe['norm_perc'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_buy.value))\n        dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_sell.value))\n\n        is_btc_safe = (\n            (pct_change(dataframe['btc_1d'], dataframe['btc_1m']).fillna(0) > self.buy_btc_safe_1d.value) &\n            (dataframe['volume'] > 0)           # Make sure Volume is not 0\n        )\n\n        is_pump_safe = (\n            (dataframe['pump_strength'] < self.antipump_threshold.value)\n        )\n\n        lambo1 = (\n            bool(self.lambo1_enabled.value) &\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo1_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < int(self.lambo1_rsi_4_limit.value)) &\n            (dataframe['rsi_14'] < int(self.lambo1_rsi_14_limit.value))\n        )\n        dataframe.loc[lambo1, 'buy_tag'] += 'lambo1_'\n        conditions.append(lambo1)\n\n        lambo2 = (\n            bool(self.lambo2_enabled.value) &\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value)) &\n            (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value))\n        )\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2_'\n        conditions.append(lambo2)\n\n        local_uptrend = (\n            bool(self.local_trend_enabled.value) &\n            (dataframe['ema_26'] > dataframe['ema_14']) &\n            (dataframe['ema_26'] - dataframe['ema_14'] > dataframe['open'] * self.local_trend_ema_diff.value) &\n            (dataframe['ema_26'].shift() - dataframe['ema_14'].shift() > dataframe['open'] / 100) &\n            (dataframe['close'] < dataframe['bb_lowerband2'] * self.local_trend_bb_factor.value) &\n            (dataframe['closedelta'] > dataframe['close'] * self.local_trend_closedelta.value / 1000 )\n        )\n        dataframe.loc[local_uptrend, 'buy_tag'] += 'local_uptrend_'\n        conditions.append(local_uptrend)\n\n        nfi_32 = (\n            bool(self.nfi32_enabled.value) &\n            (dataframe['rsi_20'] < dataframe['rsi_20'].shift(1)) &\n            (dataframe['rsi_4'] < self.nfi32_rsi_4.value) &\n            (dataframe['rsi_14'] > self.nfi32_rsi_14.value) &\n            (dataframe['close'] < dataframe['sma_15'] * self.nfi32_sma_factor.value) &\n            (dataframe['cti'] < self.nfi32_cti_limit.value)\n        )\n        dataframe.loc[nfi_32, 'buy_tag'] += 'nfi_32_'\n        conditions.append(nfi_32)\n\n        ewo_1 = (\n            bool(self.ewo_1_enabled.value) &\n            (dataframe['rsi_4'] < self.ewo_1_rsi_4.value) &\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\n            (dataframe['EWO'] > self.ewo_high.value) &\n            (dataframe['rsi_14'] < self.ewo_1_rsi_14.value) &\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\n        )\n        dataframe.loc[ewo_1, 'buy_tag'] += 'ewo1_'\n        conditions.append(ewo_1)\n\n        ewo_low = (\n            bool(self.ewo_low_enabled.value) &\n            (dataframe['rsi_4'] <  self.ewo_low_rsi_4.value) &\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\n            (dataframe['EWO'] < self.ewo_low.value) &\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\n        )\n        dataframe.loc[ewo_low, 'buy_tag'] += 'ewo_low_'\n        conditions.append(ewo_low)\n\n        cofi = (\n            bool(self.cofi_enabled.value) &\n            (dataframe['open'] < dataframe['ema_8'] * self.cofi_ema.value) &\n            (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n            (dataframe['fastk'] < self.cofi_fastk.value) &\n            (dataframe['fastd'] < self.cofi_fastd.value) &\n            (dataframe['adx'] > self.cofi_adx.value) &\n            (dataframe['EWO'] > self.cofi_ewo_high.value)\n        )\n        dataframe.loc[cofi, 'buy_tag'] += 'cofi_'\n        conditions.append(cofi)\n\n        clucHA = (\n            bool(self.clucha_enabled.value) &\n            (dataframe['rocr_1h'].gt(self.clucha_rocr_1h.value)) &\n            ((\n                (dataframe['lower'].shift().gt(0)) &\n                (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.clucha_bbdelta_close.value)) &\n                (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.clucha_closedelta_close.value)) &\n                (dataframe['tail'].lt(dataframe['bbdelta'] * self.clucha_bbdelta_tail.value)) &\n                (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n            ) |\n            (\n                (dataframe['ha_close'] < dataframe['ema_slow']) &\n                (dataframe['ha_close'] < self.clucha_close_bblower.value * dataframe['bb_lowerband'])\n            ))\n        )\n        dataframe.loc[clucHA, 'buy_tag'] += 'clucHA_'\n        conditions.append(clucHA)\n\n        dataframe.loc[\n            # is_btc_safe &  # broken?\n            # is_pump_safe &\n            reduce(lambda x, y: x | y, conditions),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        \n        dataframe.loc[\n            (dataframe['fisher'] > params['sell-fisher']) &\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\n\n        return True\n\ndef pct_change(a, b):\n    return (b - a) / a\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\nclass ClucHAnix_BB_RPB_MOD2_ROI_DYNAMIC_TB(ClucHAnix_BB_RPB_MOD2_ROI):\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = True\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.01  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.002  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = abs((last_candle['norm_perc']))\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\n        #default_offset = adapt*0.01\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n        \n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n                            \n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n        \n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ClucHAnix_BB_RPB_MOD_CTT/ClucHAnix_BB_RPB_MOD_CTT.py",
    "content": "from datetime import datetime, timedelta, timezone\r\nfrom functools import reduce\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom typing import Dict, List\r\nfrom pandas import DataFrame, Series\r\nfrom freqtrade.persistence import Trade\r\n\r\nimport logging\r\nimport pandas as pd\r\nimport numpy as np\r\nimport time\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport pandas_ta as pta\r\nimport talib.abstract as ta\r\nimport technical.indicators as ftt\r\nfrom freqtrade.persistence import Trade, PairLocks\r\nfrom freqtrade.strategy import (BooleanParameter, DecimalParameter, IntParameter, stoploss_from_open, merge_informative_pair)\r\nfrom skopt.space import Dimension, Integer\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\ndef bollinger_bands(stock_price, window_size, num_of_std):\r\n    rolling_mean = stock_price.rolling(window=window_size).mean()\r\n    rolling_std = stock_price.rolling(window=window_size).std()\r\n    lower_band = rolling_mean - (rolling_std * num_of_std)\r\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\r\n\r\ndef ha_typical_price(bars):\r\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\r\n    return Series(index=bars.index, data=res)\r\n\r\nclass ClucHAnix_BB_RPB_MOD_CTT(IStrategy):\r\n\r\n    # Buy hyperspace params:\r\n    buy_params = {\r\n        \"antipump_threshold\": 0.133,\r\n        \"buy_btc_safe_1d\": -0.311,\r\n        \"clucha_bbdelta_close\": 0.04796,\r\n        \"clucha_bbdelta_tail\": 0.93112,\r\n        \"clucha_close_bblower\": 0.01645,\r\n        \"clucha_closedelta_close\": 0.00931,\r\n        \"clucha_enabled\": False,\r\n        \"clucha_rocr_1h\": 0.41663,\r\n        \"cofi_adx\": 8,\r\n        \"cofi_ema\": 0.639,\r\n        \"cofi_enabled\": False,\r\n        \"cofi_ewo_high\": 5.6,\r\n        \"cofi_fastd\": 40,\r\n        \"cofi_fastk\": 13,\r\n        \"ewo_1_enabled\": False,\r\n        \"ewo_1_rsi_14\": 45,\r\n        \"ewo_1_rsi_4\": 7,\r\n        \"ewo_candles_buy\": 13,\r\n        \"ewo_candles_sell\": 19,\r\n        \"ewo_high\": 5.249,\r\n        \"ewo_high_offset\": 1.04116,\r\n        \"ewo_low\": -11.424,\r\n        \"ewo_low_enabled\": True,\r\n        \"ewo_low_offset\": 0.97463,\r\n        \"ewo_low_rsi_4\": 35,\r\n        \"lambo1_ema_14_factor\": 1.054,\r\n        \"lambo1_enabled\": False,\r\n        \"lambo1_rsi_14_limit\": 26,\r\n        \"lambo1_rsi_4_limit\": 18,\r\n        \"lambo2_ema_14_factor\": 0.981,\r\n        \"lambo2_enabled\": True,\r\n        \"lambo2_rsi_14_limit\": 39,\r\n        \"lambo2_rsi_4_limit\": 44,\r\n        \"local_trend_bb_factor\": 0.823,\r\n        \"local_trend_closedelta\": 19.253,\r\n        \"local_trend_ema_diff\": 0.125,\r\n        \"local_trend_enabled\": True,\r\n        \"nfi32_cti_limit\": -1.09639,\r\n        \"nfi32_enabled\": True,\r\n        \"nfi32_rsi_14\": 15,\r\n        \"nfi32_rsi_4\": 49,\r\n        \"nfi32_sma_factor\": 0.93391,\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n        # custom stoploss params, come from BB_RPB_TSL\r\n        \"pHSL\": -0.32,\r\n        \"pPF_1\": 0.02,\r\n        \"pPF_2\": 0.047,\r\n        \"pSL_1\": 0.02,\r\n        \"pSL_2\": 0.046, \r\n\r\n        'sell-fisher': 0.38414, \r\n        'sell-bbmiddle-close': 1.07634\r\n    }\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.05,\r\n        \"15\": 0.04,\r\n        \"51\": 0.03,\r\n        \"81\": 0.02,\r\n        \"112\": 0.01,\r\n        \"154\": 0.0001,\r\n        \"240\": -10\r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.99   # use custom stoploss\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.001\r\n    trailing_stop_positive_offset = 0.012\r\n    trailing_only_offset_is_reached = False\r\n\r\n    \"\"\"\r\n    END HYPEROPT\r\n    \"\"\"\r\n\r\n    timeframe = '5m'\r\n\r\n    # Make sure these match or are not overridden in config\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Custom stoploss\r\n    use_custom_stoploss = True\r\n\r\n    process_only_new_candles = True\r\n    startup_candle_count = 200\r\n\r\n    order_types = {\r\n        'buy': 'market',\r\n        'sell': 'market',\r\n        'emergencysell': 'market',\r\n        'forcebuy': \"market\",\r\n        'forcesell': 'market',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False,\r\n\r\n        'stoploss_on_exchange_interval': 60,\r\n        'stoploss_on_exchange_limit_ratio': 0.99\r\n    }\r\n\r\n    # hard stoploss profit\r\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\r\n    # profit threshold 1, trigger point, SL_1 is used\r\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\r\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\r\n\r\n    # profit threshold 2, SL_2 is used\r\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\r\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\r\n    \r\n    # buy param\r\n    # ClucHA\r\n    clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=buy_params['clucha_bbdelta_close'], decimals=5, space='buy', optimize=True)\r\n    clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=buy_params['clucha_bbdelta_tail'], decimals=5, space='buy', optimize=True)\r\n    clucha_close_bblower = DecimalParameter(0.001, 0.05, default=buy_params['clucha_close_bblower'], decimals=5, space='buy', optimize=True)\r\n    clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=buy_params['clucha_closedelta_close'], decimals=5, space='buy', optimize=True)\r\n    clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=buy_params['clucha_rocr_1h'], decimals=5, space='buy', optimize=True)\r\n\r\n    # lambo1\r\n    lambo1_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo1_ema_14_factor'], space='buy', optimize=True)\r\n    lambo1_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_4_limit'], space='buy', optimize=True)\r\n    lambo1_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_14_limit'], space='buy', optimize=True)\r\n\r\n    # lambo2\r\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\r\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\r\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\r\n\r\n    # local_uptrend\r\n    local_trend_ema_diff = DecimalParameter(0, 0.2, default=buy_params['local_trend_ema_diff'], space='buy', optimize=True)\r\n    local_trend_bb_factor = DecimalParameter(0.8, 1.2, default=buy_params['local_trend_bb_factor'], space='buy', optimize=True)\r\n    local_trend_closedelta = DecimalParameter(5.0, 30.0, default=buy_params['local_trend_closedelta'], space='buy', optimize=True)\r\n\r\n    # ewo_1 and ewo_low\r\n    ewo_candles_buy = IntParameter(2, 30, default=buy_params['ewo_candles_buy'], space='buy', optimize=True)\r\n    ewo_candles_sell = IntParameter(2, 35, default=buy_params['ewo_candles_sell'], space='buy', optimize=True)\r\n    ewo_low_offset = DecimalParameter(0.7, 1.2, default=buy_params['ewo_low_offset'], decimals=5, space='buy', optimize=True)\r\n    ewo_high_offset = DecimalParameter(0.75, 1.5, default=buy_params['ewo_high_offset'], decimals=5, space='buy', optimize=True)\r\n    ewo_high = DecimalParameter(2.0, 15.0, default=buy_params['ewo_high'], space='buy', optimize=True)\r\n    ewo_1_rsi_14 = IntParameter(10, 100, default=buy_params['ewo_1_rsi_14'], space='buy', optimize=True)\r\n    ewo_1_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_1_rsi_4'], space='buy', optimize=True)\r\n    ewo_low_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_low_rsi_4'], space='buy', optimize=True)\r\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\r\n\r\n    # cofi\r\n    cofi_ema = DecimalParameter(0.6, 1.4, default=buy_params['cofi_ema'] , space='buy', optimize=True)\r\n    cofi_fastk = IntParameter(1, 100, default=buy_params['cofi_fastk'], space='buy', optimize=True)\r\n    cofi_fastd = IntParameter(1, 100, default=buy_params['cofi_fastd'], space='buy', optimize=True)\r\n    cofi_adx = IntParameter(1, 100, default=buy_params['cofi_adx'], space='buy', optimize=True)\r\n    cofi_ewo_high = DecimalParameter(1.0, 15.0, default=buy_params['cofi_ewo_high'], space='buy', optimize=True)\r\n\r\n    # nfi32\r\n    nfi32_rsi_4 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\r\n    nfi32_rsi_14 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\r\n    nfi32_sma_factor = DecimalParameter(0.7, 1.2, default=buy_params['nfi32_sma_factor'], decimals=5, space='buy', optimize=True)\r\n    nfi32_cti_limit = DecimalParameter(-1.2, 0, default=buy_params['nfi32_cti_limit'], decimals=5, space='buy', optimize=True)\r\n\r\n    buy_btc_safe_1d = DecimalParameter(-0.5, -0.015, default=buy_params['buy_btc_safe_1d'], optimize=True)\r\n    antipump_threshold = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold'], space='buy', optimize=True)\r\n\r\n    ewo_1_enabled = BooleanParameter(default=buy_params['ewo_1_enabled'], space='buy', optimize=True)\r\n    ewo_low_enabled = BooleanParameter(default=buy_params['ewo_low_enabled'], space='buy', optimize=True)\r\n    cofi_enabled = BooleanParameter(default=buy_params['cofi_enabled'], space='buy', optimize=True)\r\n    lambo1_enabled = BooleanParameter(default=buy_params['lambo1_enabled'], space='buy', optimize=True)\r\n    lambo2_enabled = BooleanParameter(default=buy_params['lambo2_enabled'], space='buy', optimize=True)\r\n    local_trend_enabled = BooleanParameter(default=buy_params['local_trend_enabled'], space='buy', optimize=True)\r\n    nfi32_enabled = BooleanParameter(default=buy_params['nfi32_enabled'], space='buy', optimize=True)\r\n    clucha_enabled = BooleanParameter(default=buy_params['clucha_enabled'], space='buy', optimize=True)\r\n\r\n\r\n    def informative_pairs(self):\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, '1h') for pair in pairs]\r\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\r\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\r\n\r\n        return informative_pairs\r\n\r\n\r\n    ############################################################################\r\n\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\r\n                        current_rate: float, current_profit: float, **kwargs) -> float:\r\n       \r\n        # hard stoploss profit\r\n        HSL = self.pHSL.value\r\n        PF_1 = self.pPF_1.value\r\n        SL_1 = self.pSL_1.value\r\n        PF_2 = self.pPF_2.value\r\n        SL_2 = self.pSL_2.value\r\n\r\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\r\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\r\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\r\n\r\n        if (current_profit > PF_2):\r\n            sl_profit = SL_2 + (current_profit - PF_2)\r\n        elif (current_profit > PF_1):\r\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\r\n        else:\r\n            sl_profit = HSL\r\n\r\n        # Only for hyperopt invalid return\r\n        if (sl_profit >= current_profit):\r\n            return -0.99\r\n    \r\n        return stoploss_from_open(sl_profit, current_profit)\r\n\r\n    ############################################################################\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # Heikin Ashi Candles\r\n        heikinashi = qtpylib.heikinashi(dataframe)\r\n        dataframe['ha_open'] = heikinashi['open']\r\n        dataframe['ha_close'] = heikinashi['close']\r\n        dataframe['ha_high'] = heikinashi['high']\r\n        dataframe['ha_low'] = heikinashi['low']\r\n\r\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\r\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\r\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\r\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\r\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\r\n\r\n        # CTI\r\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\r\n        \r\n        # Avg Volume\r\n        \r\n        dataframe['avg_volume'] = ta.SMA(dataframe['volume'], timeperiod=200)\r\n        dataframe['vroc_bool'] = (dataframe['avg_volume'] > dataframe['avg_volume'].shift(1)) & (dataframe['close'] > dataframe['close'].shift(1))\r\n        dataframe['vroc'] = np.where(dataframe['vroc_bool'] == True, ((dataframe['avg_volume'] - dataframe['avg_volume'].shift(1)) * (100 / dataframe['avg_volume'].shift(1))), 0)\r\n        #dataframe['vroc'] = (dataframe['avg_volume'] - dataframe['avg_volume'].shift(1)) * (100 / dataframe['avg_volume'].shift(1))\r\n        #if (dataframe['vroc'] > dataframe['historicMax'].rolling(200).max()):\r\n        #    dataframe['historicMax'] = dataframe['vroc']\r\n        #dataframe.loc[0,'historicMax'] = 10\r\n        #dataframe['historicMax'] = np.where(dataframe['vroc'] > dataframe['historicMax'].shift(1), dataframe['vroc'].rolling(200).max(), dataframe['historicMax'].shift(1).rolling(200).max())\r\n        dataframe['vroc_max'] = dataframe['vroc'].rolling(200).max()\r\n        dataframe['historicMax'] = np.where(dataframe['vroc_max'] > 10, dataframe['vroc_max'], 10)\r\n        dataframe['historicMax'] = dataframe['historicMax'].rolling(200).max()\r\n        dataframe['vroc_normalized'] = 100 * dataframe['vroc'] / dataframe['historicMax']\r\n        dataframe['recent_pump'] = ((dataframe['vroc_normalized'].rolling(96).max() > 90) | (dataframe['vroc_normalized'].rolling(48).max() > 10) | (dataframe['vroc_normalized'].rolling(24).max() > 5)) & (dataframe['vroc_bool'] == True)\r\n\r\n        # Cofi\r\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\r\n        dataframe['fastd'] = stoch_fast['fastd']\r\n        dataframe['fastk'] = stoch_fast['fastk']\r\n        dataframe['adx'] = ta.ADX(dataframe)\r\n\r\n        # Set Up Bollinger Bands\r\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\r\n        dataframe['lower'] = lower\r\n        dataframe['mid'] = mid\r\n\r\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\r\n        dataframe['bb_lowerband2'] = bollinger2['lower']\r\n        dataframe['bb_middleband2'] = bollinger2['mid']\r\n        dataframe['bb_upperband2'] = bollinger2['upper']\r\n\r\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\r\n\r\n\r\n        # # ClucHA\r\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\r\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\r\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\r\n        dataframe['bb_lowerband'] = dataframe['lower']\r\n        dataframe['bb_middleband'] = dataframe['mid']\r\n\r\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\r\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\r\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\r\n\r\n        # Elliot\r\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\r\n\r\n        rsi = ta.RSI(dataframe)\r\n        dataframe[\"rsi\"] = rsi\r\n        rsi = 0.1 * (rsi - 50)\r\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\r\n\r\n        inf_tf = '1h'\r\n\r\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\r\n\r\n        inf_heikinashi = qtpylib.heikinashi(informative)\r\n\r\n        informative['ha_close'] = inf_heikinashi['close']\r\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\r\n\r\n\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\r\n\r\n        ### BTC protection\r\n        dataframe['btc_1m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='1m')['close']\r\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\r\n        dataframe = merge_informative_pair(dataframe, btc_1d, '1m', '1d', ffill=True)\r\n\r\n        # Pump strength\r\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\r\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\r\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\r\n        \r\n        #NOTE: dynamic offset\r\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\r\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\r\n        dataframe['norm_perc'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        dataframe.loc[:, 'buy_tag'] = ''\r\n\r\n        dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_buy.value))\r\n        dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_sell.value))\r\n\r\n        is_btc_safe = (\r\n            (pct_change(dataframe['btc_1d'], dataframe['btc_1m']).fillna(0) > self.buy_btc_safe_1d.value) &\r\n            (dataframe['volume'] > 0)           # Make sure Volume is not 0\r\n        )\r\n\r\n        is_pump_safe = (\r\n            (dataframe['pump_strength'] < self.antipump_threshold.value)\r\n        )\r\n\r\n        lambo1 = (\r\n            bool(self.lambo1_enabled.value) &\r\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo1_ema_14_factor.value)) &\r\n            (dataframe['rsi_4'] < int(self.lambo1_rsi_4_limit.value)) &\r\n            (dataframe['rsi_14'] < int(self.lambo1_rsi_14_limit.value)) &\r\n            (dataframe['cti'] < -0.5) &\r\n            (dataframe['recent_pump'] == False) \r\n        )\r\n        dataframe.loc[lambo1, 'buy_tag'] += 'lambo1_'\r\n        conditions.append(lambo1)\r\n\r\n        lambo2 = (\r\n            bool(self.lambo2_enabled.value) &\r\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value)) &\r\n            (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value)) &\r\n            (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value)) &\r\n            (dataframe['cti'] < -0.5) &\r\n            (dataframe['recent_pump'] == False) \r\n        )\r\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2_'\r\n        conditions.append(lambo2)\r\n\r\n        local_uptrend = (\r\n            bool(self.local_trend_enabled.value) &\r\n            (dataframe['ema_26'] > dataframe['ema_14']) &\r\n            (dataframe['ema_26'] - dataframe['ema_14'] > dataframe['open'] * self.local_trend_ema_diff.value) &\r\n            (dataframe['ema_26'].shift() - dataframe['ema_14'].shift() > dataframe['open'] / 100) &\r\n            (dataframe['close'] < dataframe['bb_lowerband2'] * self.local_trend_bb_factor.value) &\r\n            (dataframe['closedelta'] > dataframe['close'] * self.local_trend_closedelta.value / 1000 ) &\r\n            (dataframe['recent_pump'] == False)\r\n            \r\n        )\r\n        dataframe.loc[local_uptrend, 'buy_tag'] += 'local_uptrend_'\r\n        conditions.append(local_uptrend)\r\n\r\n        nfi_32 = (\r\n            bool(self.nfi32_enabled.value) &\r\n            (dataframe['rsi_20'] < dataframe['rsi_20'].shift(1)) &\r\n            (dataframe['rsi_4'] < self.nfi32_rsi_4.value) &\r\n            (dataframe['rsi_14'] > self.nfi32_rsi_14.value) &\r\n            (dataframe['close'] < dataframe['sma_15'] * self.nfi32_sma_factor.value) &\r\n            (dataframe['cti'] < self.nfi32_cti_limit.value) &\r\n            (dataframe['recent_pump'] == False)\r\n        )\r\n        dataframe.loc[nfi_32, 'buy_tag'] += 'nfi_32_'\r\n        conditions.append(nfi_32)\r\n\r\n        ewo_1 = (\r\n            bool(self.ewo_1_enabled.value) &\r\n            (dataframe['rsi_4'] < self.ewo_1_rsi_4.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\r\n            (dataframe['EWO'] > self.ewo_high.value) &\r\n            (dataframe['rsi_14'] < self.ewo_1_rsi_14.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value)) &\r\n            (dataframe['recent_pump'] == False)\r\n        )\r\n        dataframe.loc[ewo_1, 'buy_tag'] += 'ewo1_'\r\n        conditions.append(ewo_1)\r\n\r\n        ewo_low = (\r\n            bool(self.ewo_low_enabled.value) &\r\n            (dataframe['rsi_4'] <  self.ewo_low_rsi_4.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\r\n            (dataframe['EWO'] < self.ewo_low.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value)) &\r\n            (dataframe['recent_pump'] == False)\r\n        )\r\n        dataframe.loc[ewo_low, 'buy_tag'] += 'ewo_low_'\r\n        conditions.append(ewo_low)\r\n\r\n        cofi = (\r\n            bool(self.cofi_enabled.value) &\r\n            (dataframe['open'] < dataframe['ema_8'] * self.cofi_ema.value) &\r\n            (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\r\n            (dataframe['fastk'] < self.cofi_fastk.value) &\r\n            (dataframe['fastd'] < self.cofi_fastd.value) &\r\n            (dataframe['adx'] > self.cofi_adx.value) &\r\n            (dataframe['EWO'] > self.cofi_ewo_high.value) &\r\n            (dataframe['recent_pump'] == False)\r\n        )\r\n        dataframe.loc[cofi, 'buy_tag'] += 'cofi_'\r\n        conditions.append(cofi)\r\n\r\n        clucHA = (\r\n            bool(self.clucha_enabled.value) &\r\n            (dataframe['rocr_1h'].gt(self.clucha_rocr_1h.value)) &\r\n            ((\r\n                (dataframe['lower'].shift().gt(0)) &\r\n                (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.clucha_bbdelta_close.value)) &\r\n                (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.clucha_closedelta_close.value)) &\r\n                (dataframe['tail'].lt(dataframe['bbdelta'] * self.clucha_bbdelta_tail.value)) &\r\n                (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\r\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift())) &\r\n            (dataframe['recent_pump'] == False)\r\n            ) |\r\n            (\r\n                (dataframe['ha_close'] < dataframe['ema_slow']) &\r\n                (dataframe['ha_close'] < self.clucha_close_bblower.value * dataframe['bb_lowerband']) &\r\n            (dataframe['recent_pump'] == False)\r\n            ))\r\n        )\r\n        dataframe.loc[clucHA, 'buy_tag'] += 'clucHA_'\r\n        conditions.append(clucHA)\r\n\r\n        dataframe.loc[\r\n            # is_btc_safe &  # broken?\r\n            # is_pump_safe &\r\n            reduce(lambda x, y: x | y, conditions),\r\n            'buy'\r\n        ] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        params = self.sell_params\r\n        \r\n        dataframe.loc[\r\n            (dataframe['fisher'] > params['sell-fisher']) &\r\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\r\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\r\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\r\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\r\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\r\n            (dataframe['volume'] > 0)\r\n            ,\r\n            'sell'\r\n        ] = 1\r\n\r\n        return dataframe\r\n\r\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\r\n                           rate: float, time_in_force: str, sell_reason: str,\r\n                           current_time: datetime, **kwargs) -> bool:\r\n\r\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\r\n\r\n        return True\r\n\r\ndef pct_change(a, b):\r\n    return (b - a) / a\r\n\r\ndef EWO(dataframe, ema_length=5, ema2_length=35):\r\n    df = dataframe.copy()\r\n    ema1 = ta.EMA(df, timeperiod=ema_length)\r\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\r\n    emadif = (ema1 - ema2) / df['low'] * 100\r\n    return emadif\r\n\r\nclass ClucHAnix_BB_RPB_MOD_CTT_STB(ClucHAnix_BB_RPB_MOD_CTT):\r\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\r\n    #\r\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\r\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\r\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\r\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\r\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\r\n    #\r\n\r\n    process_only_new_candles = True\r\n\r\n    custom_info_trail_buy = dict()\r\n\r\n    # Trailing buy parameters\r\n    trailing_buy_order_enabled = True\r\n    trailing_expire_seconds = 1800\r\n\r\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\r\n    trailing_buy_uptrend_enabled = False\r\n    trailing_expire_seconds_uptrend = 90\r\n    min_uptrend_trailing_profit = 0.02\r\n\r\n    debug_mode = True\r\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\r\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\r\n\r\n    init_trailing_dict = {\r\n        'trailing_buy_order_started': False,\r\n        'trailing_buy_order_uplimit': 0,\r\n        'start_trailing_price': 0,\r\n        'buy_tag': None,\r\n        'start_trailing_time': None,\r\n        'offset': 0,\r\n        'allow_trailing': False,\r\n    }\r\n\r\n    def trailing_buy(self, pair, reinit=False):\r\n        # returns trailing buy info for pair (init if necessary)\r\n        if not pair in self.custom_info_trail_buy:\r\n            self.custom_info_trail_buy[pair] = dict()\r\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\r\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\r\n        return self.custom_info_trail_buy[pair]['trailing_buy']\r\n\r\n    def trailing_buy_info(self, pair: str, current_price: float):\r\n        # current_time live, dry run\r\n        current_time = datetime.now(timezone.utc)\r\n        if not self.debug_mode:\r\n            return\r\n        trailing_buy = self.trailing_buy(pair)\r\n\r\n        duration = 0\r\n        try:\r\n            duration = (current_time - trailing_buy['start_trailing_time'])\r\n        except TypeError:\r\n            duration = 0\r\n        finally:\r\n            logger.info(\r\n                f\"pair: {pair} : \"\r\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\r\n                f\"duration: {duration}, \"\r\n                f\"current: {current_price:.4f}, \"\r\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\r\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\r\n                f\"offset: {trailing_buy['offset']}\")\r\n\r\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if trailing_buy['trailing_buy_order_started']:\r\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\r\n        else:\r\n            return 0\r\n\r\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\r\n        # return rebound limit before a buy in % of initial price, function of current price\r\n        # return None to stop trailing buy (will start again at next buy signal)\r\n        # return 'forcebuy' to force immediate buy\r\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\r\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\r\n        default_offset = 0.005\r\n\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if not trailing_buy['trailing_buy_order_started']:\r\n            return default_offset\r\n\r\n        # example with duration and indicators\r\n        # dry run, live only\r\n        last_candle = dataframe.iloc[-1]\r\n        current_time = datetime.now(timezone.utc)\r\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\r\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\r\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\r\n                # more than 1h, price under first signal, buy signal still active -> buy\r\n                return 'forcebuy'\r\n            else:\r\n                # wait for next signal\r\n                return None\r\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\r\n            # less than 90s and price is rising, buy\r\n            return 'forcebuy'\r\n\r\n        if current_trailing_profit_ratio < 0:\r\n            # current price is higher than initial price\r\n            return default_offset\r\n\r\n        trailing_buy_offset = {\r\n            0.06: 0.02,\r\n            0.03: 0.01,\r\n            0: default_offset,\r\n        }\r\n\r\n        for key in trailing_buy_offset:\r\n            if current_trailing_profit_ratio > key:\r\n                return trailing_buy_offset[key]\r\n\r\n        return default_offset\r\n\r\n    # end of trailing buy parameters\r\n    # -----------------------------------------------------\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_indicators(dataframe, metadata)\r\n        self.trailing_buy(metadata['pair'])\r\n        return dataframe\r\n\r\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\r\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\r\n        \r\n        if val:\r\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\r\n                val = False\r\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n                if(len(dataframe) >= 1):\r\n                    last_candle = dataframe.iloc[-1].squeeze()\r\n                    current_price = rate\r\n                    trailing_buy = self.trailing_buy(pair)\r\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\r\n\r\n                    if trailing_buy['allow_trailing']:\r\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\r\n                            # start trailing buy\r\n                            \r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\r\n\r\n                            trailing_buy['trailing_buy_order_started'] = True\r\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            trailing_buy['start_trailing_price'] = last_candle['close']\r\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\r\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            trailing_buy['offset'] = 0\r\n                            \r\n                            self.trailing_buy_info(pair, current_price)\r\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\r\n\r\n                        elif trailing_buy['trailing_buy_order_started']:\r\n                            if trailing_buy_offset == 'forcebuy':\r\n                                # buy in custom conditions\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\r\n\r\n                            elif trailing_buy_offset is None:\r\n                                # stop trailing buy custom conditions\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\r\n\r\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\r\n                                # update uplimit\r\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\r\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\r\n                                # buy ! current price > uplimit && lower thant starting price\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\r\n\r\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\r\n                                # stop trailing buy because price is too high\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\r\n                            else:\r\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'price too high for {pair} !')\r\n\r\n                    else:\r\n                        logger.info(f\"Wait for next buy signal for {pair}\")\r\n\r\n                if (val == True):\r\n                    self.trailing_buy_info(pair, rate)\r\n                    self.trailing_buy(pair, reinit=True)\r\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\r\n        \r\n        return val\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_buy_trend(dataframe, metadata)\r\n\r\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \r\n            last_candle = dataframe.iloc[-1].squeeze()\r\n            trailing_buy = self.trailing_buy(metadata['pair'])\r\n            if (last_candle['buy'] == 1):\r\n                if not trailing_buy['trailing_buy_order_started']:\r\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\r\n                    if not open_trades:\r\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\r\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\r\n                        trailing_buy['allow_trailing'] = True\r\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\r\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\r\n            else:\r\n                if (trailing_buy['trailing_buy_order_started'] == True):\r\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\r\n                    dataframe.loc[:,'buy'] = 1\r\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\r\n                    # dataframe['buy'] = 1\r\n\r\n        return dataframe\r\n        \r\nclass ClucHAnix_BB_RPB_MOD_CTT_DTB(ClucHAnix_BB_RPB_MOD_CTT):\r\n\r\n    process_only_new_candles = True\r\n\r\n    custom_info_trail_buy = dict()\r\n\r\n    # Trailing buy parameters\r\n    trailing_buy_order_enabled = True\r\n    trailing_expire_seconds = 1800\r\n\r\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\r\n    trailing_buy_uptrend_enabled = True\r\n    trailing_expire_seconds_uptrend = 90\r\n    min_uptrend_trailing_profit = 0.02\r\n\r\n    debug_mode = True\r\n    trailing_buy_max_stop = 0.01  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\r\n    trailing_buy_max_buy = 0.002  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\r\n\r\n    init_trailing_dict = {\r\n        'trailing_buy_order_started': False,\r\n        'trailing_buy_order_uplimit': 0,\r\n        'start_trailing_price': 0,\r\n        'buy_tag': None,\r\n        'start_trailing_time': None,\r\n        'offset': 0,\r\n        'allow_trailing': False,\r\n    }\r\n\r\n    def trailing_buy(self, pair, reinit=False):\r\n        # returns trailing buy info for pair (init if necessary)\r\n        if not pair in self.custom_info_trail_buy:\r\n            self.custom_info_trail_buy[pair] = dict()\r\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\r\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\r\n        return self.custom_info_trail_buy[pair]['trailing_buy']\r\n\r\n    def trailing_buy_info(self, pair: str, current_price: float):\r\n        # current_time live, dry run\r\n        current_time = datetime.now(timezone.utc)\r\n        if not self.debug_mode:\r\n            return\r\n        trailing_buy = self.trailing_buy(pair)\r\n\r\n        duration = 0\r\n        try:\r\n            duration = (current_time - trailing_buy['start_trailing_time'])\r\n        except TypeError:\r\n            duration = 0\r\n        finally:\r\n            logger.info(\r\n                f\"pair: {pair} : \"\r\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\r\n                f\"duration: {duration}, \"\r\n                f\"current: {current_price:.4f}, \"\r\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\r\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\r\n                f\"offset: {trailing_buy['offset']}\")\r\n\r\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if trailing_buy['trailing_buy_order_started']:\r\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\r\n        else:\r\n            return 0\r\n\r\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\r\n        # return rebound limit before a buy in % of initial price, function of current price\r\n        # return None to stop trailing buy (will start again at next buy signal)\r\n        # return 'forcebuy' to force immediate buy\r\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\r\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\r\n        last_candle = dataframe.iloc[-1]\r\n        adapt  = abs((last_candle['perc_norm']))\r\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\r\n        #default_offset = adapt*0.01\r\n\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if not trailing_buy['trailing_buy_order_started']:\r\n            return default_offset\r\n\r\n        # example with duration and indicators\r\n        # dry run, live only\r\n        last_candle = dataframe.iloc[-1]\r\n        current_time = datetime.now(timezone.utc)\r\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\r\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\r\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\r\n                # more than 1h, price under first signal, buy signal still active -> buy\r\n                return 'forcebuy'\r\n            else:\r\n                # wait for next signal\r\n                return None\r\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\r\n            # less than 90s and price is rising, buy\r\n            return 'forcebuy'\r\n\r\n        if current_trailing_profit_ratio < 0:\r\n            # current price is higher than initial price\r\n            return default_offset\r\n\r\n        trailing_buy_offset = {\r\n            0.06: 0.02,\r\n            0.03: 0.01,\r\n            0: default_offset,\r\n        }\r\n\r\n        for key in trailing_buy_offset:\r\n            if current_trailing_profit_ratio > key:\r\n                return trailing_buy_offset[key]\r\n\r\n        return default_offset\r\n\r\n    # end of trailing buy parameters\r\n    # -----------------------------------------------------\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_indicators(dataframe, metadata)\r\n        self.trailing_buy(metadata['pair'])\r\n        return dataframe\r\n\r\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\r\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\r\n        \r\n        if val:\r\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\r\n                val = False\r\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n                if(len(dataframe) >= 1):\r\n                    last_candle = dataframe.iloc[-1].squeeze()\r\n                    current_price = rate\r\n                    trailing_buy = self.trailing_buy(pair)\r\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\r\n\r\n                    if trailing_buy['allow_trailing']:\r\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\r\n                            # start trailing buy\r\n\r\n                            trailing_buy['trailing_buy_order_started'] = True\r\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            trailing_buy['start_trailing_price'] = last_candle['close']\r\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\r\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            trailing_buy['offset'] = 0\r\n                            \r\n                            self.trailing_buy_info(pair, current_price)\r\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\r\n\r\n                        elif trailing_buy['trailing_buy_order_started']:\r\n                            if trailing_buy_offset == 'forcebuy':\r\n                                # buy in custom conditions\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\r\n\r\n                            elif trailing_buy_offset is None:\r\n                                # stop trailing buy custom conditions\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\r\n\r\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\r\n                                # update uplimit\r\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\r\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\r\n                                # buy ! current price > uplimit && lower thant starting price\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\r\n\r\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\r\n                                # stop trailing buy because price is too high\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\r\n                            else:\r\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'price too high for {pair} !')\r\n\r\n                    else:\r\n                        logger.info(f\"Wait for next buy signal for {pair}\")\r\n\r\n                if (val == True):\r\n                    self.trailing_buy_info(pair, rate)\r\n                    self.trailing_buy(pair, reinit=True)\r\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\r\n        \r\n        return val\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_buy_trend(dataframe, metadata)\r\n\r\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \r\n            last_candle = dataframe.iloc[-1].squeeze()\r\n            trailing_buy = self.trailing_buy(metadata['pair'])\r\n            if (last_candle['buy'] == 1):\r\n                if not trailing_buy['trailing_buy_order_started']:\r\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\r\n                    if not open_trades:\r\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\r\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\r\n                        trailing_buy['allow_trailing'] = True\r\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\r\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\r\n            else:\r\n                if (trailing_buy['trailing_buy_order_started'] == True):\r\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\r\n                    dataframe.loc[:,'buy'] = 1\r\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\r\n                    # dataframe['buy'] = 1\r\n\r\n        return dataframe\r\n\r\n"
  },
  {
    "path": "strategies/ClucHAnix_BB_RPB_MOD_E0V1E_ROI/ClucHAnix_BB_RPB_MOD_E0V1E_ROI.py",
    "content": "from datetime import datetime, timedelta, timezone\r\nfrom functools import reduce\r\nfrom typing import List\r\n# --- Do not remove these libs ---\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom typing import Dict, List\r\nfrom pandas import DataFrame, Series\r\n# --------------------------------\r\nimport logging\r\nimport pandas as pd\r\nimport numpy as np\r\nfrom freqtrade.persistence import Trade\r\nimport time\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport pandas_ta as pta\r\nimport talib.abstract as ta\r\nimport technical.indicators as ftt\r\nfrom freqtrade.persistence import Trade, PairLocks\r\nfrom freqtrade.strategy import (BooleanParameter, DecimalParameter,\r\n                                IntParameter, stoploss_from_open, merge_informative_pair)\r\nfrom skopt.space import Dimension, Integer\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\ndef bollinger_bands(stock_price, window_size, num_of_std):\r\n    rolling_mean = stock_price.rolling(window=window_size).mean()\r\n    rolling_std = stock_price.rolling(window=window_size).std()\r\n    lower_band = rolling_mean - (rolling_std * num_of_std)\r\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\r\n\r\ndef ha_typical_price(bars):\r\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\r\n    return Series(index=bars.index, data=res)\r\n\r\nclass ClucHAnix_BB_RPB_MOD_E0V1E_ROI(IStrategy):\r\n\r\n    \"\"\"\r\n    VERSION MODIFIED BY REUNIWARE (InvestDataSystems@Yahoo.Com / 2021)\r\n    THIS VERSION CONTAINS HYPEROPT SETTINGS FROM E0V1E (cf. https://discord.gg/Ayvcvs6N )\r\n    \"\"\"\r\n    class HyperOpt:\r\n        @staticmethod\r\n        def generate_roi_table(params: Dict) -> Dict[int, float]:\r\n            roi_table = {}\r\n            roi_table[0] = params['roi_p1'] + params['roi_p2'] + params['roi_p3'] + params['roi_p4'] + params[\r\n                'roi_p5'] + params['roi_p6']\r\n            roi_table[params['roi_t6']] = params['roi_p1'] + params['roi_p2'] + params['roi_p3'] + params['roi_p4'] + \\\r\n                                          params['roi_p5']\r\n            roi_table[params['roi_t6'] + params['roi_t5']] = params['roi_p1'] + params['roi_p2'] + params['roi_p3'] + \\\r\n                                                             params['roi_p4']\r\n            roi_table[params['roi_t6'] + params['roi_t5'] + params['roi_t4']] = params['roi_p1'] + params['roi_p2'] + \\\r\n                                                                                params['roi_p3']\r\n            roi_table[params['roi_t6'] + params['roi_t5'] + params['roi_t4'] + params['roi_t3']] = params['roi_p1'] + \\\r\n                                                                                                   params['roi_p2']\r\n            roi_table[params['roi_t6'] + params['roi_t5'] + params['roi_t4'] + params['roi_t3'] + params['roi_t2']] = \\\r\n            params['roi_p1']\r\n            roi_table[\r\n                params['roi_t6'] + params['roi_t5'] + params['roi_t4'] + params['roi_t3'] + params['roi_t2'] + params[\r\n                    'roi_t1']] = 0\r\n\r\n            return roi_table\r\n\r\n        @staticmethod\r\n        def roi_space() -> List[Dimension]:\r\n            return [\r\n                Integer(1, 15, name='roi_t6'),\r\n                Integer(1, 45, name='roi_t5'),\r\n                Integer(1, 90, name='roi_t4'),\r\n                Integer(45, 120, name='roi_t3'),\r\n                Integer(45, 180, name='roi_t2'),\r\n                Integer(90, 300, name='roi_t1'),\r\n\r\n                Real(0.005, 0.10, name='roi_p6'),\r\n                Real(0.005, 0.07, name='roi_p5'),\r\n                Real(0.005, 0.05, name='roi_p4'),\r\n                Real(0.005, 0.025, name='roi_p3'),\r\n                Real(0.005, 0.01, name='roi_p2'),\r\n                Real(0.003, 0.007, name='roi_p1'),\r\n            ]\r\n\r\n    buy_params = {\r\n        \"antipump_threshold\": 0.133,\r\n        \"buy_btc_safe_1d\": -0.311,\r\n        \"clucha_bbdelta_close\": 0.04796,\r\n        \"clucha_bbdelta_tail\": 0.93112,\r\n        \"clucha_close_bblower\": 0.01645,\r\n        \"clucha_closedelta_close\": 0.00931,\r\n        \"clucha_enabled\": False,\r\n        \"clucha_rocr_1h\": 0.41663,\r\n        \"cofi_adx\": 8,\r\n        \"cofi_ema\": 0.639,\r\n        \"cofi_enabled\": False,\r\n        \"cofi_ewo_high\": 5.6,\r\n        \"cofi_fastd\": 40,\r\n        \"cofi_fastk\": 13,\r\n        \"ewo_1_enabled\": False,\r\n        \"ewo_1_rsi_14\": 45,\r\n        \"ewo_1_rsi_4\": 7,\r\n        \"ewo_candles_buy\": 13,\r\n        \"ewo_candles_sell\": 19,\r\n        \"ewo_high\": 5.249,\r\n        \"ewo_high_offset\": 1.04116,\r\n        \"ewo_low\": -11.424,\r\n        \"ewo_low_enabled\": True,\r\n        \"ewo_low_offset\": 0.97463,\r\n        \"ewo_low_rsi_4\": 35,\r\n        \"lambo1_ema_14_factor\": 1.054,\r\n        \"lambo1_enabled\": False,\r\n        \"lambo1_rsi_14_limit\": 26,\r\n        \"lambo1_rsi_4_limit\": 18,\r\n        \"lambo2_ema_14_factor\": 0.981,\r\n        \"lambo2_enabled\": True,\r\n        \"lambo2_rsi_14_limit\": 39,\r\n        \"lambo2_rsi_4_limit\": 44,\r\n        \"local_trend_bb_factor\": 0.823,\r\n        \"local_trend_closedelta\": 19.253,\r\n        \"local_trend_ema_diff\": 0.125,\r\n        \"local_trend_enabled\": True,\r\n        \"nfi32_cti_limit\": -1.09639,\r\n        \"nfi32_enabled\": True,\r\n        \"nfi32_rsi_14\": 15,\r\n        \"nfi32_rsi_4\": 49,\r\n        \"nfi32_sma_factor\": 0.93391,\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n     # custom stoploss params, come from BB_RPB_TSL\r\n    \"pHSL\": -0.134,\r\n    \"pPF_1\": 0.02,\r\n    \"pPF_2\": 0.047,\r\n    \"pSL_1\": 0.02,\r\n    \"pSL_2\": 0.046,\r\n\r\n    'sell-fisher': 0.38414, \r\n    'sell-bbmiddle-close': 1.07634\r\n    }\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n    \"0\": 0.10347601757573865,\r\n    \"3\": 0.050495605759981035,\r\n    \"5\": 0.03350898081823659,\r\n    \"61\": 0.0275218557571848,\r\n    \"125\": 0.011112591523667215,\r\n    \"292\": 0.005185372158403069,\r\n    \"399\": 0\r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.99   # use custom stoploss\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.3207\r\n    trailing_stop_positive_offset = 0.3849\r\n    trailing_only_offset_is_reached = False\r\n\r\n    \"\"\"\r\n    END HYPEROPT\r\n    \"\"\"\r\n\r\n    timeframe = '5m'\r\n\r\n    # Make sure these match or are not overridden in config\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Custom stoploss\r\n    use_custom_stoploss = True\r\n\r\n    process_only_new_candles = True\r\n    startup_candle_count = 200\r\n\r\n    order_types = {\r\n        'buy': 'market',\r\n        'sell': 'market',\r\n        'emergencysell': 'market',\r\n        'forcebuy': \"market\",\r\n        'forcesell': 'market',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False,\r\n\r\n        'stoploss_on_exchange_interval': 60,\r\n        'stoploss_on_exchange_limit_ratio': 0.99\r\n    }\r\n\r\n    # hard stoploss profit\r\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\r\n    # profit threshold 1, trigger point, SL_1 is used\r\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\r\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\r\n\r\n    # profit threshold 2, SL_2 is used\r\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\r\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\r\n    \r\n    # buy param\r\n    # ClucHA\r\n    clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=buy_params['clucha_bbdelta_close'], decimals=5, space='buy', optimize=True)\r\n    clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=buy_params['clucha_bbdelta_tail'], decimals=5, space='buy', optimize=True)\r\n    clucha_close_bblower = DecimalParameter(0.001, 0.05, default=buy_params['clucha_close_bblower'], decimals=5, space='buy', optimize=True)\r\n    clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=buy_params['clucha_closedelta_close'], decimals=5, space='buy', optimize=True)\r\n    clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=buy_params['clucha_rocr_1h'], decimals=5, space='buy', optimize=True)\r\n\r\n    # lambo1\r\n    lambo1_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo1_ema_14_factor'], space='buy', optimize=True)\r\n    lambo1_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_4_limit'], space='buy', optimize=True)\r\n    lambo1_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo1_rsi_14_limit'], space='buy', optimize=True)\r\n\r\n    # lambo2\r\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\r\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\r\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\r\n\r\n    # local_uptrend\r\n    local_trend_ema_diff = DecimalParameter(0, 0.2, default=buy_params['local_trend_ema_diff'], space='buy', optimize=True)\r\n    local_trend_bb_factor = DecimalParameter(0.8, 1.2, default=buy_params['local_trend_bb_factor'], space='buy', optimize=True)\r\n    local_trend_closedelta = DecimalParameter(5.0, 30.0, default=buy_params['local_trend_closedelta'], space='buy', optimize=True)\r\n\r\n    # ewo_1 and ewo_low\r\n    ewo_candles_buy = IntParameter(2, 30, default=buy_params['ewo_candles_buy'], space='buy', optimize=True)\r\n    ewo_candles_sell = IntParameter(2, 35, default=buy_params['ewo_candles_sell'], space='buy', optimize=True)\r\n    ewo_low_offset = DecimalParameter(0.7, 1.2, default=buy_params['ewo_low_offset'], decimals=5, space='buy', optimize=True)\r\n    ewo_high_offset = DecimalParameter(0.75, 1.5, default=buy_params['ewo_high_offset'], decimals=5, space='buy', optimize=True)\r\n    ewo_high = DecimalParameter(2.0, 15.0, default=buy_params['ewo_high'], space='buy', optimize=True)\r\n    ewo_1_rsi_14 = IntParameter(10, 100, default=buy_params['ewo_1_rsi_14'], space='buy', optimize=True)\r\n    ewo_1_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_1_rsi_4'], space='buy', optimize=True)\r\n    ewo_low_rsi_4 = IntParameter(1, 50, default=buy_params['ewo_low_rsi_4'], space='buy', optimize=True)\r\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\r\n\r\n    # cofi\r\n    cofi_ema = DecimalParameter(0.6, 1.4, default=buy_params['cofi_ema'] , space='buy', optimize=True)\r\n    cofi_fastk = IntParameter(1, 100, default=buy_params['cofi_fastk'], space='buy', optimize=True)\r\n    cofi_fastd = IntParameter(1, 100, default=buy_params['cofi_fastd'], space='buy', optimize=True)\r\n    cofi_adx = IntParameter(1, 100, default=buy_params['cofi_adx'], space='buy', optimize=True)\r\n    cofi_ewo_high = DecimalParameter(1.0, 15.0, default=buy_params['cofi_ewo_high'], space='buy', optimize=True)\r\n\r\n    # nfi32\r\n    nfi32_rsi_4 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\r\n    nfi32_rsi_14 = IntParameter(1, 100, default=buy_params['nfi32_rsi_4'], space='buy', optimize=True)\r\n    nfi32_sma_factor = DecimalParameter(0.7, 1.2, default=buy_params['nfi32_sma_factor'], decimals=5, space='buy', optimize=True)\r\n    nfi32_cti_limit = DecimalParameter(-1.2, 0, default=buy_params['nfi32_cti_limit'], decimals=5, space='buy', optimize=True)\r\n\r\n    buy_btc_safe_1d = DecimalParameter(-0.5, -0.015, default=buy_params['buy_btc_safe_1d'], optimize=True)\r\n    antipump_threshold = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold'], space='buy', optimize=True)\r\n\r\n    ewo_1_enabled = BooleanParameter(default=buy_params['ewo_1_enabled'], space='buy', optimize=True)\r\n    ewo_low_enabled = BooleanParameter(default=buy_params['ewo_low_enabled'], space='buy', optimize=True)\r\n    cofi_enabled = BooleanParameter(default=buy_params['cofi_enabled'], space='buy', optimize=True)\r\n    lambo1_enabled = BooleanParameter(default=buy_params['lambo1_enabled'], space='buy', optimize=True)\r\n    lambo2_enabled = BooleanParameter(default=buy_params['lambo2_enabled'], space='buy', optimize=True)\r\n    local_trend_enabled = BooleanParameter(default=buy_params['local_trend_enabled'], space='buy', optimize=True)\r\n    nfi32_enabled = BooleanParameter(default=buy_params['nfi32_enabled'], space='buy', optimize=True)\r\n    clucha_enabled = BooleanParameter(default=buy_params['clucha_enabled'], space='buy', optimize=True)\r\n\r\n\r\n    def informative_pairs(self):\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, '1h') for pair in pairs]\r\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\r\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\r\n\r\n        return informative_pairs\r\n\r\n\r\n    ############################################################################\r\n\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\r\n                        current_rate: float, current_profit: float, **kwargs) -> float:\r\n       \r\n        # hard stoploss profit\r\n        HSL = self.pHSL.value\r\n        PF_1 = self.pPF_1.value\r\n        SL_1 = self.pSL_1.value\r\n        PF_2 = self.pPF_2.value\r\n        SL_2 = self.pSL_2.value\r\n\r\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\r\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\r\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\r\n\r\n        if (current_profit > PF_2):\r\n            sl_profit = SL_2 + (current_profit - PF_2)\r\n        elif (current_profit > PF_1):\r\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\r\n        else:\r\n            sl_profit = HSL\r\n\r\n        # Only for hyperopt invalid return\r\n        if (sl_profit >= current_profit):\r\n            return -0.99\r\n    \r\n        return stoploss_from_open(sl_profit, current_profit)\r\n\r\n    ############################################################################\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # Heikin Ashi Candles\r\n        heikinashi = qtpylib.heikinashi(dataframe)\r\n        dataframe['ha_open'] = heikinashi['open']\r\n        dataframe['ha_close'] = heikinashi['close']\r\n        dataframe['ha_high'] = heikinashi['high']\r\n        dataframe['ha_low'] = heikinashi['low']\r\n\r\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\r\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\r\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\r\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\r\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\r\n\r\n        # CTI\r\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\r\n\r\n        # Cofi\r\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\r\n        dataframe['fastd'] = stoch_fast['fastd']\r\n        dataframe['fastk'] = stoch_fast['fastk']\r\n        dataframe['adx'] = ta.ADX(dataframe)\r\n\r\n        # Set Up Bollinger Bands\r\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\r\n        dataframe['lower'] = lower\r\n        dataframe['mid'] = mid\r\n\r\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\r\n        dataframe['bb_lowerband2'] = bollinger2['lower']\r\n        dataframe['bb_middleband2'] = bollinger2['mid']\r\n        dataframe['bb_upperband2'] = bollinger2['upper']\r\n\r\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\r\n\r\n\r\n        # # ClucHA\r\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\r\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\r\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\r\n        dataframe['bb_lowerband'] = dataframe['lower']\r\n        dataframe['bb_middleband'] = dataframe['mid']\r\n\r\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\r\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\r\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\r\n\r\n        # Elliot\r\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\r\n\r\n        rsi = ta.RSI(dataframe)\r\n        dataframe[\"rsi\"] = rsi\r\n        rsi = 0.1 * (rsi - 50)\r\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\r\n\r\n        inf_tf = '1h'\r\n\r\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\r\n\r\n        inf_heikinashi = qtpylib.heikinashi(informative)\r\n\r\n        informative['ha_close'] = inf_heikinashi['close']\r\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\r\n\r\n\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\r\n\r\n        ### BTC protection\r\n        dataframe['btc_1m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='1m')['close']\r\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\r\n        dataframe = merge_informative_pair(dataframe, btc_1d, '1m', '1d', ffill=True)\r\n\r\n        # Pump strength\r\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\r\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\r\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\r\n\r\n        #NOTE: dynamic offset\r\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\r\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\r\n        dataframe['norm_perc'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        dataframe.loc[:, 'buy_tag'] = ''\r\n\r\n        dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_buy.value))\r\n        dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] = ta.EMA(dataframe, timeperiod=int(self.ewo_candles_sell.value))\r\n\r\n        is_btc_safe = (\r\n            (pct_change(dataframe['btc_1d'], dataframe['btc_1m']).fillna(0) > self.buy_btc_safe_1d.value) &\r\n            (dataframe['volume'] > 0)           # Make sure Volume is not 0\r\n        )\r\n\r\n        is_pump_safe = (\r\n            (dataframe['pump_strength'] < self.antipump_threshold.value)\r\n        )\r\n\r\n        lambo1 = (\r\n            bool(self.lambo1_enabled.value) &\r\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo1_ema_14_factor.value)) &\r\n            (dataframe['rsi_4'] < int(self.lambo1_rsi_4_limit.value)) &\r\n            (dataframe['rsi_14'] < int(self.lambo1_rsi_14_limit.value))\r\n        )\r\n        dataframe.loc[lambo1, 'buy_tag'] += 'lambo1_'\r\n        conditions.append(lambo1)\r\n\r\n        lambo2 = (\r\n            bool(self.lambo2_enabled.value) &\r\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value)) &\r\n            (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value)) &\r\n            (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value))\r\n        )\r\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2_'\r\n        conditions.append(lambo2)\r\n\r\n        local_uptrend = (\r\n            bool(self.local_trend_enabled.value) &\r\n            (dataframe['ema_26'] > dataframe['ema_14']) &\r\n            (dataframe['ema_26'] - dataframe['ema_14'] > dataframe['open'] * self.local_trend_ema_diff.value) &\r\n            (dataframe['ema_26'].shift() - dataframe['ema_14'].shift() > dataframe['open'] / 100) &\r\n            (dataframe['close'] < dataframe['bb_lowerband2'] * self.local_trend_bb_factor.value) &\r\n            (dataframe['closedelta'] > dataframe['close'] * self.local_trend_closedelta.value / 1000 )\r\n        )\r\n        dataframe.loc[local_uptrend, 'buy_tag'] += 'local_uptrend_'\r\n        conditions.append(local_uptrend)\r\n\r\n        nfi_32 = (\r\n            bool(self.nfi32_enabled.value) &\r\n            (dataframe['rsi_20'] < dataframe['rsi_20'].shift(1)) &\r\n            (dataframe['rsi_4'] < self.nfi32_rsi_4.value) &\r\n            (dataframe['rsi_14'] > self.nfi32_rsi_14.value) &\r\n            (dataframe['close'] < dataframe['sma_15'] * self.nfi32_sma_factor.value) &\r\n            (dataframe['cti'] < self.nfi32_cti_limit.value)\r\n        )\r\n        dataframe.loc[nfi_32, 'buy_tag'] += 'nfi_32_'\r\n        conditions.append(nfi_32)\r\n\r\n        ewo_1 = (\r\n            bool(self.ewo_1_enabled.value) &\r\n            (dataframe['rsi_4'] < self.ewo_1_rsi_4.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\r\n            (dataframe['EWO'] > self.ewo_high.value) &\r\n            (dataframe['rsi_14'] < self.ewo_1_rsi_14.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\r\n        )\r\n        dataframe.loc[ewo_1, 'buy_tag'] += 'ewo1_'\r\n        conditions.append(ewo_1)\r\n\r\n        ewo_low = (\r\n            bool(self.ewo_low_enabled.value) &\r\n            (dataframe['rsi_4'] <  self.ewo_low_rsi_4.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_buy_{self.ewo_candles_buy.value}'] * self.ewo_low_offset.value)) &\r\n            (dataframe['EWO'] < self.ewo_low.value) &\r\n            (dataframe['close'] < (dataframe[f'ma_sell_{self.ewo_candles_sell.value}'] * self.ewo_high_offset.value))\r\n        )\r\n        dataframe.loc[ewo_low, 'buy_tag'] += 'ewo_low_'\r\n        conditions.append(ewo_low)\r\n\r\n        cofi = (\r\n            bool(self.cofi_enabled.value) &\r\n            (dataframe['open'] < dataframe['ema_8'] * self.cofi_ema.value) &\r\n            (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\r\n            (dataframe['fastk'] < self.cofi_fastk.value) &\r\n            (dataframe['fastd'] < self.cofi_fastd.value) &\r\n            (dataframe['adx'] > self.cofi_adx.value) &\r\n            (dataframe['EWO'] > self.cofi_ewo_high.value)\r\n        )\r\n        dataframe.loc[cofi, 'buy_tag'] += 'cofi_'\r\n        conditions.append(cofi)\r\n\r\n        clucHA = (\r\n            bool(self.clucha_enabled.value) &\r\n            (dataframe['rocr_1h'].gt(self.clucha_rocr_1h.value)) &\r\n            ((\r\n                (dataframe['lower'].shift().gt(0)) &\r\n                (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.clucha_bbdelta_close.value)) &\r\n                (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.clucha_closedelta_close.value)) &\r\n                (dataframe['tail'].lt(dataframe['bbdelta'] * self.clucha_bbdelta_tail.value)) &\r\n                (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\r\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\r\n            ) |\r\n            (\r\n                (dataframe['ha_close'] < dataframe['ema_slow']) &\r\n                (dataframe['ha_close'] < self.clucha_close_bblower.value * dataframe['bb_lowerband'])\r\n            ))\r\n        )\r\n        dataframe.loc[clucHA, 'buy_tag'] += 'clucHA_'\r\n        conditions.append(clucHA)\r\n\r\n        dataframe.loc[\r\n            # is_btc_safe &  # broken?\r\n            # is_pump_safe &\r\n            reduce(lambda x, y: x | y, conditions),\r\n            'buy'\r\n        ] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        params = self.sell_params\r\n        \r\n        dataframe.loc[\r\n            (dataframe['fisher'] > params['sell-fisher']) &\r\n            (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\r\n            (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\r\n            (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\r\n            (dataframe['ema_fast'] > dataframe['ha_close']) &\r\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\r\n            (dataframe['volume'] > 0)\r\n            ,\r\n            'sell'\r\n        ] = 1\r\n\r\n        return dataframe\r\n\r\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\r\n                           rate: float, time_in_force: str, sell_reason: str,\r\n                           current_time: datetime, **kwargs) -> bool:\r\n\r\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\r\n\r\n        return True\r\n\r\ndef pct_change(a, b):\r\n    return (b - a) / a\r\n\r\ndef EWO(dataframe, ema_length=5, ema2_length=35):\r\n    df = dataframe.copy()\r\n    ema1 = ta.EMA(df, timeperiod=ema_length)\r\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\r\n    emadif = (ema1 - ema2) / df['low'] * 100\r\n    return emadif\r\n\r\nclass ClucHAnix_BB_RPB_MOD_E0V1E_ROI_DYNAMIC_TB(ClucHAnix_BB_RPB_MOD_E0V1E_ROI):\r\n\r\n    process_only_new_candles = True\r\n\r\n    custom_info_trail_buy = dict()\r\n\r\n    # Trailing buy parameters\r\n    trailing_buy_order_enabled = True\r\n    trailing_expire_seconds = 1800\r\n\r\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\r\n    trailing_buy_uptrend_enabled = True\r\n    trailing_expire_seconds_uptrend = 90\r\n    min_uptrend_trailing_profit = 0.02\r\n\r\n    debug_mode = True\r\n    trailing_buy_max_stop = 0.01  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\r\n    trailing_buy_max_buy = 0.002  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\r\n\r\n    init_trailing_dict = {\r\n        'trailing_buy_order_started': False,\r\n        'trailing_buy_order_uplimit': 0,\r\n        'start_trailing_price': 0,\r\n        'buy_tag': None,\r\n        'start_trailing_time': None,\r\n        'offset': 0,\r\n        'allow_trailing': False,\r\n    }\r\n\r\n    def trailing_buy(self, pair, reinit=False):\r\n        # returns trailing buy info for pair (init if necessary)\r\n        if not pair in self.custom_info_trail_buy:\r\n            self.custom_info_trail_buy[pair] = dict()\r\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\r\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\r\n        return self.custom_info_trail_buy[pair]['trailing_buy']\r\n\r\n    def trailing_buy_info(self, pair: str, current_price: float):\r\n        # current_time live, dry run\r\n        current_time = datetime.now(timezone.utc)\r\n        if not self.debug_mode:\r\n            return\r\n        trailing_buy = self.trailing_buy(pair)\r\n\r\n        duration = 0\r\n        try:\r\n            duration = (current_time - trailing_buy['start_trailing_time'])\r\n        except TypeError:\r\n            duration = 0\r\n        finally:\r\n            logger.info(\r\n                f\"pair: {pair} : \"\r\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\r\n                f\"duration: {duration}, \"\r\n                f\"current: {current_price:.4f}, \"\r\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\r\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\r\n                f\"offset: {trailing_buy['offset']}\")\r\n\r\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if trailing_buy['trailing_buy_order_started']:\r\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\r\n        else:\r\n            return 0\r\n\r\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\r\n        # return rebound limit before a buy in % of initial price, function of current price\r\n        # return None to stop trailing buy (will start again at next buy signal)\r\n        # return 'forcebuy' to force immediate buy\r\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\r\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\r\n        last_candle = dataframe.iloc[-1]\r\n        adapt  = abs((last_candle['norm_perc']))\r\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\r\n        #default_offset = adapt*0.01\r\n\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if not trailing_buy['trailing_buy_order_started']:\r\n            return default_offset\r\n\r\n        # example with duration and indicators\r\n        # dry run, live only\r\n        last_candle = dataframe.iloc[-1]\r\n        current_time = datetime.now(timezone.utc)\r\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\r\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\r\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\r\n                # more than 1h, price under first signal, buy signal still active -> buy\r\n                return 'forcebuy'\r\n            else:\r\n                # wait for next signal\r\n                return None\r\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\r\n            # less than 90s and price is rising, buy\r\n            return 'forcebuy'\r\n\r\n        if current_trailing_profit_ratio < 0:\r\n            # current price is higher than initial price\r\n            return default_offset\r\n\r\n        trailing_buy_offset = {\r\n            0.06: 0.02,\r\n            0.03: 0.01,\r\n            0: default_offset,\r\n        }\r\n\r\n        for key in trailing_buy_offset:\r\n            if current_trailing_profit_ratio > key:\r\n                return trailing_buy_offset[key]\r\n\r\n        return default_offset\r\n\r\n    # end of trailing buy parameters\r\n    # -----------------------------------------------------\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_indicators(dataframe, metadata)\r\n        self.trailing_buy(metadata['pair'])\r\n        return dataframe\r\n\r\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\r\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\r\n        \r\n        if val:\r\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\r\n                val = False\r\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n                if(len(dataframe) >= 1):\r\n                    last_candle = dataframe.iloc[-1].squeeze()\r\n                    current_price = rate\r\n                    trailing_buy = self.trailing_buy(pair)\r\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\r\n\r\n                    if trailing_buy['allow_trailing']:\r\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\r\n                            # start trailing buy\r\n\r\n                            trailing_buy['trailing_buy_order_started'] = True\r\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            trailing_buy['start_trailing_price'] = last_candle['close']\r\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\r\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            trailing_buy['offset'] = 0\r\n                            \r\n                            self.trailing_buy_info(pair, current_price)\r\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\r\n\r\n                        elif trailing_buy['trailing_buy_order_started']:\r\n                            if trailing_buy_offset == 'forcebuy':\r\n                                # buy in custom conditions\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\r\n\r\n                            elif trailing_buy_offset is None:\r\n                                # stop trailing buy custom conditions\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\r\n\r\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\r\n                                # update uplimit\r\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\r\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\r\n                                # buy ! current price > uplimit && lower thant starting price\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\r\n\r\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\r\n                                # stop trailing buy because price is too high\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\r\n                            else:\r\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'price too high for {pair} !')\r\n\r\n                    else:\r\n                        logger.info(f\"Wait for next buy signal for {pair}\")\r\n\r\n                if (val == True):\r\n                    self.trailing_buy_info(pair, rate)\r\n                    self.trailing_buy(pair, reinit=True)\r\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\r\n        \r\n        return val\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_buy_trend(dataframe, metadata)\r\n\r\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \r\n            last_candle = dataframe.iloc[-1].squeeze()\r\n            trailing_buy = self.trailing_buy(metadata['pair'])\r\n            if (last_candle['buy'] == 1):\r\n                if not trailing_buy['trailing_buy_order_started']:\r\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\r\n                    if not open_trades:\r\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\r\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\r\n                        trailing_buy['allow_trailing'] = True\r\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\r\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\r\n            else:\r\n                if (trailing_buy['trailing_buy_order_started'] == True):\r\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\r\n                    dataframe.loc[:,'buy'] = 1\r\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\r\n                    # dataframe['buy'] = 1\r\n\r\n        return dataframe"
  },
  {
    "path": "strategies/ClucHAnix_hhll/ClucHAnix_hhll.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport numpy as np\r\nimport talib.abstract as ta\r\nimport time\r\nimport logging\r\n\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, stoploss_from_open, RealParameter\r\nfrom pandas import DataFrame, Series\r\nfrom datetime import datetime, timedelta, timezone\r\nfrom freqtrade.persistence import Trade\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\ndef bollinger_bands(stock_price, window_size, num_of_std):\r\n    rolling_mean = stock_price.rolling(window=window_size).mean()\r\n    rolling_std = stock_price.rolling(window=window_size).std()\r\n    lower_band = rolling_mean - (rolling_std * num_of_std)\r\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\r\n\r\n\r\ndef ha_typical_price(bars):\r\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\r\n    return Series(index=bars.index, data=res)\r\n\r\n\r\nclass ClucHAnix_hhll(IStrategy):\r\n    \"\"\"\r\n    Please only use this with TrailingBuy\r\n    \"\"\"\r\n    \r\n    #hypered params\r\n    buy_params = {\r\n        ##\r\n        \"max_slip\": 0.73,\r\n        ##\r\n        \"bbdelta_close\": 0.01846,\r\n        \"bbdelta_tail\": 0.98973,\r\n        \"close_bblower\": 0.00785,\r\n        \"closedelta_close\": 0.01009,\r\n        \"rocr_1h\": 0.5411,\r\n        ##\r\n        \"buy_hh_diff_48\": 6.867,\r\n        \"buy_ll_diff_48\": -12.884,\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n        \"pPF_1\": 0.011,\r\n        \"pPF_2\": 0.064,\r\n        \"pSL_1\": 0.011,\r\n        \"pSL_2\": 0.062,\r\n\r\n        # sell signal params\r\n        \"high_offset\": 0.907,\r\n        \"high_offset_2\": 1.211,\r\n        \"sell_bbmiddle_close\": 0.97286,\r\n        \"sell_fisher\": 0.48492,\r\n    }\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.103,\r\n        \"3\": 0.05,\r\n        \"5\": 0.033,\r\n        \"61\": 0.027,\r\n        \"125\": 0.011,\r\n        \"292\": 0.005,\r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.99  # use custom stoploss\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.001\r\n    trailing_stop_positive_offset = 0.012\r\n    trailing_only_offset_is_reached = False\r\n\r\n    \"\"\"\r\n    END HYPEROPT\r\n    \"\"\"\r\n\r\n    timeframe = '5m'\r\n\r\n    # Make sure these match or are not overridden in config\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Custom stoploss\r\n    use_custom_stoploss = True\r\n\r\n    process_only_new_candles = True\r\n    startup_candle_count = 168\r\n\r\n    order_types = {\r\n        'buy': 'market',\r\n        'sell': 'market',\r\n        'emergencysell': 'market',\r\n        'forcebuy': \"market\",\r\n        'forcesell': 'market',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False,\r\n\r\n        'stoploss_on_exchange_interval': 60,\r\n        'stoploss_on_exchange_limit_ratio': 0.99\r\n    }\r\n\r\n    # buy params\r\n    is_optimize_clucHA = False\r\n    rocr_1h = RealParameter(0.5, 1.0, default=0.54904, space='buy', optimize = is_optimize_clucHA )\r\n    bbdelta_close = RealParameter(0.0005, 0.02, default=0.01965, space='buy', optimize = is_optimize_clucHA )\r\n    closedelta_close = RealParameter(0.0005, 0.02, default=0.00556, space='buy', optimize = is_optimize_clucHA )\r\n    bbdelta_tail = RealParameter(0.7, 1.0, default=0.95089, space='buy', optimize = is_optimize_clucHA )\r\n    close_bblower = RealParameter(0.0005, 0.02, default=0.00799, space='buy', optimize = is_optimize_clucHA )\r\n\r\n    is_optimize_hh_ll = False\r\n    buy_hh_diff_48 = DecimalParameter(0.0, 15, default=1.087 , optimize = is_optimize_hh_ll )\r\n    buy_ll_diff_48 = DecimalParameter(-23, 40, default=1.087 , optimize = is_optimize_hh_ll )\r\n\r\n    ## Slippage params\r\n    is_optimize_slip = False\r\n    max_slip = DecimalParameter(0.33, 0.80, default=0.33, decimals=3, optimize=is_optimize_slip , space='buy', load=True)\r\n\r\n    # sell params\r\n    is_optimize_sell = False\r\n    sell_fisher = RealParameter(0.1, 0.5, default=0.38414, space='sell', optimize = is_optimize_sell)\r\n    sell_bbmiddle_close = RealParameter(0.97, 1.1, default=1.07634, space='sell', optimize = is_optimize_sell)\r\n    high_offset          = DecimalParameter(0.90, 1.2, default=sell_params['high_offset'], space='sell', optimize = is_optimize_sell)\r\n    high_offset_2        = DecimalParameter(0.90, 1.5, default=sell_params['high_offset_2'], space='sell', optimize = is_optimize_sell)\r\n\r\n    is_optimize_trailing = False\r\n    pPF_1 = DecimalParameter(0.011, 0.020, default=0.016, decimals=3, space='sell', load=True, optimize = is_optimize_trailing)\r\n    pSL_1 = DecimalParameter(0.011, 0.020, default=0.011, decimals=3, space='sell', load=True, optimize = is_optimize_trailing)\r\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True, optimize = is_optimize_trailing)\r\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True, optimize = is_optimize_trailing)\r\n\r\n    def informative_pairs(self):\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, '1h') for pair in pairs]\r\n        return informative_pairs\r\n\r\n    # come from BB_RPB_TSL\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\r\n                        current_rate: float, current_profit: float, **kwargs) -> float:\r\n\r\n        # hard stoploss profit\r\n        PF_1 = self.pPF_1.value\r\n        SL_1 = self.pSL_1.value\r\n        PF_2 = self.pPF_2.value\r\n        SL_2 = self.pSL_2.value\r\n\r\n        sl_profit = -0.99\r\n\r\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\r\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\r\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\r\n\r\n        if current_profit > PF_2:\r\n            sl_profit = SL_2 + (current_profit - PF_2)\r\n        elif current_profit > PF_1:\r\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\r\n        else:\r\n            sl_profit = -0.99\r\n\r\n        # Only for hyperopt invalid return\r\n        if sl_profit >= current_profit:\r\n            return -0.99\r\n\r\n        return stoploss_from_open(sl_profit, current_profit)\r\n\r\n    ## Confirm Entry\r\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\r\n\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n\r\n        max_slip = self.max_slip.value\r\n\r\n        if(len(dataframe) < 1):\r\n            return False\r\n\r\n        dataframe = dataframe.iloc[-1].squeeze()\r\n        if ((rate > dataframe['close'])) :\r\n\r\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\r\n\r\n            if slippage < max_slip:\r\n                return True\r\n            else:\r\n                return False\r\n\r\n        return True\r\n\r\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\r\n                    current_profit: float, **kwargs):\r\n\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n\r\n        last_candle = dataframe.iloc[-1]\r\n        previous_candle_1 = dataframe.iloc[-2]\r\n        previous_candle_2 = dataframe.iloc[-3]\r\n\r\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\r\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\r\n\r\n        # stoploss - deadfish\r\n        if (    (current_profit < -0.063)\r\n                and (last_candle['close'] < last_candle['ema_200'])\r\n                and (last_candle['bb_width'] < 0.043)\r\n                and (last_candle['close'] > last_candle['bb_middleband2'] * 0.954)\r\n                and (last_candle['volume_mean_12'] < last_candle['volume_mean_24'] * 2.37)\r\n            ):\r\n            return 'sell_stoploss_deadfish'\r\n\r\n        # stoploss - pump\r\n        if (last_candle['hl_pct_change_48_1h'] > 0.95):\r\n            if (\r\n                    (-0.04 > current_profit > -0.08)\r\n                    and (max_profit < 0.005)\r\n                    and (max_loss < 0.08)\r\n                    and (last_candle['close'] < last_candle['ema_200'])\r\n                    and (last_candle['sma_200_dec_20'])\r\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\r\n                    and (last_candle['cmf'] < -0.25)\r\n                    and (last_candle['cmf_1h'] < -0.0)\r\n            ):\r\n                return 'sell_stoploss_p_48_1_1'\r\n            elif (\r\n                    (-0.04 > current_profit > -0.08)\r\n                    and (max_profit < 0.01)\r\n                    and (max_loss < 0.08)\r\n                    and (last_candle['close'] < last_candle['ema_200'])\r\n                    and (last_candle['sma_200_dec_20'])\r\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\r\n                    and (last_candle['cmf'] < -0.25)\r\n                    and (last_candle['cmf_1h'] < -0.0)\r\n            ):\r\n                return 'sell_stoploss_p_48_1_2'\r\n\r\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\r\n            if (\r\n                    (-0.04 > current_profit > -0.08)\r\n                    and (max_loss < 0.08)\r\n                    and (max_profit > (current_profit + 0.1))\r\n                    and (last_candle['close'] < last_candle['ema_200'])\r\n                    and (last_candle['sma_200_dec_20'])\r\n                    and (last_candle['sma_200_dec_20_1h'])\r\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\r\n                    and (last_candle['cmf'] < -0.25)\r\n                    and (last_candle['cmf_1h'] < -0.0)\r\n            ):\r\n                return 'sell_stoploss_p_36_1_1'\r\n\r\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\r\n            if (\r\n                    (-0.05 > current_profit > -0.08)\r\n                    and (max_loss < 0.08)\r\n                    and (max_profit > (current_profit + 0.1))\r\n                    and (last_candle['close'] < last_candle['ema_200'])\r\n                    and (last_candle['sma_200_dec_20'])\r\n                    and (last_candle['sma_200_dec_20_1h'])\r\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\r\n                    and (last_candle['cmf'] < -0.25)\r\n                    and (last_candle['cmf_1h'] < -0.0)\r\n                    and (last_candle['rsi'] < 40.0)\r\n            ):\r\n                return 'sell_stoploss_p_36_2_1'\r\n\r\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\r\n            if (\r\n                    (-0.04 > current_profit > -0.08)\r\n                    and (max_loss < 0.08)\r\n                    and (last_candle['close'] < last_candle['ema_200'])\r\n                    and (last_candle['sma_200_dec_20'])\r\n                    and (last_candle['sma_200_dec_20_1h'])\r\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\r\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\r\n                    and (last_candle['cmf'] < -0.25)\r\n                    and (last_candle['cmf_1h'] < -0.0)\r\n            ):\r\n                return 'sell_stoploss_p_24_1_1'\r\n\r\n        return None\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # # Heikin Ashi Candles\r\n        heikinashi = qtpylib.heikinashi(dataframe)\r\n        dataframe['ha_open'] = heikinashi['open']\r\n        dataframe['ha_close'] = heikinashi['close']\r\n        dataframe['ha_high'] = heikinashi['high']\r\n        dataframe['ha_low'] = heikinashi['low']\r\n\r\n        # Set Up Bollinger Bands\r\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\r\n        dataframe['lower'] = lower\r\n        dataframe['mid'] = mid\r\n\r\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\r\n        dataframe['closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\r\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\r\n\r\n        dataframe['bb_lowerband'] = dataframe['lower']\r\n        dataframe['bb_middleband'] = dataframe['mid']\r\n\r\n        # BB 20\r\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\r\n        dataframe['bb_lowerband2'] = bollinger2['lower']\r\n        dataframe['bb_middleband2'] = bollinger2['mid']\r\n        dataframe['bb_upperband2'] = bollinger2['upper']\r\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\r\n\r\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\r\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\r\n        dataframe['ema_24'] = ta.EMA(dataframe['close'], timeperiod=24)\r\n        dataframe['ema_200'] = ta.EMA(dataframe['close'], timeperiod=200)\r\n\r\n        # SMA\r\n        dataframe['sma_9'] = ta.SMA(dataframe['close'], timeperiod=9)\r\n        dataframe['sma_200'] = ta.SMA(dataframe['close'], timeperiod=200)\r\n\r\n        # HMA\r\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\r\n\r\n        # volume\r\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\r\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\r\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\r\n\r\n        # ROCR\r\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\r\n\r\n        # hh48\r\n        dataframe['hh_48'] = ta.MAX(dataframe['high'], 48)\r\n        dataframe['hh_48_diff'] = (dataframe['hh_48'] - dataframe['close']) / dataframe['hh_48'] * 100\r\n\r\n        # ll48\r\n        dataframe['ll_48'] = ta.MIN(dataframe['low'], 48)\r\n        dataframe['ll_48_diff'] = (dataframe['close'] - dataframe['ll_48']) / dataframe['ll_48'] * 100\r\n\r\n        rsi = ta.RSI(dataframe)\r\n        dataframe[\"rsi\"] = rsi\r\n        rsi = 0.1 * (rsi - 50)\r\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\r\n\r\n        # RSI\r\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\r\n\r\n        # sma dec 20\r\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\r\n\r\n        # EMA of VWMA Oscillator\r\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\r\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\r\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\r\n\r\n        # CMF\r\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\r\n\r\n        # 1h tf\r\n        inf_tf = '1h'\r\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\r\n\r\n        inf_heikinashi = qtpylib.heikinashi(informative)\r\n\r\n        informative['ha_close'] = inf_heikinashi['close']\r\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\r\n\r\n        informative['sma_200'] = ta.SMA(informative['close'], timeperiod=200)\r\n\r\n        informative['hl_pct_change_48'] = range_percent_change(informative, 'HL', 48)\r\n        informative['hl_pct_change_36'] = range_percent_change(informative, 'HL', 36)\r\n        informative['hl_pct_change_24'] = range_percent_change(informative, 'HL', 24)\r\n        informative['sma_200_dec_20'] = informative['sma_200'] < informative['sma_200'].shift(20)\r\n\r\n        # CMF\r\n        informative['cmf'] = chaikin_money_flow(informative, 20)\r\n\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        dataframe.loc[\r\n            ( dataframe['rocr_1h'].gt(self.rocr_1h.value) )\r\n            &\r\n            (   (\r\n                    (dataframe['lower'].shift().gt(0)) &\r\n                    (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.bbdelta_close.value)) &\r\n                    (dataframe['closedelta'].gt(dataframe['ha_close'] * self.closedelta_close.value)) &\r\n                    (dataframe['tail'].lt(dataframe['bbdelta'] * self.bbdelta_tail.value)) &\r\n                    (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\r\n                    (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\r\n                )\r\n                |\r\n                (\r\n                    (dataframe['ha_close'] < dataframe['ema_slow']) &\r\n                    (dataframe['ha_close'] < self.close_bblower.value * dataframe['bb_lowerband'])\r\n                )\r\n            )\r\n            &\r\n            (dataframe['hh_48_diff'] > self.buy_hh_diff_48.value)\r\n            &\r\n            (dataframe['ll_48_diff'] > self.buy_ll_diff_48.value)\r\n        ,'buy'] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        dataframe.loc[\r\n            (   (\r\n                    (dataframe['fisher'] > self.sell_fisher.value) &\r\n                    (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\r\n                    (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\r\n                    (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\r\n                    (dataframe['ema_fast'] > dataframe['ha_close']) &\r\n                    ((dataframe['ha_close'] * self.sell_bbmiddle_close.value) > dataframe['bb_middleband'])\r\n                )\r\n                |\r\n                (\r\n                    (dataframe['close'] > dataframe['sma_9']) &\r\n                    (dataframe['close'] > (dataframe['ema_24'] * self.high_offset_2.value)) &\r\n                    (dataframe['rsi'] > 50) &\r\n                    (dataframe['rsi_fast'] > dataframe['rsi_slow'])\r\n                )\r\n                |\r\n                (\r\n                    (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1) * 0.005 )) &\r\n                    (dataframe['close'] < dataframe['hma_50']) &\r\n                    (dataframe['close'] > (dataframe['ema_24'] * self.high_offset.value)) &\r\n                    (dataframe['rsi_fast'] > dataframe['rsi_slow'])\r\n                )\r\n            )\r\n            &\r\n            (dataframe['volume'] > 0)\r\n\r\n        ,'sell'] = 1\r\n\r\n        return dataframe\r\n\r\n# Volume Weighted Moving Average\r\ndef vwma(dataframe: DataFrame, length: int = 10):\r\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\r\n    # Calculate Result\r\n    pv = dataframe['close'] * dataframe['volume']\r\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\r\n    vwma = vwma.fillna(0, inplace=True)\r\n    return vwma\r\n\r\n# Exponential moving average of a volume weighted simple moving average\r\ndef ema_vwma_osc(dataframe, len_slow_ma):\r\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\r\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\r\n\r\ndef range_percent_change(dataframe: DataFrame, method, length: int) -> float:\r\n        \"\"\"\r\n        Rolling Percentage Change Maximum across interval.\r\n\r\n        :param dataframe: DataFrame The original OHLC dataframe\r\n        :param method: High to Low / Open to Close\r\n        :param length: int The length to look back\r\n        \"\"\"\r\n        if method == 'HL':\r\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\r\n        elif method == 'OC':\r\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\r\n        else:\r\n            raise ValueError(f\"Method {method} not defined!\")\r\n\r\n# Chaikin Money Flow\r\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\r\n    \"\"\"Chaikin Money Flow (CMF)\r\n    It measures the amount of Money Flow Volume over a specific period.\r\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\r\n    Args:\r\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\r\n        n(int): n period.\r\n        fillna(bool): if True, fill nan values.\r\n    Returns:\r\n        pandas.Series: New feature generated.\r\n    \"\"\"\r\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\r\n    mfv = mfv.fillna(0.0)  # float division by zero\r\n    mfv *= dataframe['volume']\r\n    cmf = (mfv.rolling(n, min_periods=0).sum()\r\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\r\n    if fillna:\r\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\r\n    return Series(cmf, name='cmf')\r\n\r\nclass ClucHAnix_hhll_TB(ClucHAnix_hhll):\r\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\r\n    #\r\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\r\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\r\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\r\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\r\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\r\n    #\r\n\r\n    process_only_new_candles = True\r\n\r\n    custom_info_trail_buy = dict()\r\n\r\n    # Trailing buy parameters\r\n    trailing_buy_order_enabled = True\r\n    trailing_expire_seconds = 1800\r\n\r\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\r\n    trailing_buy_uptrend_enabled = False\r\n    trailing_expire_seconds_uptrend = 90\r\n    min_uptrend_trailing_profit = 0.02\r\n\r\n    debug_mode = True\r\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\r\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\r\n\r\n    init_trailing_dict = {\r\n        'trailing_buy_order_started': False,\r\n        'trailing_buy_order_uplimit': 0,\r\n        'start_trailing_price': 0,\r\n        'buy_tag': None,\r\n        'start_trailing_time': None,\r\n        'offset': 0,\r\n        'allow_trailing': False,\r\n    }\r\n\r\n    def trailing_buy(self, pair, reinit=False):\r\n        # returns trailing buy info for pair (init if necessary)\r\n        if not pair in self.custom_info_trail_buy:\r\n            self.custom_info_trail_buy[pair] = dict()\r\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\r\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\r\n        return self.custom_info_trail_buy[pair]['trailing_buy']\r\n\r\n    def trailing_buy_info(self, pair: str, current_price: float):\r\n        # current_time live, dry run\r\n        current_time = datetime.now(timezone.utc)\r\n        if not self.debug_mode:\r\n            return\r\n        trailing_buy = self.trailing_buy(pair)\r\n\r\n        duration = 0\r\n        try:\r\n            duration = (current_time - trailing_buy['start_trailing_time'])\r\n        except TypeError:\r\n            duration = 0\r\n        finally:\r\n            logger.info(\r\n                f\"pair: {pair} : \"\r\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\r\n                f\"duration: {duration}, \"\r\n                f\"current: {current_price:.4f}, \"\r\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\r\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\r\n                f\"offset: {trailing_buy['offset']}\")\r\n\r\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if trailing_buy['trailing_buy_order_started']:\r\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\r\n        else:\r\n            return 0\r\n\r\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\r\n        # return rebound limit before a buy in % of initial price, function of current price\r\n        # return None to stop trailing buy (will start again at next buy signal)\r\n        # return 'forcebuy' to force immediate buy\r\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\r\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\r\n        default_offset = 0.005\r\n\r\n        trailing_buy = self.trailing_buy(pair)\r\n        if not trailing_buy['trailing_buy_order_started']:\r\n            return default_offset\r\n\r\n        # example with duration and indicators\r\n        # dry run, live only\r\n        last_candle = dataframe.iloc[-1]\r\n        current_time = datetime.now(timezone.utc)\r\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\r\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\r\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\r\n                # more than 1h, price under first signal, buy signal still active -> buy\r\n                return 'forcebuy'\r\n            else:\r\n                # wait for next signal\r\n                return None\r\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\r\n            # less than 90s and price is rising, buy\r\n            return 'forcebuy'\r\n\r\n        if current_trailing_profit_ratio < 0:\r\n            # current price is higher than initial price\r\n            return default_offset\r\n\r\n        trailing_buy_offset = {\r\n            0.06: 0.02,\r\n            0.03: 0.01,\r\n            0: default_offset,\r\n        }\r\n\r\n        for key in trailing_buy_offset:\r\n            if current_trailing_profit_ratio > key:\r\n                return trailing_buy_offset[key]\r\n\r\n        return default_offset\r\n\r\n    # end of trailing buy parameters\r\n    # -----------------------------------------------------\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_indicators(dataframe, metadata)\r\n        self.trailing_buy(metadata['pair'])\r\n        return dataframe\r\n\r\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\r\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\r\n\r\n        if val:\r\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\r\n                val = False\r\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n                if(len(dataframe) >= 1):\r\n                    last_candle = dataframe.iloc[-1].squeeze()\r\n                    current_price = rate\r\n                    trailing_buy = self.trailing_buy(pair)\r\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\r\n\r\n                    if trailing_buy['allow_trailing']:\r\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\r\n                            # start trailing buy\r\n\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\r\n\r\n                            trailing_buy['trailing_buy_order_started'] = True\r\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\r\n                            trailing_buy['start_trailing_price'] = last_candle['close']\r\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\r\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\r\n                            trailing_buy['offset'] = 0\r\n\r\n                            self.trailing_buy_info(pair, current_price)\r\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\r\n\r\n                        elif trailing_buy['trailing_buy_order_started']:\r\n                            if trailing_buy_offset == 'forcebuy':\r\n                                # buy in custom conditions\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\r\n\r\n                            elif trailing_buy_offset is None:\r\n                                # stop trailing buy custom conditions\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\r\n\r\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\r\n                                # update uplimit\r\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\r\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\r\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\r\n                                # buy ! current price > uplimit && lower thant starting price\r\n                                val = True\r\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\r\n\r\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\r\n                                # stop trailing buy because price is too high\r\n                                self.trailing_buy(pair, reinit=True)\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\r\n                            else:\r\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\r\n                                self.trailing_buy_info(pair, current_price)\r\n                                logger.info(f'price too high for {pair} !')\r\n\r\n                    else:\r\n                        logger.info(f\"Wait for next buy signal for {pair}\")\r\n\r\n                if (val == True):\r\n                    self.trailing_buy_info(pair, rate)\r\n                    self.trailing_buy(pair, reinit=True)\r\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\r\n\r\n        return val\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_buy_trend(dataframe, metadata)\r\n\r\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\r\n            last_candle = dataframe.iloc[-1].squeeze()\r\n            trailing_buy = self.trailing_buy(metadata['pair'])\r\n            if (last_candle['buy'] == 1):\r\n                if not trailing_buy['trailing_buy_order_started']:\r\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\r\n                    if not open_trades:\r\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\r\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\r\n                        trailing_buy['allow_trailing'] = True\r\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\r\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\r\n            else:\r\n                if (trailing_buy['trailing_buy_order_started'] == True):\r\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\r\n                    dataframe.loc[:,'buy'] = 1\r\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\r\n                    # dataframe['buy'] = 1\r\n\r\n        return dataframe\r\n"
  },
  {
    "path": "strategies/ClucHAwerk/ClucHAwerk.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\nclass ClucHAwerk(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    Can be overridden for specific sub-strategies (stake currencies) at the bottom.\n    \"\"\"\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.01021,\n        'bbdelta-tail': 0.88118,\n        'close-bblower': 0.0022,\n        'closedelta-close': 0.00519,\n        'rocr-1h': 0.50931,\n        'volume': 35\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-bbmiddle-close': 1.01283, \n        'sell-rocr-1h': 0.95269\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.11054,\n        \"2\": 0.05569,\n        \"10\": 0.03055,\n        \"16\": 0.02311,\n        \"82\": 0.01267,\n        \"238\": 0.00301,\n        \"480\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.02139\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.09291\n    trailing_stop_positive_offset = 0.10651\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '1m'\n\n    startup_candle_count: int = 168\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.0\n    ignore_roi_if_buy_signal = True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(dataframe['ha_close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        bollinger = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n        \n        inf_tf = '1h'\n        \n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        \n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            (\n                dataframe['rocr_1h'].gt(params['rocr-1h'])\n            ) &\n            ((      \n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['ha_close'] * params['bbdelta-close']) &\n                    dataframe['closedelta'].gt(dataframe['ha_close'] * params['closedelta-close']) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * params['bbdelta-tail']) &\n                    dataframe['ha_close'].lt(dataframe['lower'].shift()) &\n                    dataframe['ha_close'].le(dataframe['ha_close'].shift())\n            ) |\n            (       \n                    (dataframe['ha_close'] < dataframe['ema_slow']) &\n                    (dataframe['ha_close'] < params['close-bblower'] * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * params['volume']))\n            )),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        dataframe.loc[\n            dataframe['rocr_1h'].lt(params['sell-rocr-1h']) &\n            ((dataframe['ha_close'] * params['sell-bbmiddle-close']) > dataframe['bb_middleband']) &\n            (dataframe['volume'] > 0)\n            ,\n            'sell'\n        ] = 1\n\n        return dataframe\n\nclass ClucHAwerk_ETH(ClucHAwerk):\n\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.02\n    ignore_roi_if_buy_signal = True\n\n    # hyperopt --config user_data/config-backtest-ETH.json --hyperopt ClucHAwerkHyperopt_ETH --hyperopt-loss SortinoHyperOptLoss --strategy ClucHAwerk_ETH -e 500 --spaces buy --timeframe 1m --timerange 20210101-\n    # 483/500:   1880 trades. 1054/0/826 Wins/Draws/Losses. Avg profit   0.76%. Median profit   1.12%. Total profit  0.14286503 ETH ( 1426.37Σ%). Avg duration  45.3 min. Objective: -623.10584\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.01566,\n        'bbdelta-tail': 0.8478,\n        'close-bblower': 0.00998,\n        'closedelta-close': 0.00614,\n        'rocr-1h': 0.61579,\n        'volume': 27\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-ETH.json --hyperopt ClucHAwerkHyperopt_ETH --hyperopt-loss SortinoHyperOptLoss --strategy ClucHAwerk_ETH -e 500 --spaces sell --timeframe 1m --timerange 20210101-\n\t# 210/500:   1881 trades. 1055/0/826 Wins/Draws/Losses. Avg profit   0.76%. Median profit   1.12%. Total profit  0.14316974 ETH ( 1429.41Σ%). Avg duration  45.3 min. Objective: -624.58371\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-bbmiddle-close': 1.02894, \n\t\t'sell-rocr-1h': 0.94925\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-ETH.json --hyperopt ClucHAwerkHyperopt_ETH --hyperopt-loss SharpeHyperOptLoss --strategy ClucHAwerk_ETH -e 250 --spaces roi --timeframe 1m --timerange 20210101-\n    # 479/500:   1890 trades. 1209/0/681 Wins/Draws/Losses. Avg profit   0.86%. Median profit   0.74%. Total profit  0.16228997 ETH ( 1620.31Σ%). Avg duration  45.6 min. Objective: -258.91551\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.14414,\n        \"13\": 0.10123,\n        \"20\": 0.03256,\n        \"47\": 0.0177,\n        \"132\": 0.01016,\n        \"177\": 0.00328,\n        \"277\": 0\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-ETH.json --hyperopt ClucHAwerkHyperopt_ETH --hyperopt-loss OnlyProfitHyperOptLoss --strategy ClucHAwerk_ETH -e 500 --spaces stoploss --timeframe 1m --timerange 20210101- \n    # 292/500:   1890 trades. 1209/0/681 Wins/Draws/Losses. Avg profit   0.86%. Median profit   0.74%. Total profit  0.16251312 ETH ( 1622.53Σ%). Avg duration  45.6 min. Objective: -4.40843\n    # Stoploss:\n    stoploss = -0.02\n\t\n\t# hyperopt --config user_data/config-backtest-ETH.json --hyperopt ClucHAwerkHyperopt_ETH --hyperopt-loss OnlyProfitHyperOptLoss --strategy ClucHAwerk_ETH -e 500 --spaces trailing --timeframe 1m --timerange 20210101- \n    # 443/500:   1883 trades. 1193/0/690 Wins/Draws/Losses. Avg profit   0.86%. Median profit   0.76%. Total profit  0.16275524 ETH ( 1624.95Σ%). Avg duration  46.0 min. Objective: -4.41651\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01018\n    trailing_stop_positive_offset = 0.01203\n    trailing_only_offset_is_reached = False\n\nclass ClucHAwerk_BTC(ClucHAwerk):\n\n\t# hyperopt --config user_data/config-backtest-BTC.json --hyperopt ClucHAwerkHyperopt_BTC --hyperopt-loss SortinoHyperOptLoss --strategy ClucHAwerk_BTC -e 500 --spaces buy --timeframe 1m --timerange 20210101-\n\t# 412/500:    572 trades. 505/17/50 Wins/Draws/Losses. Avg profit   1.80%. Median profit   2.27%. Total profit  0.01028714 BTC ( 1027.06Σ%). Avg duration 281.3 min. Objective: -152.09192\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.01192,\n        'bbdelta-tail': 0.96183,\n        'close-bblower': 0.01212,\n        'closedelta-close': 0.01039,\n        'rocr-1h': 0.53422,\n        'volume': 27\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-BTC.json --hyperopt ClucHAwerkHyperopt_BTC --hyperopt-loss SharpeHyperOptLoss --strategy ClucHAwerk_BTC -e 500 --spaces sell --timeframe 1m --timerange 20210101-\n    # 284/500:    575 trades. 508/17/50 Wins/Draws/Losses. Avg profit   1.80%. Median profit   2.25%. Total profit  0.01036281 BTC ( 1034.62Σ%). Avg duration 279.4 min. Objective: -100.84858\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-bbmiddle-close': 0.98016, \n\t\t'sell-rocr-1h': 0.86823\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-BTC.json --hyperopt ClucHAwerkHyperopt_BTC --hyperopt-loss OnlyProfitHyperOptLoss --strategy ClucHAwerk_BTC -e 500 --spaces roi --timeframe 1m --timerange 20210101- \n    # 304/500:    627 trades. 563/10/54 Wins/Draws/Losses. Avg profit   1.71%. Median profit   2.18%. Total profit  0.01075130 BTC ( 1073.41Σ%). Avg duration 248.0 min. Objective: -2.57804\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.18105,\n        \"9\": 0.10391,\n        \"49\": 0.0447,\n        \"53\": 0.02747,\n        \"141\": 0.01265,\n        \"312\": 0.00499,\n        \"466\": 0\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-BTC.json --hyperopt ClucHAwerkHyperopt_BTC --hyperopt-loss SharpeHyperOptLoss --strategy ClucHAwerk_BTC -e 250 --spaces stoploss --timeframe 1m --timerange 20210101- \n    # 192/250:    568 trades. 505/17/46 Wins/Draws/Losses. Avg profit   1.80%. Median profit   2.18%. Total profit  0.01023698 BTC ( 1022.05Σ%). Avg duration 280.1 min. Objective: -99.33155\n    # Stoploss:\n    stoploss = -0.11356\n\t\n\t# hyperopt --config user_data/config-backtest-BTC.json --hyperopt ClucHAwerkHyperopt_BTC --hyperopt-loss OnlyProfitHyperOptLoss --strategy ClucHAwerk_BTC -e 500 --spaces trailing --timeframe 1m --timerange 20210101-\n    # 313/500:    637 trades. 573/10/54 Wins/Draws/Losses. Avg profit   1.69%. Median profit   2.50%. Total profit  0.01079683 BTC ( 1077.96Σ%). Avg duration 242.7 min. Objective: -2.59319\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01008\n    trailing_stop_positive_offset = 0.04585\n    trailing_only_offset_is_reached = False\n\nclass ClucHAwerk_USD(ClucHAwerk):\n\n\t# hyperopt --config user_data/config-backtest-USD.json --hyperopt ClucHAwerkHyperopt_USD --hyperopt-loss SharpeHyperOptLoss --strategy ClucHAwerk_USD -e 500 --spaces buy --timeframe 1m --timerange 20210101-\n    # 470/500:    680 trades. 631/27/22 Wins/Draws/Losses. Avg profit   2.91%. Median profit   2.93%. Total profit  991.61804628 USD ( 1980.07Σ%). Avg duration 184.2 min. Objective: -186.95550\n    # Buy hyperspace params:\n    buy_params = {\n        'bbdelta-close': 0.01806,\n        'bbdelta-tail': 0.85912,\n        'close-bblower': 0.01158,\n        'closedelta-close': 0.01466,\n        'rocr-1h': 0.51901,\n        'volume': 26\n    }\n\t\n\t# hyperopt --config user_data/config-backtest-USD.json --hyperopt ClucHAwerkHyperopt_USD --hyperopt-loss SortinoHyperOptLoss --strategy ClucHAwerk_USD -e 500 --spaces sell --timeframe 1m --timerange 20210101- \n    # 1/500:    679 trades. 630/27/22 Wins/Draws/Losses. Avg profit   2.90%. Median profit   2.93%. Total profit  986.25885773 USD ( 1969.37Σ%). Avg duration 184.6 min. Objective: -277.19845\n    # Sell hyperspace params:\n    sell_params = {\n\t\t'sell-bbmiddle-close': 1.06163, \n\t\t'sell-rocr-1h': 0.63285\n    }\n\n\t# hyperopt --config user_data/config-backtest-USD.json --hyperopt ClucHAwerkHyperopt_USD --hyperopt-loss OnlyProfitHyperOptLoss --strategy ClucHAwerk_USD -e 500 --spaces roi --timeframe 1m --timerange 20210101- \n    # 334/500:    715 trades. 674/22/19 Wins/Draws/Losses. Avg profit   2.90%. Median profit   2.80%. Total profit  1037.85838537 USD ( 2072.40Σ%). Avg duration 166.5 min. Objective: -5.90800\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.19315,\n        \"13\": 0.13189,\n        \"24\": 0.08358,\n        \"103\": 0.03894,\n        \"148\": 0.0148,\n        \"201\": 0.00506,\n        \"447\": 0\n    }\n\n\t# hyperopt --config user_data/config-backtest-USD.json --hyperopt ClucHAwerkHyperopt_USD --hyperopt-loss SharpeHyperOptLoss --strategy ClucHAwerk_USD -e 500 --spaces stoploss --timeframe 1m --timerange 20210101- \n    # 352/500:    729 trades. 688/22/19 Wins/Draws/Losses. Avg profit   2.91%. Median profit   2.79%. Total profit  1060.61902930 USD ( 2117.85Σ%). Avg duration 167.6 min. Objective: -198.19711\n    # Stoploss:\n    stoploss = -0.17725\n\n\t# hyperopt --config user_data/config-backtest-USD.json --hyperopt ClucHAwerkHyperopt_USD --hyperopt-loss OnlyProfitHyperOptLoss --strategy ClucHAwerk_USD -e 500 --spaces trailing --timeframe 1m --timerange 20210101- \n    # 366/500:    730 trades. 689/22/19 Wins/Draws/Losses. Avg profit   2.91%. Median profit   2.80%. Total profit  1062.06091250 USD ( 2120.73Σ%). Avg duration 167.3 min. Objective: -6.06910\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02946\n    trailing_only_offset_is_reached = False"
  },
  {
    "path": "strategies/ClucMay72018/ClucMay72018.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\n\nclass ClucMay72018(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    works on new objectify branch!\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=5)\n        rsiframe = DataFrame(dataframe['rsi']).rename(columns={'rsi': 'close'})\n        dataframe['emarsi'] = ta.EMA(rsiframe, timeperiod=5)\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['adx'] = ta.ADX(dataframe)\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=50)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['close'] < dataframe['ema100']) &\n                    (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume'].rolling(window=30).mean().shift(1) * 20))\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CofiBitStrategy/CofiBitStrategy.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import IntParameter\nfrom pandas import DataFrame\n\n\n# --------------------------------\n\n\nclass CofiBitStrategy(IStrategy):\n    \"\"\"\n        taken from slack by user CofiBit\n    \"\"\"\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fastx\": 25,\n        \"buy_adx\": 25,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fastx\": 75,\n    }\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"40\": 0.05,\n        \"30\": 0.06,\n        \"20\": 0.07,\n        \"0\": 0.10\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    buy_fastx = IntParameter(20, 30, default=25)\n    buy_adx = IntParameter(20, 30, default=25)\n    sell_fastx = IntParameter(70, 80, default=75)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['open'] < dataframe['ema_low']) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastx.value) &\n                (dataframe['fastd'] < self.buy_fastx.value) &\n                (dataframe['adx'] > self.buy_adx.value)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['open'] >= dataframe['ema_high'])\n            ) |\n            (\n                (qtpylib.crossed_above(dataframe['fastk'], self.sell_fastx.value)) |\n                (qtpylib.crossed_above(dataframe['fastd'], self.sell_fastx.value))\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndCluc/CombinedBinHAndCluc.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\nclass CombinedBinHAndCluc(IStrategy):\n    # Based on a backtesting:\n    # - the best perfomance is reached with \"max_open_trades\" = 2 (in average for any market),\n    #   so it is better to increase \"stake_amount\" value rather then \"max_open_trades\" to get more profit\n    # - if the market is constantly green(like in JAN 2018) the best performance is reached with\n    #   \"max_open_trades\" = 2 and minimal_roi = 0.01\n    minimal_roi = {\n        \"0\": 0.05\n    }\n    stoploss = -0.05\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                    dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20))\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n            (dataframe['close'] > dataframe['bb_middleband']),\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndCluc2021/CombinedBinHAndCluc2021.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\nclass CombinedBinHAndCluc2021(IStrategy):\n    # Based on a backtesting:\n    # - the best perfomance is reached with \"max_open_trades\" = 2 (in average for any market),\n    #   so it is better to increase \"stake_amount\" value rather then \"max_open_trades\" to get more profit\n    # - if the market is constantly green(like in JAN 2018) the best performance is reached with\n    #   \"max_open_trades\" = 2 and minimal_roi = 0.01\n    minimal_roi = {\n        \"0\": 0.0888,\n        \"21\": 0.06115,\n        \"60\": 0.02667,\n        \"80\": 0.00\n    }\n    # minimal_roi = { \"0\": 0.01 }\n\n    stoploss = -0.09\n    timeframe = '5m'\n\n    process_only_new_candles = False\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        # strategy BBRSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                    dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n\n            ) |\n            (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe['ema100']) &\n                    (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20))\n\n            ) |\n            (  # strategy BBRSI\n                    (dataframe['rsi'] < 12) &\n                    (dataframe['close'] < dataframe['bb_lowerband4'])\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n            (\n                dataframe['close'] > dataframe['bb_middleband']\n            ),\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndCluc2021Bull/CombinedBinHAndCluc2021Bull.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\nclass CombinedBinHAndCluc2021Bull(IStrategy):\n    # Based on a backtesting:\n    # - the best perfomance is reached with \"max_open_trades\" = 2 (in average for any market),\n    #   so it is better to increase \"stake_amount\" value rather then \"max_open_trades\" to get more profit\n    # - if the market is constantly green(like in JAN 2018) the best performance is reached with\n    #   \"max_open_trades\" = 2 and minimal_roi = 0.01\n    # minimal_roi = {\n    #     \"0\": 0.0888,\n    #     \"21\": 0.06115,\n    #     \"60\": 0.02667,\n    #     \"80\": 0.00\n    # }\n    minimal_roi = { \"0\": 0.01 }\n\n    stoploss = -0.09\n    timeframe = '5m'\n\n    process_only_new_candles = False\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        # strategy BBRSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                    dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n\n            ) |\n            (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe['ema100']) &\n                    (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20))\n\n            ) |\n            (  # strategy BBRSI\n                    (dataframe['rsi'] < 12) &\n                    (dataframe['close'] < dataframe['bb_lowerband4'])\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n            (\n                dataframe['close'] > dataframe['bb_middleband']\n            ),\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucHyperV0/CombinedBinHAndClucHyperV0.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\nfrom abc import ABC, abstractmethod\nfrom pandas import DataFrame\nfrom freqtrade.persistence import Trade\nfrom freqtrade.exchange import timeframe_to_prev_date, timeframe_to_seconds\nfrom datetime import datetime, timedelta\nimport math\n\nclass CombinedBinHAndClucHyperV0(IStrategy):\n    timeframe = '1m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # ----------------------------------------------------------------\n    # Hyper Params\n    # \n    # # Buy \n    buy_a_bbdelta_rate = DecimalParameter(0.004, 0.016, default=0.016, decimals=3)\n    buy_a_closedelta_rate = DecimalParameter(0.000, 0.010, default=0.0087, decimals=4)\n    buy_a_tail_rate = DecimalParameter(0.12, 0.5, default=0.28, decimals=2)\n    buy_a_time_window = IntParameter(40, 100, default=30)\n    buy_a_min_sell_rate = DecimalParameter(1.004, 1.1, default=0.004, decimals=3)\n\n    buy_b_close_rate = DecimalParameter(0.4, 1.8, default=0.979, decimals=3)\n    buy_b_volume_mean_slow_window = IntParameter(100, 300, default=30)\n    buy_b_ema_slow = IntParameter(40, 100, default=50)\n    buy_b_time_window = IntParameter(100, 300, default=20)\n    buy_b_volume_mean_slow_num = IntParameter(10, 100, default=20)\n    # Sell\n    sell_bb_middleband_window = IntParameter(50, 200, default=20)\n    sell_trailing_stop_positive_offset = DecimalParameter(0.01, 0.03, default=0.008, decimals=3)\n    sell_trailing_stop_positive = 0.001\n\n    # ----------------------------------------------------------------\n    # Buy hyperspace params:\n    buy_params = {\n        'buy_a_bbdelta_rate': 0.0160,\n        'buy_a_closedelta_rate': 0.0088,\n        'buy_a_tail_rate': 0.9,\n        'buy_a_time_window': 21,\n        'buy_a_min_sell_rate': 1.03,\n\n        'buy_b_close_rate': 0.979,\n        'buy_b_time_window': 20,\n        'buy_b_ema_slow': 50,\n        'buy_b_volume_mean_slow_num': 20,\n        'buy_b_volume_mean_slow_window': 30,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell_bb_middleband_window': 91,\n        \"sell_trailing_stop_positive_offset\": 0.008,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    # Stoploss:\n    stoploss = -0.1\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    use_custom_stoploss = True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sell_trailing_stop_positive_offset = self.sell_trailing_stop_positive_offset.value if isinstance(self.sell_trailing_stop_positive_offset, ABC) else self.sell_trailing_stop_positive_offset\n        sell_trailing_stop_positive = self.sell_trailing_stop_positive.value if isinstance(self.sell_trailing_stop_positive, ABC) else self.sell_trailing_stop_positive\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        if last_candle is None:\n            return -1\n\n        trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc - timedelta(seconds=timeframe_to_seconds(self.timeframe)))\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n        if trade_candle.empty:\n            return -1\n\n        trade_candle = trade_candle.squeeze()\n\n        slippage_ratio = trade.open_rate / trade_candle['close'] - 1\n        slippage_ratio = slippage_ratio if slippage_ratio > 0 else 0\n        current_profit_comp = current_profit + slippage_ratio\n\n        if current_profit_comp < sell_trailing_stop_positive_offset:\n            return -1\n        else:\n            return sell_trailing_stop_positive\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        for x in self.buy_a_time_window.range if isinstance(self.buy_a_time_window, ABC) else [self.buy_a_time_window]:\n            buy_bollinger = qtpylib.bollinger_bands(dataframe['close'], window=x, stds=2)\n            dataframe[f'lower_{x}'] = buy_bollinger['lower']\n            dataframe[f'bbdelta_{x}'] = (buy_bollinger['mid'] - dataframe[f'lower_{x}']).abs()\n            dataframe[f'closedelta_{x}'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n            dataframe[f'tail_{x}'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        for x in self.buy_b_time_window.range if isinstance(self.buy_b_time_window, ABC) else [self.buy_b_time_window]:\n            bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=x, stds=2)\n            dataframe[f'bb_lowerband_{x}'] = bollinger['lower']\n\n        for x in self.buy_b_ema_slow.range if isinstance(self.buy_b_ema_slow, ABC) else [self.buy_b_ema_slow]:\n            dataframe[f'ema_slow_{x}'] = ta.EMA(dataframe, timeperiod=x)\n\n        for x in self.buy_b_volume_mean_slow_window.range if isinstance(self.buy_b_volume_mean_slow_window, ABC) else [self.buy_b_volume_mean_slow_window]:\n            dataframe[f'volume_mean_slow_{x}'] = dataframe['volume'].rolling(window=x).mean()\n\n        for x in self.sell_bb_middleband_window.range if isinstance(self.sell_bb_middleband_window, ABC) else [self.sell_bb_middleband_window]:\n            sell_bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=x, stds=2)\n            dataframe[f'bb_middleband_{x}'] = sell_bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        buy_a_time_window = self.buy_a_time_window.value if isinstance(self.buy_a_time_window, ABC) else self.buy_a_time_window\n        buy_a_bbdelta_rate = self.buy_a_bbdelta_rate.value if isinstance(self.buy_a_bbdelta_rate, ABC) else self.buy_a_bbdelta_rate\n        buy_a_closedelta_rate = self.buy_a_closedelta_rate.value if isinstance(self.buy_a_closedelta_rate, ABC) else self.buy_a_closedelta_rate\n        buy_a_tail_rate = self.buy_a_tail_rate.value if isinstance(self.buy_a_tail_rate, ABC) else self.buy_a_tail_rate\n        buy_a_min_sell_rate = self.buy_a_min_sell_rate.value if isinstance(self.buy_a_min_sell_rate, ABC) else self.buy_a_min_sell_rate\n\n        buy_b_ema_slow = self.buy_b_ema_slow.value if isinstance(self.buy_b_ema_slow, ABC) else self.buy_b_ema_slow\n        buy_b_close_rate = self.buy_b_close_rate.value if isinstance(self.buy_b_close_rate, ABC) else self.buy_b_close_rate\n        buy_b_time_window = self.buy_b_time_window.value if isinstance(self.buy_b_time_window, ABC) else self.buy_b_time_window\n        buy_b_volume_mean_slow_window = self.buy_b_volume_mean_slow_window.value if isinstance(self.buy_b_volume_mean_slow_window, ABC) else self.buy_b_volume_mean_slow_window\n        buy_b_volume_mean_slow_num = self.buy_b_volume_mean_slow_num.value if isinstance(self.buy_b_volume_mean_slow_num, ABC) else self.buy_b_volume_mean_slow_num\n\n        sell_bb_middleband_window = self.sell_bb_middleband_window.value if isinstance(self.sell_bb_middleband_window, ABC) else self.sell_bb_middleband_window\n\n        dataframe.loc[\n            (  # strategy BinHV45\n                    dataframe[f'lower_{buy_a_time_window}'].shift().gt(0) &\n                    dataframe[f'bbdelta_{buy_a_time_window}'].gt(dataframe['close'] * buy_a_bbdelta_rate) &\n                    dataframe[f'closedelta_{buy_a_time_window}'].gt(dataframe['close'] * buy_a_closedelta_rate) &\n                    dataframe[f'tail_{buy_a_time_window}'].lt(dataframe[f'bbdelta_{buy_a_time_window}'] * buy_a_tail_rate) &\n                    dataframe['close'].lt(dataframe[f'lower_{buy_a_time_window}'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift()) &\n                    dataframe[f'bb_middleband_{sell_bb_middleband_window}'].gt(dataframe['close'] *  buy_a_min_sell_rate)\n            ) |\n            (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe[f'ema_slow_{buy_b_ema_slow}']) &\n                    (dataframe['close'] < buy_b_close_rate * dataframe[f'bb_lowerband_{buy_b_time_window}']) &\n                    (dataframe['volume'] < (dataframe[f'volume_mean_slow_{buy_b_volume_mean_slow_window}'].shift(1) * buy_b_volume_mean_slow_num))\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        sell_bb_middleband_window = self.sell_bb_middleband_window.value if isinstance(self.sell_bb_middleband_window, ABC) else self.sell_bb_middleband_window\n        dataframe.loc[(dataframe['close'] > dataframe[f'bb_middleband_{sell_bb_middleband_window}']), 'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucHyperV3/CombinedBinHAndClucHyperV3.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\nfrom abc import ABC, abstractmethod\nfrom pandas import DataFrame\nfrom freqtrade.persistence import Trade\nfrom freqtrade.exchange import timeframe_to_prev_date, timeframe_to_seconds\nfrom datetime import datetime, timedelta\nimport math\n\nclass CombinedBinHAndClucHyperV3(IStrategy):\n    # Based on a backtesting:\n    # - the best perfomance is reached with \"max_open_trades\" = 2 (in average for any market),\n    #   so it is better to increase \"stake_amount\" value rather then \"max_open_trades\" to get more profit\n    # - if the market is constantly green(like in JAN 2018) the best performance is reached with\n    #   \"max_open_trades\" = 2 and minimal_roi = 0.01\n    timeframe = '1m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # ----------------------------------------------------------------\n    # Hyper Params\n    # \n    # Buy \n    buy_a_time_window = IntParameter(40, 100, default=30)\n    buy_a_atr_window = IntParameter(10, 300, default=14)\n\n    buy_a_bbdelta_rate = DecimalParameter(0.004, 0.02, default=0.016, decimals=3)\n    buy_a_closedelta_rate = DecimalParameter(0.000, 0.020, default=0.0087, decimals=4)\n    buy_a_tail_rate = DecimalParameter(0.12, 1, default=0.28, decimals=2)\n    buy_a_min_sell_rate = DecimalParameter(1.004, 1.1, default=1.03, decimals=3)\n    buy_a_atr_rate = DecimalParameter(0.00, 3.00, default=1, decimals=2)\n\n    buy_b_close_rate = DecimalParameter(0.4, 1.8, default=0.979, decimals=3)\n    buy_b_volume_mean_slow_window = IntParameter(100, 300, default=30)\n    buy_b_ema_slow = IntParameter(40, 100, default=50)\n    buy_b_time_window = IntParameter(100, 300, default=20)\n    buy_b_volume_mean_slow_num = IntParameter(10, 100, default=20)\n    # Sell\n    sell_bb_mid_slow_window = IntParameter(10, 100, default=91)\n    sell_trailing_stop_positive_offset = DecimalParameter(0.01, 0.03, default=0.012, decimals=3)\n    sell_trailing_stop_positive = 0.001\n\n    # ----------------------------------------------------------------\n    # Buy hyperspace params:\n    buy_params = {\n        'buy_a_closedelta_rate': 0.004,\n        'buy_a_time_window': 21,\n        'buy_a_atr_window': 14,\n\n        \"buy_a_atr_rate\": 0.26,\n        \"buy_a_bbdelta_rate\": 0.014,\n        \"buy_a_min_sell_rate\": 1.062,\n        \"buy_a_tail_rate\": 0.47,\n\n        'buy_b_close_rate': 0.979,\n        'buy_b_time_window': 20,\n        'buy_b_ema_slow': 50,\n        'buy_b_volume_mean_slow_num': 20,\n        'buy_b_volume_mean_slow_window': 30,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell_bb_mid_slow_window': 91,\n        \"sell_trailing_stop_positive_offset\": 0.014,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 3,\n    }\n\n    # Stoploss:\n    stoploss = -0.06\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    use_custom_stoploss = True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sell_trailing_stop_positive_offset = self.sell_trailing_stop_positive_offset.value if isinstance(self.sell_trailing_stop_positive_offset, ABC) else self.sell_trailing_stop_positive_offset\n        sell_trailing_stop_positive = self.sell_trailing_stop_positive.value if isinstance(self.sell_trailing_stop_positive, ABC) else self.sell_trailing_stop_positive\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        if last_candle is None:\n            return -1\n\n        trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc - timedelta(seconds=timeframe_to_seconds(self.timeframe)))\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n        if trade_candle.empty:\n            return -1\n\n        trade_candle = trade_candle.squeeze()\n\n        slippage_ratio = trade.open_rate / trade_candle['close'] - 1\n        slippage_ratio = slippage_ratio if slippage_ratio > 0 else 0\n        current_profit_comp = current_profit + slippage_ratio\n\n        if current_profit_comp < sell_trailing_stop_positive_offset:\n            return -1\n        else:\n            return sell_trailing_stop_positive\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        for x in self.buy_a_time_window.range if isinstance(self.buy_a_time_window, ABC) else [self.buy_a_time_window]:\n            buy_bollinger = qtpylib.bollinger_bands(dataframe['close'], window=x, stds=2)\n            dataframe[f'lower_{x}'] = buy_bollinger['lower']\n            dataframe[f'bbdelta_{x}'] = (buy_bollinger['mid'] - dataframe[f'lower_{x}']).abs()\n            dataframe[f'closedelta_{x}'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n            dataframe[f'tail_{x}'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        for x in self.buy_b_time_window.range if isinstance(self.buy_b_time_window, ABC) else [self.buy_b_time_window]:\n            bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=x, stds=2)\n            dataframe[f'bb_typical_lower_{x}'] = bollinger['lower']\n\n        for x in self.buy_b_ema_slow.range if isinstance(self.buy_b_ema_slow, ABC) else [self.buy_b_ema_slow]:\n            dataframe[f'ema_slow_{x}'] = ta.EMA(dataframe, timeperiod=x)\n\n        for x in self.buy_b_volume_mean_slow_window.range if isinstance(self.buy_b_volume_mean_slow_window, ABC) else [self.buy_b_volume_mean_slow_window]:\n            dataframe[f'volume_mean_slow_{x}'] = dataframe['volume'].rolling(window=x).mean()\n\n        for x in self.sell_bb_mid_slow_window.range if isinstance(self.sell_bb_mid_slow_window, ABC) else [self.sell_bb_mid_slow_window]:\n            sell_bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=x, stds=2)\n            dataframe[f'bb_typical_mid_{x}'] = sell_bollinger['mid']\n\n        for x in self.buy_a_atr_window.range if isinstance(self.buy_a_atr_window, ABC) else [self.buy_a_atr_window]:\n            dataframe[f'atr_rate_{x}'] = ta.ATR(dataframe, timeperiod=x) / dataframe['close']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        buy_a_time_window = self.buy_a_time_window.value if isinstance(self.buy_a_time_window, ABC) else self.buy_a_time_window\n        buy_a_bbdelta_rate = self.buy_a_bbdelta_rate.value if isinstance(self.buy_a_bbdelta_rate, ABC) else self.buy_a_bbdelta_rate\n        buy_a_closedelta_rate = self.buy_a_closedelta_rate.value if isinstance(self.buy_a_closedelta_rate, ABC) else self.buy_a_closedelta_rate\n        buy_a_tail_rate = self.buy_a_tail_rate.value if isinstance(self.buy_a_tail_rate, ABC) else self.buy_a_tail_rate\n        buy_a_min_sell_rate = self.buy_a_min_sell_rate.value if isinstance(self.buy_a_min_sell_rate, ABC) else self.buy_a_min_sell_rate\n        buy_a_atr_rate = self.buy_a_atr_rate.value if isinstance(self.buy_a_atr_rate, ABC) else self.buy_a_atr_rate\n        buy_a_atr_window = self.buy_a_atr_window.value if isinstance(self.buy_a_atr_window, ABC) else self.buy_a_atr_window\n\n        buy_b_ema_slow = self.buy_b_ema_slow.value if isinstance(self.buy_b_ema_slow, ABC) else self.buy_b_ema_slow\n        buy_b_close_rate = self.buy_b_close_rate.value if isinstance(self.buy_b_close_rate, ABC) else self.buy_b_close_rate\n        buy_b_time_window = self.buy_b_time_window.value if isinstance(self.buy_b_time_window, ABC) else self.buy_b_time_window\n        buy_b_volume_mean_slow_window = self.buy_b_volume_mean_slow_window.value if isinstance(self.buy_b_volume_mean_slow_window, ABC) else self.buy_b_volume_mean_slow_window\n        buy_b_volume_mean_slow_num = self.buy_b_volume_mean_slow_num.value if isinstance(self.buy_b_volume_mean_slow_num, ABC) else self.buy_b_volume_mean_slow_num\n\n        sell_bb_mid_slow_window = self.sell_bb_mid_slow_window.value if isinstance(self.sell_bb_mid_slow_window, ABC) else self.sell_bb_mid_slow_window\n\n        dataframe.loc[\n            (  # strategy BinHV45\n                    dataframe[f'lower_{buy_a_time_window}'].shift().gt(0) &\n                    dataframe[f'bbdelta_{buy_a_time_window}'].gt(dataframe['close'] * buy_a_bbdelta_rate) &\n                    dataframe[f'closedelta_{buy_a_time_window}'].gt(dataframe['close'] * buy_a_closedelta_rate) &\n                    dataframe[f'tail_{buy_a_time_window}'].lt(dataframe[f'bbdelta_{buy_a_time_window}'] * buy_a_tail_rate) &\n                    dataframe['close'].lt(dataframe[f'lower_{buy_a_time_window}'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift()) &\n                    dataframe[f'bb_typical_mid_{sell_bb_mid_slow_window}'].gt(dataframe['close'] *  (buy_a_min_sell_rate + dataframe[f'atr_rate_{buy_a_atr_window}'] * buy_a_atr_rate))\n            )\n            |\n            (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe[f'ema_slow_{buy_b_ema_slow}']) &\n                    (dataframe['close'] < buy_b_close_rate * dataframe[f'bb_typical_lower_{buy_b_time_window}']) &\n                    (dataframe['volume'] < (dataframe[f'volume_mean_slow_{buy_b_volume_mean_slow_window}'].shift(1) * buy_b_volume_mean_slow_num))\n            )\n            ,\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        sell_bb_mid_slow_window = self.sell_bb_mid_slow_window.value if isinstance(self.sell_bb_mid_slow_window, ABC) else self.sell_bb_mid_slow_window\n        dataframe.loc[(dataframe['close'] > dataframe[f'bb_typical_mid_{sell_bb_mid_slow_window}']), 'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/CombinedBinHAndClucV2/CombinedBinHAndClucV2.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame\n\n\n# The main idea is to buy only when overall uptrend in higher informative\n# but in local dip cause BinCluc some king of pullback strategy.\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV2(IStrategy):\n    minimal_roi = {\n        '120': 0.01,\n        '60': 0.02,\n        '30': 0.05,\n        '0': 0.1\n    }\n\n    informative_timeframe = '1h'\n    timeframe = '5m'\n\n    stoploss = -0.05\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    protections = [\n        {\n            \"method\": \"StoplossGuard\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 2,\n            \"stop_duration_candles\": 12,\n            \"only_per_pair\": True\n        }\n    ]\n\n    startup_candle_count = 200\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    @staticmethod\n    def get_informative_indicators(dataframe: DataFrame, metadata: dict):\n\n        ssl_down, ssl_up = SSLChannels(dataframe, 25)\n        dataframe['ssl_down'] = ssl_down\n        dataframe['ssl_up'] = ssl_up\n        dataframe['ssl_high'] = (ssl_up > ssl_down).astype('int') * 3\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=30)\n        stoch = ta.STOCHRSI(dataframe, 30, 35, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # dataframe['rsi'] = ta.RSI(dataframe, timeperiod=3)\n\n        dataframe['go_long'] = (\n            (dataframe['ssl_high'] > 0)\n            &\n            (dataframe['mfi'].shift().rolling(3).mean() > dataframe['mfi'])\n            &\n            (dataframe['srsi_fk'].shift().rolling(3).mean() > dataframe['srsi_fk'])\n        ).astype('int') * 4\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if not self.dp:\n            return dataframe\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        informative = self.get_informative_indicators(informative.copy(), metadata)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe,\n                                           ffill=True)\n        # don't overwrite the base dataframe's HLCV information\n        skip_columns = [(s + \"_\" + self.informative_timeframe) for s in\n                        ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.rename(\n            columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s,\n            inplace=True)\n\n        typical_price = qtpylib.typical_price(dataframe)\n\n        # strategy BinHV45\n        bollinger_b = qtpylib.bollinger_bands(typical_price, window=40, stds=2)\n        mid = bollinger_b['mid']\n        lower = bollinger_b['lower']\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger_c = qtpylib.bollinger_bands(typical_price, window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger_c['lower']\n        dataframe['bb_middleband'] = bollinger_c['mid']\n        dataframe['bb_upperband'] = bollinger_c['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['go_long'] > 0)\n            &\n            (\n                (  # strategy BinHV45\n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                    dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n                ) |\n                (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20))\n                )\n             ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['close'], dataframe['bb_upperband']))\n            ),\n            'sell'\n        ] = 1\n        return dataframe"
  },
  {
    "path": "strategies/CombinedBinHAndClucV3/CombinedBinHAndClucV3.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\nclass CombinedBinHAndClucV3(IStrategy):\n    minimal_roi = {\n        \"0\": 0.018\n    }\n\n    stoploss = -0.99\n\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        if (current_time - timedelta(minutes=2200) > trade.open_date_utc) & (current_profit < 0):\n            return 0.01\n        return 0.5\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift())\n            )\n            |\n            (  # strategy ClucMay72018\n                ((dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20)))\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n\n            # (qtpylib.crossed_below(dataframe['ema_slow'], dataframe['ema_200']))\n            # |\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['high'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['high'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['high'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV4/CombinedBinHAndClucV4.py",
    "content": "# Definition of Bollinger Bands\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\nclass CombinedBinHAndClucV4(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.019\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 50\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=300) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (  # strategy ClucMay72018\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            ( # Improves the profit slightly.\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['high'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['high'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['high'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['high'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV5/CombinedBinHAndClucV5.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV5 by iterativ                                                      ##\n##                                                                                                       ##\n##    Fretrade https://github.com/freqtrade/freqtrade                                                    ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V5 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 40 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass CombinedBinHAndClucV5(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.018\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 50\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=300) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * 0.008) &\n                dataframe['closedelta'].gt(dataframe['close'] * 0.0175) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * 0.25) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (  # strategy ClucMay72018\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            ( # Improves the profit slightly.\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV5Hyperoptable/CombinedBinHAndClucV5Hyperoptable.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import (IStrategy, timeframe_to_prev_date, merge_informative_pair, stoploss_from_open, \n                                IntParameter, DecimalParameter, CategoricalParameter, RealParameter)\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom typing import Dict, List\nfrom skopt.space import Dimension\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV5 by iterativ                                                      ##\n##                                                                                                       ##\n##    Fretrade https://github.com/freqtrade/freqtrade                                                    ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V5 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 40 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass CombinedBinHAndClucV5Hyperoptable(IStrategy):\n    minimal_roi = {\n        \"0\": 0.018\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 50\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    buy_bin_bbdelta_close =  RealParameter(0.004, 0.15, default=0.008, space='buy', optimize=True, load=True)\n    buy_bin_closedelta_close = RealParameter(0.01, 0.03, default=0.0175, space='buy', optimize=True, load=True)\n    buy_bin_tail_bbdelta = RealParameter(0.1, 0.5, default=0.25, space='buy', optimize=True, load=True)\n    buy_cluc_close_bblowerband = RealParameter(0.5, 1.5, default=0.985, space='buy', optimize=True, load=True)\n    buy_cluc_volume = IntParameter(15, 30, default=20, space='buy', optimize=True, load=True)\n    \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n                        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=300) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n    # for hyperopt\n                                                                                               \n        \n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                (dataframe['lower'].shift() > 0 ) &\n                (dataframe['bbdelta'] > (dataframe['close'] * self.buy_bin_closedelta_close.value)) &\n                (dataframe['closedelta'] > (dataframe['close'] * self.buy_bin_closedelta_close.value)) &\n                (dataframe['tail'] < (dataframe['bbdelta'] * self.buy_bin_tail_bbdelta.value)) &\n                (dataframe['close'] < (dataframe['lower'].shift())) &\n                (dataframe['close'] <= (dataframe['close'].shift())) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (  # strategy ClucMay72018\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_cluc_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * self.buy_cluc_volume.value)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            ( # Improves the profit slightly.\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n        \n    # nested hyperopt class    \n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def sell_indicator_space() -> List[Dimension]:\n            return []\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV6/CombinedBinHAndClucV6.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV6 by iterativ                                                      ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                    ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V6 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 40 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV6(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.0181\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h' # informative tf\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=300) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        # Prevent ROI trigger, if there is more potential, in order to maximize profit\n        if (last_candle['rsi'] > 50):\n            return False\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n         # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * 0.031) &\n                dataframe['closedelta'].gt(dataframe['close'] * 0.018) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * 0.233) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (  # strategy ClucMay72018\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.993 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 21)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - 43.276) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            ( # Improves the profit slightly.\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV6H/CombinedBinHAndClucV6H.py",
    "content": "# --- Do not remove these libs --------------------------------------------------------------------\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nimport logging\nimport pandas as pd\nimport numpy as np\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.strategy import IStrategy, IntParameter, DecimalParameter, CategoricalParameter, merge_informative_pair\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV6 by iterativ                                                      ##\n##                hyperoptable additions and refactoring by nightshift2k                                 ##\n##                                                                                                       ##\n##                source & discussion -> freqtrade discord:                                              ##\n##                https://discord.gg/ZdsMQ3tE                                                            ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                   ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V6 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 40 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\n# -------------------------------------------------------------------------------------------------\n# --- logger for parameter merging output, only remove if you remove it further down too! ---------\nlogger = logging.getLogger(__name__)\n# -------------------------------------------------------------------------------------------------\n\nclass CombinedBinHAndClucV6H(IStrategy):\n\n    minimal_roi = {\n        \"0\": 0.0181\n    }\n\n    max_open_trades = 5\n\n    # Using custom stoploss\n    stoploss = -0.99\n    use_custom_stoploss = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # derived from EMA 200\n    startup_candle_count: int = 200\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # hyperspace default buy params \n    buy_params = {\n        'buy_bin_bbdelta_close': 0.031,\n        'buy_bin_closedelta_close': 0.018,\n        'buy_bin_tail_bbdelta': 0.233,\n        'buy_bin_guard': True,\n\n        'buy_cluc_close_bblowerband': 0.993,\n        'buy_cluc_volume': 21,\n        'buy_cluc_guard': True,\n\n        'buy_long_rsi_diff': 43.276, \n\n        'buy_bin_enable': True,\n        'buy_cluc_enable': True,\n        'buy_long_enable': True,\n\n        'buy_minimum_conditions': 1\n    }\n\n    # hyperspace default sell params\n    sell_params = {\n        'sell_roi_override_rsi_threshold': 50, # to disable holding with high RSI set to 100\n        'cstp_loss_threshold': 0,\n        'cstp_bail_time': 5\n    }\n\n    # if you want to see which buy conditions were met\n    # or if there is an trade exit override due to high RSI set to True\n    # logger will output the buy and trade exit conditions\n    cust_log_verbose = False\n\n\n    ###########################################################################################################\n    ## IMPORTANT NOTICE REGARDING HYPEROPT:                                                                  ##\n    ##   Use the optimize dict below to enable optimization (set to True) of one or more                     ##\n    ##   hyperspace parameters.                                                                              ##\n    ##                                                                                                       ##\n    ##   Please be aware: Enabling ALL at once will very likely produce very low results!                    ## \n    ##   So please enable max. 1-2 parameters at once, you'll need to play around                            ##\n    ##   what makes more or less sense. At the end it always depends on a lot more                           ##\n    ##   parameters (stake, max trades, hyperopt-loss, etc.)                                                 ##\n    ###########################################################################################################\n  \n    # use this switches to enable the optimization of hyperspace params\n    cust_optimize = {\n        'buy_bin_bbdelta_close': False,\n        'buy_bin_closedelta_close': False,\n        'buy_bin_tail_bbdelta': False,\n        'buy_bin_guard': False,\n        'buy_cluc_close_bblowerband': False,\n        'buy_cluc_volume': False,\n        'buy_cluc_guard': False,\n        'buy_long_rsi_diff': False,\n        'buy_bin_enable': False,\n        'buy_cluc_enable': False,\n        'buy_long_enable': False,\n        'buy_minimum_conditions': False,\n        'sell_roi_override_rsi_threshold': False,\n        'cstp_bail_time': False,\n        'cstp_loss_threshold': False\n    }\n\n    # bin buy parameters\n    buy_bin_bbdelta_close =  DecimalParameter(0.0, 0.05, default=0.031, space='buy', optimize=cust_optimize['buy_bin_bbdelta_close'], load=True)\n    buy_bin_closedelta_close = DecimalParameter(0.0, 0.03, default=0.018, decimals=4, space='buy', optimize=cust_optimize['buy_bin_closedelta_close'], load=True)\n    buy_bin_tail_bbdelta = DecimalParameter(0.0, 1.0, default=0.233, decimals=3, space='buy', optimize=cust_optimize['buy_bin_tail_bbdelta'], load=True)\n    buy_bin_guard = CategoricalParameter([True, False], default=True, space='buy', optimize=cust_optimize['buy_bin_guard'], load=True)\n\n    # cluc buy parameters\n    buy_cluc_close_bblowerband = DecimalParameter(0.0, 1.5, default=0.993, decimals=3, space='buy', optimize=cust_optimize['buy_cluc_close_bblowerband'], load=True)\n    buy_cluc_volume = IntParameter(10, 40, default=21, space='buy', optimize=cust_optimize['buy_cluc_volume'], load=True)\n    buy_cluc_guard = CategoricalParameter([True, False], default=True, space='buy', optimize=cust_optimize['buy_cluc_guard'], load=True)\n\n    # log buy parameters\n    buy_long_rsi_diff = DecimalParameter(40, 45, default=43.276, decimals=3, space='buy', optimize=cust_optimize['buy_long_rsi_diff'], load=True)\n\n    # enable bin, cluc or long \n    buy_bin_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=cust_optimize['buy_bin_enable'], load=True)\n    buy_cluc_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=cust_optimize['buy_cluc_enable'], load=True)\n    buy_long_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=cust_optimize['buy_long_enable'], load=True)\n    \n    # minimum conditions to match in buy\n    buy_minimum_conditions = IntParameter(1, 2, default=1, space='buy', optimize=cust_optimize['buy_minimum_conditions'], load=True)\n\n    # if RSI above threshold, override ROI\n    sell_roi_override_rsi_threshold = IntParameter(40, 70, default=50, space='sell', optimize=cust_optimize['sell_roi_override_rsi_threshold'], load=True)\n\n    # custom stoploss, if trade open > x hours and loss > threshold then sell    \n    cstp_bail_time = IntParameter(1, 36, default=5, space='sell', optimize=cust_optimize['cstp_bail_time'])\n    cstp_loss_threshold = DecimalParameter(-0.25, 0, default=0, decimals=2, space='sell', optimize=cust_optimize['cstp_loss_threshold'])\n\n\n    \"\"\"\n    Informative Pairs\n    \"\"\"\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n\n    \"\"\"\n    Informative Timeframe Indicators\n    \"\"\"\n    def get_informative_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # SSL Channels\n        ssldown, sslup = SSLChannels_ATR(dataframe, 20)\n        dataframe['ssl-up'] = sslup\n        dataframe['ssl-down'] = ssldown\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')\n\n        return dataframe\n\n\n    \"\"\"\n    Main Timeframe Indicators\n    \"\"\"\n    def get_main_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n         # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # drop NAN in hyperopt to fix \"'<' not supported between instances of 'str' and 'int' error\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe = dataframe.dropna()\n\n        return dataframe\n\n\n    \"\"\"\n    Populate Informative and Main Timeframe Indicators\n    \"\"\"\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n   \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 5), \"Backtest this strategy in a timeframe of 5m or less.\"\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        informative = self.get_informative_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n        dataframe = self.get_main_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    \"\"\"\n    Buy Signal\n    \"\"\"\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n      \n        # reset additional dataframe rows\n        dataframe.loc[:, 'buy_cond_bin'] = False\n        dataframe.loc[:, 'buy_cond_cluc'] = False\n        dataframe.loc[:, 'buy_cond_long'] = False\n        dataframe.loc[:, 'conditions_count'] = 0\n        \n\n        # strategy BinHV45 + guards by @iterativ\n        dataframe.loc[\n            (\n                # @iterativ adition (guard)\n                (\n                    (\n                        (dataframe['close'] > dataframe['ema_200_1h']) &\n                        (dataframe['ema_50'] > dataframe['ema_200']) &\n                        (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                        (self.buy_bin_guard.value == True)\n                    ) |\n                    (self.buy_bin_guard.value == False)\n                ) &\n\n                # strategy BinHV45\n                dataframe['lower'].shift().gt(0) &\n\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bin_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bin_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bin_tail_bbdelta.value) &\n\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (self.buy_bin_enable.value == True)\n            ),\n            'buy_cond_bin'\n        ] = 1\n\n        # strategy ClucMay72018 + guards by @iterativ\n        dataframe.loc[\n            (   \n                # @iterativ addition (guard)\n                (\n                    (\n                        (dataframe['close'] > dataframe['ema_200']) &\n                        (dataframe['close'] > dataframe['ema_200_1h']) &\n                        (self.buy_cluc_guard.value == True)\n                    ) |\n                    (self.buy_cluc_guard.value == False)\n                ) &\n\n                # strategy ClucMay72018\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_cluc_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * self.buy_cluc_volume.value)) &\n                (self.buy_cluc_enable.value == True)\n            ),\n            'buy_cond_cluc'\n        ] = 1\n\n        # long strategy by @iterativ\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl-dir_1h'] == 'up') &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_long_rsi_diff.value) &\n                (self.buy_long_enable.value == True)\n            ),\n            'buy_cond_long'\n        ] = 1\n\n        # count the amount of conditions met\n        dataframe.loc[:, 'conditions_count'] = dataframe['buy_cond_bin'].astype(int) + dataframe['buy_cond_cluc'].astype(int) + dataframe['buy_cond_long'].astype(int)\n\n        # append the minimum amount of conditions to be met\n        conditions.append(dataframe['conditions_count'] >= self.buy_minimum_conditions.value)\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'\n            ] = 1\n\n        # verbose logging enable only for verbose information or troubleshooting\n        if self.cust_log_verbose == True:\n            for index, row in dataframe.iterrows():\n                if row['buy'] == 1:               \n                    buy_cond_details = f\"count={int(row['conditions_count'])}/bin={int(row['buy_cond_bin'])}/cluc={int(row['buy_cond_cluc'])}/long={int(row['buy_cond_long'])}\"\n                    logger.info(f\"{metadata['pair']} - candle: {row['date']} - buy condition - details: {buy_cond_details}\")\n\n        return dataframe\n\n\n    \"\"\"\n    Sell Signal\n    \"\"\"\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            (dataframe['close'] > dataframe['bb_upperband']) &\n            (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n            (dataframe['volume'] > 0) # Make sure Volume is not 0\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n    \"\"\"\n    Custom Stop Loss\n    \"\"\"\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        \n        if (current_profit < self.cstp_loss_threshold.value) & (current_time - timedelta(hours=int(self.cstp_bail_time.value)) > trade.open_date_utc):\n            return 0.01\n\n        return self.stoploss\n\n\n    \"\"\"\n    Trade Exit Confirmation\n    \"\"\"\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float, rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if self.cust_log_verbose == True:\n            logger.info(f\"{pair} - candle: {last_candle['date']} - exit trade {sell_reason} with profit {trade.calc_profit_ratio(rate)}\")\n\n        # failsafe for user triggered forced sells > always have highest prio!\n        if sell_reason == 'force_sell':\n            return True\n\n        # Prevent ROI trigger, if there is more potential, in order to maximize profit\n        if last_candle is not None and ((sell_reason == 'roi') ):\n            rsi = 0\n            if 'rsi' in last_candle.index:\n                rsi = last_candle['rsi']\n           \n            if ( (rsi >= self.sell_roi_override_rsi_threshold.value) ):\n                if self.cust_log_verbose == True:\n                    logger.info(f\"{pair} - candle: {last_candle['date']} - not exiting trade with current profit {trade.calc_profit_ratio(rate)}, rsi = {rsi} which is > than {self.sell_roi_override_rsi_threshold.value}\")\n                return False\n            else:\n                return True\n\n        return True\n\n\n# --- custom indicators ---------------------------------------------------------------------------\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV7/CombinedBinHAndClucV7.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV7 by iterativ                                                      ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                   ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V7 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV7(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.0181\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h' # informative tf\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Buy Hyperopt params\n\n    buy_dip_threshold_1 = DecimalParameter(0.08, 0.2, default=0.14, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.02, 0.4, default=0.34, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.25, 0.44, default=0.38, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.04, default=0.031, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.021, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.2, 0.4, default=0.264, space='buy', optimize=True, load=True)\n\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.992, space='buy', optimize=True, load=True)\n    buy_bb20_volume = IntParameter(18, 36, default=29, space='buy', optimize=True, load=True)\n\n    buy_rsi_diff = DecimalParameter(34.0, 60.0, default=50.48, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_min_inc = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi_1h = DecimalParameter(40.0, 70.0, default=67.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi = DecimalParameter(30.0, 40.0, default=38.5, space='buy', decimals=2, optimize=True, load=True)\n    buy_mfi = DecimalParameter(36.0, 65.0, default=36.0, space='buy', decimals=2, optimize=True, load=True)\n\n    # Sell Hyperopt params\n\n    sell_roi_profit_1 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_rsi_1 = DecimalParameter(30.0, 38.0, default=34, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_profit_2 = DecimalParameter(0.02, 0.05, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_rsi_2 = DecimalParameter(34.0, 44.0, default=38, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_profit_3 = DecimalParameter(0.0, 0.0, default=0.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_roi_rsi_3 = DecimalParameter(48.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_main = DecimalParameter(72.0, 90.0, default=77, space='sell', decimals=2, optimize=True, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=280) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        # Prevent sell, if there is more potential, in order to maximize profit\n        if (last_candle is not None):\n            current_profit = trade.calc_profit_ratio(rate)\n            if (sell_reason == 'roi'):\n                if (current_profit > self.sell_roi_profit_1.value):\n                    if (last_candle['rsi'] > self.sell_roi_rsi_1.value):\n                        return False\n                elif (current_profit > self.sell_roi_profit_2.value):\n                    if (last_candle['rsi'] > self.sell_roi_rsi_2.value):\n                        return False\n                elif (current_profit > self.sell_roi_profit_3.value):\n                    if (last_candle['rsi'] > self.sell_roi_rsi_3.value):\n                        return False\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_1h) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n         # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * self.buy_bb20_volume.value))\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(16)) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (((dataframe['open'].rolling(24).min() - dataframe['close']) / dataframe['close']) > self.buy_min_inc.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h.value) &\n                (dataframe['rsi'] < self.buy_rsi.value) &\n                (dataframe['mfi'] < self.buy_mfi.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['rsi'] > self.sell_rsi_main.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV8/CombinedBinHAndClucV8.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV8 by iterativ                                                      ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                   ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V8 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV8(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h' # informative tf\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Buy Hyperopt params\n\n    buy_dip_threshold_0 = DecimalParameter(0.001, 0.1, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_1 = DecimalParameter(0.08, 0.2, default=0.12, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.02, 0.4, default=0.28, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.25, 0.44, default=0.36, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.04, default=0.031, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.021, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.2, 0.4, default=0.264, space='buy', optimize=True, load=True)\n\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.992, space='buy', optimize=True, load=True)\n    buy_bb20_volume = IntParameter(18, 36, default=29, space='buy', optimize=True, load=True)\n\n    buy_rsi_diff = DecimalParameter(34.0, 60.0, default=50.48, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_min_inc = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi_1h = DecimalParameter(40.0, 70.0, default=67.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi = DecimalParameter(30.0, 40.0, default=38.5, space='buy', decimals=2, optimize=True, load=True)\n    buy_mfi = DecimalParameter(36.0, 65.0, default=36.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_volume_1 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_1 = DecimalParameter(0.01, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n\n    # Sell Hyperopt params\n\n    sell_custom_roi_profit_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_1 = DecimalParameter(40.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_2 = DecimalParameter(0.01, 0.20, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_2 = DecimalParameter(42.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_3 = DecimalParameter(0.15, 0.30, default=0.08, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_3 = DecimalParameter(44.0, 58.0, default=56, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_4 = DecimalParameter(0.3, 0.7, default=0.14, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_4 = DecimalParameter(44.0, 60.0, default=58, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_roi_profit_5 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.015, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_stoploss_1 = DecimalParameter(-0.15, -0.03, default=-0.05, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_main = DecimalParameter(72.0, 90.0, default=80, space='sell', decimals=2, optimize=True, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=280) > trade.open_date_utc):\n            return 0.01\n        elif (current_profit < self.sell_custom_stoploss_1.value):\n            dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n            last_candle = dataframe.iloc[-1].squeeze()\n            if (last_candle is not None):\n                if (last_candle['sma_200_dec']) & (last_candle['sma_200_dec_1h']):\n                    return 0.01\n        return 0.99\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_4.value):\n                return 'roi_target_4'\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_3.value):\n                return 'roi_target_3'\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_2.value):\n                return 'roi_target_2'\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_1.value):\n                return 'roi_target_1'\n            elif (current_profit > 0) & (current_profit < self.sell_custom_roi_profit_5.value) & (last_candle['sma_200_dec']):\n                return 'roi_target_5'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value)):\n                return 'trail_target_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value)):\n                return 'trail_target_2'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_1h) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * self.buy_bb20_volume.value))\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(16)) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (((dataframe['open'].rolling(24).min() - dataframe['close']) / dataframe['close']) > self.buy_min_inc.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h.value) &\n                (dataframe['rsi'] < self.buy_rsi.value) &\n                (dataframe['mfi'] < self.buy_mfi.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_1.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['rsi'] > self.sell_rsi_main.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV8Hyper/CombinedBinHAndClucV8Hyper.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n\n###########################################################################################################\n##                CombinedBinHAndClucV8 by iterativ                                                      ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                   ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V8 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV8Hyper(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h' # informative tf\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Buy Hyperopt params\n\n    buy_dip_threshold_0 = DecimalParameter(0.001, 0.1, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_1 = DecimalParameter(0.08, 0.2, default=0.12, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.02, 0.4, default=0.28, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.25, 0.44, default=0.36, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.04, default=0.031, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.021, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.2, 0.4, default=0.264, space='buy', optimize=True, load=True)\n\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.992, space='buy', optimize=True, load=True)\n    buy_bb20_volume = IntParameter(18, 36, default=29, space='buy', optimize=True, load=True)\n\n    buy_rsi_diff = DecimalParameter(34.0, 60.0, default=50.48, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_min_inc = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi_1h = DecimalParameter(40.0, 70.0, default=67.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi = DecimalParameter(30.0, 40.0, default=38.5, space='buy', decimals=2, optimize=True, load=True)\n    buy_mfi = DecimalParameter(36.0, 65.0, default=36.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_volume_1 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_1 = DecimalParameter(0.01, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n\n    # Sell Hyperopt params\n\n    sell_custom_roi_profit_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_1 = DecimalParameter(40.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_2 = DecimalParameter(0.01, 0.20, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_2 = DecimalParameter(42.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_3 = DecimalParameter(0.15, 0.30, default=0.08, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_3 = DecimalParameter(44.0, 58.0, default=56, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_4 = DecimalParameter(0.3, 0.7, default=0.14, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_4 = DecimalParameter(44.0, 60.0, default=58, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_roi_profit_5 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.015, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_stoploss_1 = DecimalParameter(-0.15, -0.03, default=-0.05, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_main = DecimalParameter(72.0, 90.0, default=80, space='sell', decimals=2, optimize=True, load=True)\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_bb20_close_bblowerband\": 0.991,\n        \"buy_bb20_volume\": 34,\n        \"buy_bb40_bbdelta_close\": 0.029,\n        \"buy_bb40_closedelta_close\": 0.012,\n        \"buy_bb40_tail_bbdelta\": 0.212,\n        \"buy_mfi\": 57.29,\n        \"buy_min_inc\": 0.05,\n        \"buy_rsi\": 34.94,\n        \"buy_rsi_1h\": 42.66,\n        \"buy_rsi_diff\": 45.82,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_rsi_main\": 76.4,\n\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.107,\n        \"15\": 0.047,\n        \"75\": 0.013,\n        \"106\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.274\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.314\n    trailing_stop_positive_offset = 0.411\n    trailing_only_offset_is_reached = False\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=280) > trade.open_date_utc):\n            return 0.01\n        elif (current_profit < self.sell_custom_stoploss_1.value):\n            dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n            last_candle = dataframe.iloc[-1].squeeze()\n            if (last_candle is not None):\n                if (last_candle['sma_200_dec']) & (last_candle['sma_200_dec_1h']):\n                    return 0.01\n        return 0.99\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_4.value):\n                return 'roi_target_4'\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_3.value):\n                return 'roi_target_3'\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_2.value):\n                return 'roi_target_2'\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_1.value):\n                return 'roi_target_1'\n            elif (current_profit > 0) & (current_profit < self.sell_custom_roi_profit_5.value) & (last_candle['sma_200_dec']):\n                return 'roi_target_5'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value)):\n                return 'trail_target_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value)):\n                return 'trail_target_2'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_1h) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * self.buy_bb20_volume.value))\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(16)) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (((dataframe['open'].rolling(24).min() - dataframe['close']) / dataframe['close']) > self.buy_min_inc.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h.value) &\n                (dataframe['rsi'] < self.buy_rsi.value) &\n                (dataframe['mfi'] < self.buy_mfi.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_1.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['rsi'] > self.sell_rsi_main.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV8XH/CombinedBinHAndClucV8XH.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n\n###########################################################################################################\n##                Based on CombinedBinHAndClucV8 by iterativ\n##                (Few improvements on this version by themoz)                                           ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                   ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V8 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1,\n                         np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV8XH(IStrategy):\n    INTERFACE_VERSION = 2\n\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_bb20_close_bblowerband\": 0.917,\n        \"buy_bb20_volume\": 32,\n        \"buy_bb40_bbdelta_close\": 0.039,\n        \"buy_bb40_closedelta_close\": 0.02,\n        \"buy_bb40_tail_bbdelta\": 0.239,\n        \"buy_mfi\": 37.77,\n        \"buy_min_inc\": 0.01,\n        \"buy_rsi\": 35.74,\n        \"buy_rsi_1h\": 66.97,\n        \"buy_rsi_diff\": 49.29,\n        \"buy_dip_threshold_0\": 0.015,  # value loaded from strategy\n        \"buy_dip_threshold_1\": 0.12,  # value loaded from strategy\n        \"buy_dip_threshold_2\": 0.28,  # value loaded from strategy\n        \"buy_dip_threshold_3\": 0.36,  # value loaded from strategy\n        \"buy_ema_open_mult_1\": 0.02,  # value loaded from strategy\n        \"buy_volume_1\": 2.0,  # value loaded from strategy\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_rsi_main\": 72.19,\n        \"sell_rsi_parachute\": 39.84,\n        \"sell_custom_roi_profit_1\": 0.01,  # value loaded from strategy\n        \"sell_custom_roi_profit_2\": 0.04,  # value loaded from strategy\n        \"sell_custom_roi_profit_3\": 0.08,  # value loaded from strategy\n        \"sell_custom_roi_profit_4\": 0.14,  # value loaded from strategy\n        \"sell_custom_roi_profit_5\": 0.04,  # value loaded from strategy\n        \"sell_custom_roi_rsi_1\": 50,  # value loaded from strategy\n        \"sell_custom_roi_rsi_2\": 50,  # value loaded from strategy\n        \"sell_custom_roi_rsi_3\": 56,  # value loaded from strategy\n        \"sell_custom_roi_rsi_4\": 58,  # value loaded from strategy\n        \"sell_custom_stoploss_1\": -0.05,  # value loaded from strategy\n        \"sell_trail_down_1\": 0.03,  # value loaded from strategy\n        \"sell_trail_down_2\": 0.015,  # value loaded from strategy\n        \"sell_trail_profit_max_1\": 0.4,  # value loaded from strategy\n        \"sell_trail_profit_max_2\": 0.1,  # value loaded from strategy\n        \"sell_trail_profit_min_1\": 0.1,  # value loaded from strategy\n        \"sell_trail_profit_min_2\": 0.02,  # value loaded from strategy\n    }\n\n\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -0.99  # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'  # informative tf\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    # it doesn't meant anything, just to guarantee there is a minimal profit.\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Buy Hyperopt params\n\n    buy_dip_threshold_0 = DecimalParameter(\n        0.001, 0.1, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_1 = DecimalParameter(\n        0.08, 0.2, default=0.12, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(\n        0.02, 0.4, default=0.28, space='buy', decimals=2, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(\n        0.25, 0.44, default=0.36, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close = DecimalParameter(\n        0.005, 0.04, default=0.031, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(\n        0.01, 0.03, default=0.021, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(\n        0.2, 0.4, default=0.264, space='buy', optimize=True, load=True)\n\n    buy_bb20_close_bblowerband = DecimalParameter(\n        0.8, 1.1, default=0.992, space='buy', optimize=True, load=True)\n    buy_bb20_volume = IntParameter(\n        18, 36, default=29, space='buy', optimize=True, load=True)\n\n    buy_rsi_diff = DecimalParameter(\n        34.0, 60.0, default=50.48, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_min_inc = DecimalParameter(\n        0.005, 0.05, default=0.01, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi_1h = DecimalParameter(\n        40.0, 70.0, default=67.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_rsi = DecimalParameter(\n        30.0, 40.0, default=38.5, space='buy', decimals=2, optimize=True, load=True)\n    buy_mfi = DecimalParameter(\n        36.0, 65.0, default=36.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_volume_1 = DecimalParameter(\n        1.0, 10.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_1 = DecimalParameter(\n        0.01, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n\n    # Sell Hyperopt params\n\n    sell_custom_roi_profit_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_1 = DecimalParameter(\n        40.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_2 = DecimalParameter(\n        0.01, 0.20, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_2 = DecimalParameter(\n        42.0, 56.0, default=50, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_3 = DecimalParameter(\n        0.15, 0.30, default=0.08, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_3 = DecimalParameter(\n        44.0, 58.0, default=56, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_profit_4 = DecimalParameter(\n        0.3, 0.7, default=0.14, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_roi_rsi_4 = DecimalParameter(\n        44.0, 60.0, default=58, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_roi_profit_5 = DecimalParameter(\n        0.01, 0.1, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(\n        0.1, 0.25, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(\n        0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(\n        0.04, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(\n        0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(\n        0.08, 0.25, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(\n        0.04, 0.2, default=0.015, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_stoploss_1 = DecimalParameter(\n        -0.15, -0.03, default=-0.05, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_main = DecimalParameter(\n        72.0, 90.0, default=80, space='sell', decimals=2, optimize=True, load=True)\n\n    #X version additional RSI value\n    sell_rsi_parachute = DecimalParameter(\n        30.0, 55.0, default=40, space='sell', decimals=2, optimize=True, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        \n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        \n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=280) > trade.open_date_utc):\n            return 0.01\n        elif (current_profit < self.sell_custom_stoploss_1.value):\n            if (last_candle is not None):\n                if (last_candle['sma_200_dec']) & (last_candle['sma_200_dec_1h']):\n                    return 0.01\n        # X version:\n        # try eventually to catch a minimal pullback before it is too late\n        elif (0 >= current_profit >= self.sell_custom_stoploss_1.value):\n            if (last_candle is not None):\n                if ((last_candle['sma_200_dec']) &\n                    (last_candle['close'] > last_candle['bb_middleband']) &\n                    (last_candle['rsi'] > self.sell_rsi_parachute.value)):\n                    return 0.01\n        return 0.99\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_4.value):\n                return 'roi_target_4'\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_3.value):\n                return 'roi_target_3'\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_2.value):\n                return 'roi_target_2'\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_1.value):\n                return 'roi_target_1'\n            elif (current_profit > 0) & (current_profit < self.sell_custom_roi_profit_5.value) & (last_candle['sma_200_dec']):\n                return 'roi_target_5'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value)):\n                return 'trail_target_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value)):\n                return 'trail_target_2'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_1h) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(\n            20)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (\n            dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(\n            window=30).mean()\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(\n            20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(\n                    1) * self.buy_bb20_volume.value))\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(16)) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (((dataframe['open'].rolling(24).min() - dataframe['close']) / dataframe['close']) > self.buy_min_inc.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h.value) &\n                (dataframe['rsi'] < self.buy_rsi.value) &\n                (dataframe['mfi'] < self.buy_mfi.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_1.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['rsi'] > self.sell_rsi_main.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHAndClucV8XHO/CombinedBinHAndClucV8XHO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.persistence import Trade\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n\n\n###########################################################################################################\n##                Based on CombinedBinHAndClucV8 by iterativ\n##                (Few improvements on this version by themoz)                                           ##\n##                                                                                                       ##\n##    Freqtrade https://github.com/freqtrade/freqtrade                                                   ##\n##    The authors of the original CombinedBinHAndCluc https://github.com/freqtrade/freqtrade-strategies  ##\n##    V8 by iterativ.                                                                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m) & sell_profit_only (must be true).                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1,\n                         np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHAndClucV8XHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_bb20_close_bblowerband\": 0.982,\n        \"buy_bb20_volume\": 35,\n        \"buy_bb40_bbdelta_close\": 0.037,\n        \"buy_bb40_closedelta_close\": 0.01,\n        \"buy_bb40_tail_bbdelta\": 0.338,\n        \"buy_mfi\": 44.88,\n        \"buy_min_inc\": 0.01,\n        \"buy_rsi\": 35.74,\n        \"buy_rsi_1h\": 66.97,\n        \"buy_rsi_diff\": 49.29,\n        \"buy_dip_threshold_0\": 0.015,  # value loaded from strategy\n        \"buy_dip_threshold_1\": 0.12,  # value loaded from strategy\n        \"buy_dip_threshold_2\": 0.28,  # value loaded from strategy\n        \"buy_dip_threshold_3\": 0.36,  # value loaded from strategy\n        \"buy_ema_open_mult_1\": 0.018,\n        \"buy_volume_1\": 2.65,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_custom_roi_profit_1\": 0.01,\n        \"sell_custom_roi_rsi_1\": 55.4,\n        \"sell_custom_stoploss_1\": -0.05,\n        \"sell_rsi_main\": 72.45,\n        \"sell_rsi_parachute\": 45.95,\n        \"sell_custom_roi_profit_2\": 0.04,  # value loaded from strategy\n        \"sell_custom_roi_profit_3\": 0.08,  # value loaded from strategy\n        \"sell_custom_roi_profit_4\": 0.14,  # value loaded from strategy\n        \"sell_custom_roi_profit_5\": 0.04,  # value loaded from strategy\n        \"sell_custom_roi_rsi_2\": 50,  # value loaded from strategy\n        \"sell_custom_roi_rsi_3\": 56,  # value loaded from strategy\n        \"sell_custom_roi_rsi_4\": 58,  # value loaded from strategy\n        \"sell_trail_down_1\": 0.03,  # value loaded from strategy\n        \"sell_trail_down_2\": 0.015,  # value loaded from strategy\n        \"sell_trail_profit_max_1\": 0.4,  # value loaded from strategy\n        \"sell_trail_profit_max_2\": 0.1,  # value loaded from strategy\n        \"sell_trail_profit_min_1\": 0.1,  # value loaded from strategy\n        \"sell_trail_profit_min_2\": 0.02,  # value loaded from strategy\n    }\n\n\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -0.99  # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'  # informative tf\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    # it doesn't meant anything, just to guarantee there is a minimal profit.\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Buy Hyperopt params\n\n    buy_dip_threshold_01_optimize=False\n    buy_dip_threshold_23_optimize=False\n    buy_dip_threshold_0 = DecimalParameter(0.001, 0.1, default=0.015, space='buy', decimals=3, optimize=buy_dip_threshold_01_optimize, load=True)\n    buy_dip_threshold_1 = DecimalParameter(0.08, 0.2, default=0.12, space='buy', decimals=2, optimize=buy_dip_threshold_01_optimize, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.02, 0.4, default=0.28, space='buy', decimals=2, optimize=buy_dip_threshold_23_optimize, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.25, 0.44, default=0.36, space='buy', decimals=2, optimize=buy_dip_threshold_23_optimize, load=True)\n\n    buy_bb40_optimize=False\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.04, default=0.031, space='buy', optimize=buy_bb40_optimize, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.021, space='buy', optimize=buy_bb40_optimize, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.2, 0.4, default=0.264, space='buy', optimize=buy_bb40_optimize, load=True)\n\n    buy_bb20_optimize=False\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.992, space='buy', optimize=buy_bb20_optimize, load=True)\n    buy_bb20_volume = IntParameter(18, 36, default=29, space='buy', optimize=buy_bb20_optimize, load=True)\n\n    buy_rsi_optimize=False\n    buy_rsi_diff = DecimalParameter(34.0, 60.0, default=50.48, space='buy', decimals=2, optimize=buy_rsi_optimize, load=True)\n    buy_rsi_1h = DecimalParameter(40.0, 70.0, default=67.0, space='buy', decimals=2, optimize=buy_rsi_optimize, load=True)\n    buy_rsi = DecimalParameter(30.0, 40.0, default=38.5, space='buy', decimals=2, optimize=buy_rsi_optimize, load=True)\n    \n    buy_min_mfi_optimize=False\n    buy_min_inc = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=2, optimize=buy_min_mfi_optimize, load=True)\n    buy_mfi = DecimalParameter(36.0, 65.0, default=36.0, space='buy', decimals=2, optimize=buy_min_mfi_optimize, load=True)\n\n    buy_1_optimize=False\n    buy_volume_1 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=2, optimize=buy_1_optimize, load=True)\n    buy_ema_open_mult_1 = DecimalParameter(0.01, 0.05, default=0.02, space='buy', decimals=3, optimize=buy_1_optimize, load=True)\n\n    # Sell Hyperopt params\n\n    sell_custom_roi_profit_1_optimize=False\n    sell_custom_roi_profit_2_optimize=False\n    sell_custom_roi_profit_3_optimize=False\n    sell_custom_roi_profit_4_optimize=False\n    sell_custom_roi_profit_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=2, optimize=sell_custom_roi_profit_1_optimize, load=True)\n    sell_custom_roi_rsi_1 = DecimalParameter(40.0, 56.0, default=50, space='sell', decimals=2, optimize=sell_custom_roi_profit_1_optimize, load=True)\n    sell_custom_roi_profit_2 = DecimalParameter(0.01, 0.20, default=0.04, space='sell', decimals=2, optimize=sell_custom_roi_profit_2_optimize, load=True)\n    sell_custom_roi_rsi_2 = DecimalParameter(42.0, 56.0, default=50, space='sell', decimals=2, optimize=sell_custom_roi_profit_2_optimize, load=True)\n    sell_custom_roi_profit_3 = DecimalParameter(0.15, 0.30, default=0.08, space='sell', decimals=2, optimize=sell_custom_roi_profit_3_optimize, load=True)\n    sell_custom_roi_rsi_3 = DecimalParameter(44.0, 58.0, default=56, space='sell', decimals=2, optimize=sell_custom_roi_profit_3_optimize, load=True)\n    sell_custom_roi_profit_4 = DecimalParameter(0.3, 0.7, default=0.14, space='sell', decimals=2, optimize=sell_custom_roi_profit_4_optimize, load=True)\n    sell_custom_roi_rsi_4 = DecimalParameter(44.0, 60.0, default=58, space='sell', decimals=2, optimize=sell_custom_roi_profit_4_optimize, load=True)\n\n    sell_custom_roi_profit_5 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_trail_1_optimize=False\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.1, space='sell', decimals=3, optimize=sell_trail_1_optimize, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=sell_trail_1_optimize, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.1, default=0.03, space='sell', decimals=3, optimize=sell_trail_1_optimize, load=True)\n\n    sell_trail_2_optimize=False\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=sell_trail_2_optimize, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.1, space='sell', decimals=2, optimize=sell_trail_2_optimize, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.015, space='sell', decimals=3, optimize=sell_trail_2_optimize, load=True)\n\n    sell_custom_stoploss_1 = DecimalParameter(-0.15, -0.03, default=-0.05, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_main = DecimalParameter(72.0, 90.0, default=80, space='sell', decimals=2, optimize=False, load=True)\n\n    #X version additional RSI value\n    sell_rsi_parachute = DecimalParameter(30.0, 55.0, default=40, space='sell', decimals=2, optimize=False, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        \n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        \n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=280) > trade.open_date_utc):\n            return 0.01\n        elif (current_profit < self.sell_custom_stoploss_1.value):\n            if (last_candle is not None):\n                if (last_candle['sma_200_dec']) & (last_candle['sma_200_dec_1h']):\n                    return 0.01\n        # X version:\n        # try eventually to catch a minimal pullback before it is too late\n        elif (0 >= current_profit >= self.sell_custom_stoploss_1.value):\n            if (last_candle is not None):\n                if ((last_candle['sma_200_dec']) &\n                    (last_candle['close'] > last_candle['bb_middleband']) &\n                    (last_candle['rsi'] > self.sell_rsi_parachute.value)):\n                    return 0.01\n        return 0.99\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_4.value):\n                return 'roi_target_4'\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_3.value):\n                return 'roi_target_3'\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_2.value):\n                return 'roi_target_2'\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (last_candle['rsi'] < self.sell_custom_roi_rsi_1.value):\n                return 'roi_target_1'\n            elif (current_profit > 0) & (current_profit < self.sell_custom_roi_profit_5.value) & (last_candle['sma_200_dec']):\n                return 'roi_target_5'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value)):\n                return 'trail_target_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value)):\n                return 'trail_target_2'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_1h) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(\n            20)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (\n            dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(\n            window=30).mean()\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(\n            20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(\n                    1) * self.buy_bb20_volume.value))\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(16)) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (((dataframe['open'].rolling(24).min() - dataframe['close']) / dataframe['close']) > self.buy_min_inc.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h.value) &\n                (dataframe['rsi'] < self.buy_rsi.value) &\n                (dataframe['mfi'] < self.buy_mfi.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_1.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['rsi'] > self.sell_rsi_main.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHClucAndMADV3/CombinedBinHClucAndMADV3.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair\n\n\n###########################################################################################################\n##                CombinedBinHClucAndMADV3 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##   With my pairlist which can be found in this repo.                                                   ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n\nclass CombinedBinHClucAndMADV3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.021,\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit < 0) & (current_time - timedelta(minutes=240) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n         # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * 0.031) &\n                dataframe['closedelta'].gt(dataframe['close'] * 0.018) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * 0.233) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (  # strategy ClucMay72018\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.985 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (  # strategy MACD Low buy\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHClucAndMADV5/CombinedBinHClucAndMADV5.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair\n\n\n###########################################################################################################\n##                CombinedBinHClucAndMADV5 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##   With my pairlist which can be found in this repo.                                                   ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass CombinedBinHClucAndMADV5(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.021,\n        \"40\": 0.005,\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit < 0) & (current_time - timedelta(minutes=240) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n         # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        dataframe.loc[\n\n               # When market at bull mode (guard)\n            (  # strategy ClucMay72018\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.99 * dataframe['bb_lowerband']) &                   # Guard is on, candle should dig not so hard (0,99)\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 21)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n               # When market at bear mode (without guard)\n            (  # strategy ClucMay72018 \n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.975 * dataframe['bb_lowerband']) &                  # Guard is off, candle should dig hard (0,975) \n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 20)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                 # Don't buy if someone drop the market.\n                (dataframe['rsi_1h'] < 15) &                                                # Buy only at dip\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |   \n               # When market at bull mode (guard)  \n            (  # strategy MACD Low buy \n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                 # Don't buy if someone drop the market.\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n               # When market at bear mode (without guard)    \n            (  # strategy MACD Low buy \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                 # Don't buy if someone drop the market.\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - 43.276) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHClucAndMADV6/CombinedBinHClucAndMADV6.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair\n\n\n###########################################################################################################\n##                CombinedBinHClucAndMADV6 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n##                What's new                                                                             ##\n##                                                                                                       ##\n##     + change ROI from 0-10 min to 2.9% (I feel lucky)                                                 ##\n##     + try to exclude pumping                                                                          ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##   With my pairlist which can be found in this repo.                                                   ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass CombinedBinHClucAndMADV6(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.029,          # I feel lucky!\n        \"10\": 0.021,\n        \"40\": 0.005,\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit < 0) & (current_time - timedelta(minutes=240) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        dataframe.loc[\n\n               # When market at bull mode (guard)\n            (  # strategy ClucMay72018\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.99 * dataframe['bb_lowerband']) &                           # Guard is on, candle should dig not so hard (0,99)\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * 0.4) &   # Try to exclude pumping\n                #(dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                        # Don't buy if someone drop the market.\n                (dataframe['volume'] > 0)\n            )\n            |\n               # When market at bear mode (without guard)\n            (  # strategy ClucMay72018 \n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.975 * dataframe['bb_lowerband']) &                          # Guard is off, candle should dig hard (0,975) \n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                         # Don't buy if someone drop the market.\n                (dataframe['rsi_1h'] < 15) &                                                        # Buy only at dip\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * 0.4) &   # Try to exclude pumping\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |   \n               # When market at bull mode (guard)  \n            (  # strategy MACD Low buy \n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                         # Don't buy if someone drop the market.\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(30) * 0.4) &   # Try to exclude pumping\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n               # When market at bear mode (without guard)    \n            (  # strategy MACD Low buy \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * 4)) &                 # Don't buy if someone drop the market.\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_slow'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - 43.276) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/CombinedBinHClucAndMADV9/CombinedBinHClucAndMADV9.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter\n\n\n###########################################################################################################\n##                CombinedBinHClucAndMADV9 by ilya                                                       ##\n##                                                                                                       ##\n##    https://github.com/i1ya/freqtrade-strategies                                                       ##\n##    The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6)                      ##\n##                                                                                                       ##                                                                                                       ##\n###########################################################################################################\n##     The main point of this strat is:                                                                  ##\n##        -  make drawdown as low as possible                                                            ##\n##        -  buy at dip                                                                                  ##\n##        -  sell quick as fast as you can (release money for the next buy)                              ##\n##        -  soft check if market if rising                                                              ##\n##        -  hard check is market if fallen                                                              ##\n##        -  10 buy signals                                                                              ##\n##        -  new stoploss function, preventing from big fall                                             ##\n##                                                                                                       ##\n###########################################################################################################\n##      How to use:                                                                                      ##\n##        - no need to HyperOpt                                                                          ##\n##        - before use it check the docs -                                                               ##\n##          https://www.freqtrade.io/en/stable/configuration/#market-order-pricing                       ##\n##                                                                                                       ##\n###########################################################################################################\n##                 GENERAL RECOMMENDATIONS                                                               ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 2 and 4 open trades, with unlimited stake.        ##\n##   With my pairlist which can be found in this repo.                                                   ##\n##                                                                                                       ##\n##   Ensure that you don't override any variables in your config.json. Especially                        ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n##   sell_profit_only:                                                                                   ##\n##       True - risk more (gives you higher profit and higher Drawdown)                                  ##\n##       False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown)             ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS 2 @iterativ (author of the original strategy)                                 ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\n\nclass CombinedBinHClucAndMADV9(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.028,  # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n    }\n\n    stoploss = -0.99  # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001  # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_0_enable\": False,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.99, space='buy', optimize=False, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False,\n                                                         load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # Are we still sinking?\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 5%\n                    return 0.01\n\n        return 0.99\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                    self.buy_condition_1_enable.value &\n\n                    (dataframe['close'] > dataframe['ema_200']) &\n                    (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                    (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n\n                    (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(\n                        30) * self.buy_volume_pump_1.value) &\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe[\n                        'bb_lowerband'].shift(2)) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_2_enable.value &\n\n                    (dataframe['close'] > dataframe['ema_200']) &\n\n                    (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                    (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(\n                        30) * self.buy_volume_pump_1.value) &\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe[\n                        'bb_lowerband'].shift(2)) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_3_enable.value &\n\n                    (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                    (dataframe['close'] < dataframe['bb_lowerband']) &\n                    (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_4_enable.value &\n\n                    (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                    (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_5_enable.value &\n\n                    (dataframe['close'] > dataframe['ema_200']) &\n                    (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                    (dataframe['ema_26'] > dataframe['ema_12']) &\n                    ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                    ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                    (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(\n                        30) * self.buy_volume_pump_1.value) &\n                    (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            )\n            |\n            (\n                    self.buy_condition_6_enable.value &\n\n                    (dataframe['ema_26'] > dataframe['ema_12']) &\n                    ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                    ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                    (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_7_enable.value &\n\n                    (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n\n                    (dataframe['ema_26'] > dataframe['ema_12']) &\n                    ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                    ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(\n                        30) * self.buy_volume_pump_1.value) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_8_enable.value &\n\n                    (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                    (dataframe['rsi'] < self.buy_rsi_1.value) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(\n                        30) * self.buy_volume_pump_1.value) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_9_enable.value &\n\n                    (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                    (dataframe['rsi'] < self.buy_rsi_2.value) &\n\n                    (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                    (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(\n                        30) * self.buy_volume_pump_1.value) &\n                    (dataframe['volume'] > 0)\n            )\n            |\n            (\n                    self.buy_condition_10_enable.value &\n\n                    (dataframe['close'] < dataframe['sma_5']) &\n                    (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                    (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                    (dataframe['rsi'] < dataframe['rsi_1h'] - 43.276) &\n                    (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &  # Don't be gready, sell fast\n                    (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe"
  },
  {
    "path": "strategies/Combined_Indicators/Combined_Indicators.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\n# --------------------------------\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\nclass Combined_Indicators(IStrategy):\n    # Based on a backtesting:\n    # - the best perfomance is reached with \"max_open_trades\" = 2 (in average for any market),\n    #   so it is better to increase \"stake_amount\" value rather then \"max_open_trades\" to get more profit\n    # - if the market is constantly green(like in JAN 2018) the best performance is reached with\n    #   \"max_open_trades\" = 2 and minimal_roi = 0.01\n      # ROI table:\n    # ROI table:\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.015\n    }\n\n    # Stoploss:\n    stoploss = -0.0658\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.0198\n    trailing_stop_positive_offset = 0.03082\n    trailing_only_offset_is_reached = True\n\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (  # strategy BinHV45\n                    dataframe['lower'].shift().gt(0) &\n                    dataframe['bbdelta'].gt(dataframe['close'] * 0.00703) &\n                    dataframe['closedelta'].gt(dataframe['close'] * 0.01476) &\n                    dataframe['tail'].lt(dataframe['bbdelta'] * 0.03632) &\n                    dataframe['close'].lt(dataframe['lower'].shift()) &\n                    dataframe['close'].le(dataframe['close'].shift())\n            ) |\n            (  # strategy ClucMay72018\n                    (dataframe['close'] < dataframe['ema_slow']) &\n                    (dataframe['close'] < 0.98863 * dataframe['bb_lowerband']) &\n                    (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 34))\n            ),\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n        dataframe.loc[\n            (dataframe['close'] > dataframe['bb_middleband']),\n            'sell'\n        ] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/Combined_NFIv6_SMA/Combined_NFIv6_SMA.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV6 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass Combined_NFIv6_SMA(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.035\n\n    use_custom_stoploss = True\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": False, #False\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": False, #False\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.965, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n\n        hmao = qtpylib.hull_moving_average(informative_1h['close'], window=14)\n        \n        informative_1h['hma_fast']=hmao\n        hmah = qtpylib.hull_moving_average(informative_1h['close'], window=24)\n        informative_1h['hma_slow']=hmah\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n            \n        def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n            if current_profit < -0.05 and current_time - timedelta(minutes=300) > trade.open_date_utc:\n                return -0.01\n\n            return -0.99\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n            \n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['lower'].shift().gt(0))\n        buy_03_logic.append(dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['lower'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_normal_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_loose_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_24_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/Combined_NFIv7_SMA/Combined_NFIv7_SMA.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass Combined_NFIv7_SMA(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n        \n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        \n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/Combined_NFIv7_SMA_Rallipanos_20210707/Combined_NFIv7_SMA_Rallipanos_20210707.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass Combined_NFIv7_SMA_Rallipanos_20210707(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n        \n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        \n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/Combined_NFIv7_SMA_bAdBoY_20211204/Combined_NFIv7_SMA_bAdBoY_20211204.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass Combined_NFIv7_SMA_bAdBoY_20211204(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n        \n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        \n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/CoreStrategy/CoreStrategy.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import (\n    merge_informative_pair,\n    CategoricalParameter,\n    DecimalParameter,\n    IntParameter,\n    stoploss_from_open,\n)\nfrom functools import reduce\nimport logging\n# -------------------------------------------------------------------------------------------------\n# --- logger for parameter merging output, only remove if you remove it further down too! ---------\nlogger = logging.getLogger(__name__)\n# -------------------------------------------------------------------------------------------------\n\n\nclass CoreStrategy(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018, }\n    # minimal_roi = {\"0\": 0.038, \"20\": 0.028, \"40\": 0.02, \"60\": 0.015, \"180\": 0.018, }\n    minimal_roi = {\"0\": 0.20, \"38\": 0.074, \"78\": 0.025, \"194\": 0}\n    stoploss = -0.228  # effectively disabled.\n\n    timeframe = \"5m\"\n    informative_timeframe = \"1h\"\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.049\n\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        #############\n        # Enable/Disable conditions\n        \"smaoffset_buy_condition_0_enable\": True,\n        \"smaoffset_buy_condition_1_enable\": True,\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": False,\n        \"v9_buy_condition_2_enable\": False,\n        \"v9_buy_condition_3_enable\": False,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": False,\n        \"v9_buy_condition_6_enable\": False,\n        \"v9_buy_condition_7_enable\": False,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n    }\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"v9_sell_condition_0_enable\": False,\n        \"v8_sell_condition_0_enable\": True,\n        \"v8_sell_condition_1_enable\": True,\n        \"smaoffset_sell_condition_0_enable\": False,\n    }\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # if you want to see which buy conditions were met\n    # or if there is an trade exit override due to high RSI set to True\n    # logger will output the buy and trade exit conditions\n    cust_log_verbose = False\n\n    ############################################################################\n    # Buy SMAOffsetProtectOpt\n\n    smaoffset_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    smaoffset_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    smaoffset_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n    # hyperopt parameters for SMAOffsetProtectOpt\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, space=\"buy\", optimize=False, load=True\n    )\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=24, space=\"sell\", optimize=False, load=True\n    )\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=0.975, space=\"buy\", optimize=True, load=True\n    )\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=1.012, space=\"sell\", optimize=True, load=True\n    )\n    # Protection\n    fast_ewo = IntParameter(10, 50, default=50, space=\"buy\", optimize=False, load=True)\n    slow_ewo = IntParameter(\n        100, 200, default=200, space=\"buy\", optimize=False, load=True\n    )\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-19.881, space=\"buy\", optimize=True, load=True\n    )\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=5.499, space=\"buy\", optimize=True, load=True\n    )\n    rsi_buy = IntParameter(30, 70, default=50, space=\"buy\", optimize=True, load=True)\n    # Buy CombinedBinHClucAndMADV6\n\n    v6_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v6_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    # Buy CombinedBinHClucV8\n    v8_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n    v8_buy_condition_4_enable = CategoricalParameter(\n        [True, False], default=True, space=\"buy\", optimize=False, load=True\n    )\n\n    v8_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n    v8_sell_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space=\"sell\", optimize=False, load=True\n    )\n\n    v8_sell_rsi_main = DecimalParameter(\n        72.0, 90.0, default=80, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_0 = DecimalParameter(\n        0.001, 0.1, default=0.015, space=\"buy\", decimals=3, optimize=False, load=True\n    )\n    buy_dip_threshold_1 = DecimalParameter(\n        0.08, 0.2, default=0.12, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_2 = DecimalParameter(\n        0.02, 0.4, default=0.28, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_dip_threshold_3 = DecimalParameter(\n        0.25, 0.44, default=0.36, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_bb40_bbdelta_close = DecimalParameter(\n        0.005, 0.04, default=0.031, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb40_closedelta_close = DecimalParameter(\n        0.01, 0.03, default=0.021, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb40_tail_bbdelta = DecimalParameter(\n        0.2, 0.4, default=0.264, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_close_bblowerband = DecimalParameter(\n        0.8, 1.1, default=0.992, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_volume = IntParameter(\n        18, 36, default=29, space=\"buy\", optimize=False, load=True\n    )\n    buy_rsi_diff = DecimalParameter(\n        34.0, 60.0, default=50.48, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_min_inc = DecimalParameter(\n        0.005, 0.05, default=0.01, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_rsi_1h = DecimalParameter(\n        40.0, 70.0, default=67.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_rsi = DecimalParameter(\n        30.0, 40.0, default=38.5, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_mfi = DecimalParameter(\n        36.0, 65.0, default=36.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_volume_1 = DecimalParameter(\n        1.0, 10.0, default=2.0, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_ema_open_mult_1 = DecimalParameter(\n        0.01, 0.05, default=0.02, space=\"buy\", decimals=3, optimize=False, load=True\n    )\n    sell_custom_roi_profit_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_1 = DecimalParameter(\n        40.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_profit_2 = DecimalParameter(\n        0.01, 0.20, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_2 = DecimalParameter(\n        42.0, 56.0, default=50, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_profit_3 = DecimalParameter(\n        0.15, 0.30, default=0.08, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_3 = DecimalParameter(\n        44.0, 58.0, default=56, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_profit_4 = DecimalParameter(\n        0.3, 0.7, default=0.14, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_custom_roi_rsi_4 = DecimalParameter(\n        44.0, 60.0, default=58, space=\"sell\", decimals=2, optimize=False, load=True\n    )\n    sell_custom_roi_profit_5 = DecimalParameter(\n        0.01, 0.1, default=0.04, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_profit_min_1 = DecimalParameter(\n        0.1, 0.25, default=0.1, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_max_1 = DecimalParameter(\n        0.3, 0.5, default=0.4, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_down_1 = DecimalParameter(\n        0.04, 0.1, default=0.03, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_min_2 = DecimalParameter(\n        0.01, 0.1, default=0.02, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_trail_profit_max_2 = DecimalParameter(\n        0.08, 0.25, default=0.1, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    sell_trail_down_2 = DecimalParameter(\n        0.04, 0.2, default=0.015, space=\"sell\", decimals=3, optimize=True, load=True\n    )\n    sell_custom_stoploss_1 = DecimalParameter(\n        -0.15, -0.03, default=-0.05, space=\"sell\", decimals=2, optimize=True, load=True\n    )\n    # Buy  CombinedBinHClucAndMADV9\n    v9_buy_condition_0_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_1_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_2_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_3_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_4_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_5_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_6_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_7_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_8_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_9_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n    v9_buy_condition_10_enable = CategoricalParameter(\n        [True, False], default=False, space=\"buy\", optimize=False, load=True\n    )\n\n    # Sell\n    v9_sell_condition_0_enable = CategoricalParameter(\n        [True, False], default=False, space=\"sell\", optimize=False, load=True\n    )\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(\n        0.7, 1.1, default=0.99, space=\"buy\", optimize=False, load=True\n    )\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(\n        0.7, 1.1, default=0.982, space=\"buy\", optimize=False, load=True\n    )\n    buy_volume_pump_1 = DecimalParameter(\n        0.1, 0.9, default=0.4, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_volume_drop_1 = DecimalParameter(\n        1, 10, default=4, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_1 = DecimalParameter(\n        10.0, 40.0, default=16.5, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_2 = DecimalParameter(\n        10.0, 40.0, default=15.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_3 = DecimalParameter(\n        10.0, 40.0, default=20.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1h_4 = DecimalParameter(\n        10.0, 40.0, default=35.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_1 = DecimalParameter(\n        10.0, 40.0, default=28.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_2 = DecimalParameter(\n        7.0, 40.0, default=10.0, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_rsi_3 = DecimalParameter(\n        7.0, 40.0, default=14.2, space=\"buy\", decimals=1, optimize=False, load=True\n    )\n    buy_macd_1 = DecimalParameter(\n        0.01, 0.09, default=0.02, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    buy_macd_2 = DecimalParameter(\n        0.01, 0.09, default=0.03, space=\"buy\", decimals=2, optimize=False, load=True\n    )\n    # minimum conditions to match in buy\n    buy_minimum_conditions = IntParameter(\n        1, 2, default=1, space=\"buy\", optimize=False, load=True\n    )\n\n    def custom_stoploss(\n        self, pair: str, trade: \"Trade\", current_time: datetime, current_rate: float, current_profit: float, **kwargs\n    ) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if current_profit > 0:\n            return 0.99\n        else:\n            trade_time_50 = trade.open_date_utc + timedelta(minutes=240)\n            # trade_time_240 = trade.open_date_utc + timedelta(minutes=240)\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if current_time > trade_time_50:\n\n                try:\n                    number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n                    if (candle[\"sma_200_dec\"]) & (candle[\"sma_200_dec_1h\"]):\n                        return 0.01\n                    # We are at bottom. Wait...\n                    if candle[\"rsi_1h\"] < 30:\n                        return 0.99\n\n                    # Are we still sinking?\n                    if candle[\"close\"] > candle[\"ema_200\"]:\n                        if current_rate * 1.025 < candle[\"open\"]:\n                            return 0.01\n\n                    if current_rate * 1.015 < candle[\"open\"]:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.1\n\n        return 0.99\n\n\n\n    def custom_sell(\n        self,\n        pair: str,\n        trade: \"Trade\",\n        current_time: \"datetime\",\n        current_rate: float,\n        current_profit: float,\n        **kwargs,\n    ):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if last_candle is not None:\n            if (current_profit > self.sell_custom_roi_profit_4.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_4.value\n            ):\n                return \"roi_target_4\"\n            elif (current_profit > self.sell_custom_roi_profit_3.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_3.value\n            ):\n                return \"roi_target_3\"\n            elif (current_profit > self.sell_custom_roi_profit_2.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_2.value\n            ):\n                return \"roi_target_2\"\n            elif (current_profit > self.sell_custom_roi_profit_1.value) & (\n                last_candle[\"rsi\"] < self.sell_custom_roi_rsi_1.value\n            ):\n                return \"roi_target_1\"\n            elif (\n                (current_profit > 0)\n                & (current_profit < self.sell_custom_roi_profit_5.value)\n                & (last_candle[\"sma_200_dec\"])\n            ):\n                return \"roi_target_5\"\n\n            elif (\n                (current_profit > self.sell_trail_profit_min_1.value)\n                & (current_profit < self.sell_trail_profit_max_1.value)\n                & (\n                    ((trade.max_rate - trade.open_rate) / 100)\n                    > (current_profit + self.sell_trail_down_1.value)\n                )\n            ):\n                return \"trail_target_1\"\n            elif (\n                (current_profit > self.sell_trail_profit_min_2.value)\n                & (current_profit < self.sell_trail_profit_max_2.value)\n                & (\n                    ((trade.max_rate - trade.open_rate) / 100)\n                    > (current_profit + self.sell_trail_down_2.value)\n                )\n            ):\n                return \"trail_target_2\"\n        # Sell any positions at a loss if they are held for more than one day.\n        # if current_profit < 0.0 and (current_time - trade.open_date_utc).days >= 2:\n        #     return 'unclog'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(\n        self, dataframe: DataFrame, metadata: dict\n    ) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(\n            pair=metadata[\"pair\"], timeframe=self.informative_timeframe\n        )\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h[\"ema_100\"] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h[\"ema_200\"] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h[\"sma_200\"] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h[\"sma_200_dec\"] = informative_1h[\"sma_200\"] < informative_1h[\n            \"sma_200\"\n        ].shift(20)\n        # RSI\n        informative_1h[\"rsi\"] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h[\"ssl_down\"] = ssl_down_1h\n        informative_1h[\"ssl_up\"] = ssl_up_1h\n        informative_1h[\"ssl-dir\"] = np.where(ssl_up_1h > ssl_down_1h, \"up\", \"down\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe[\"close\"], window=40, stds=2)\n        dataframe[\"lower\"] = bb_40[\"lower\"]\n        dataframe[\"mid\"] = bb_40[\"mid\"]\n        dataframe[\"bbdelta\"] = (bb_40[\"mid\"] - dataframe[\"lower\"]).abs()\n        dataframe[\"closedelta\"] = (\n            dataframe[\"close\"] - dataframe[\"close\"].shift()\n        ).abs()\n        dataframe[\"tail\"] = (dataframe[\"close\"] - dataframe[\"low\"]).abs()\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n\n        dataframe[\"volume_mean_slow\"] = dataframe[\"volume\"].rolling(window=30).mean()\n\n        # EMA\n        dataframe[\"ema_12\"] = ta.EMA(dataframe, timeperiod=12)\n        dataframe[\"ema_26\"] = ta.EMA(dataframe, timeperiod=26)\n        dataframe[\"ema_50\"] = ta.EMA(dataframe, timeperiod=50)\n        dataframe[\"ema_200\"] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe[\"sma_5\"] = ta.EMA(dataframe, timeperiod=5)\n        dataframe[\"sma_200\"] = ta.SMA(dataframe, timeperiod=200)\n        dataframe[\"sma_200_dec\"] = dataframe[\"sma_200\"] < dataframe[\"sma_200\"].shift(20)\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n        # MFI\n        dataframe[\"mfi\"] = ta.MFI(dataframe, timeperiod=14)\n        # ------ ATR stuff\n        dataframe[\"atr\"] = ta.ATR(dataframe, timeperiod=14)\n\n        # ------ SMAOffsetProtectOpt\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f\"ma_buy_{val}\"] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f\"ma_sell_{val}\"] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe[\"EWO\"] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe,\n            informative,\n            self.timeframe,\n            self.informative_timeframe,\n            ffill=True,\n        )\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # reset additional dataframe rows\n        dataframe.loc[:, \"v9_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_5_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_6_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_7_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_8_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_9_enable\"] = False\n        dataframe.loc[:, \"v9_buy_condition_10_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v6_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_2_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_3_enable\"] = False\n        dataframe.loc[:, \"v8_buy_condition_4_enable\"] = False\n        dataframe.loc[:, \"smaoffset_buy_condition_0_enable\"] = False\n        dataframe.loc[:, \"smaoffset_buy_condition_1_enable\"] = False\n        dataframe.loc[:, \"conditions_count\"] = 0\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        dataframe[\"ma_buy\"] = (\n            dataframe[f\"ma_buy_{self.base_nb_candles_buy.value}\"]\n            * self.low_offset.value\n        )\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ma_buy\"])\n                & (dataframe[\"EWO\"] > self.ewo_high.value)\n                & (dataframe[\"rsi\"] < self.rsi_buy.value)\n                & (self.smaoffset_buy_condition_0_enable.value == True)\n            ),\n            ['smaoffset_buy_condition_0_enable', 'buy_tag']] = (1, 'buy_signal_smaoffset_0')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ma_buy\"])\n                & (dataframe[\"EWO\"] < self.ewo_low.value)\n                & (self.smaoffset_buy_condition_1_enable.value == True)\n            ),\n            ['smaoffset_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_smaoffset_1')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & dataframe[\"lower\"].shift().gt(0)\n                & dataframe[\"bbdelta\"].gt(\n                    dataframe[\"close\"] * self.buy_bb40_bbdelta_close.value\n                )\n                & dataframe[\"closedelta\"].gt(\n                    dataframe[\"close\"] * self.buy_bb40_closedelta_close.value\n                )\n                & dataframe[\"tail\"].lt(\n                    dataframe[\"bbdelta\"] * self.buy_bb40_tail_bbdelta.value\n                )\n                & dataframe[\"close\"].lt(dataframe[\"lower\"].shift())\n                & dataframe[\"close\"].le(dataframe[\"close\"].shift())\n                & (self.v8_buy_condition_0_enable.value == True)\n            ),\n            ['v8_buy_condition_0_enable', 'buy_tag']] = (1, 'buy_signal_v8_0')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (\n                    dataframe[\"close\"]\n                    < self.buy_bb20_close_bblowerband.value * dataframe[\"bb_lowerband\"]\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (\n                        dataframe[\"volume_mean_slow\"].shift(1)\n                        * self.buy_bb20_volume.value\n                    )\n                )\n                & (self.v8_buy_condition_1_enable.value == True)\n            ),\n            ['v8_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_v8_1')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - self.buy_rsi_diff.value)\n                & (self.v8_buy_condition_2_enable.value == True)\n            ),\n            ['v8_buy_condition_2_enable', 'buy_tag']] = (1, 'buy_signal_v8_2')\n\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"sma_200\"] > dataframe[\"sma_200\"].shift(20))\n                & (dataframe[\"sma_200_1h\"] > dataframe[\"sma_200_1h\"].shift(16))\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(24).min() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    > self.buy_min_inc.value\n                )\n                & (dataframe[\"rsi_1h\"] > self.buy_rsi_1h.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi.value)\n                & (dataframe[\"mfi\"] < self.buy_mfi.value)\n                & (self.v8_buy_condition_3_enable.value == True)\n            ),\n            ['v8_buy_condition_3_enable', 'buy_tag']] = (1, 'buy_signal_v8_3')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_100_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_100_1h\"])\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(2).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_1.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(12).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_2.value\n                )\n                & (\n                    (\n                        (dataframe[\"open\"].rolling(144).max() - dataframe[\"close\"])\n                        / dataframe[\"close\"]\n                    )\n                    < self.buy_dip_threshold_3.value\n                )\n                & (\n                    dataframe[\"volume\"].rolling(4).mean() * self.buy_volume_1.value\n                    > dataframe[\"volume\"]\n                )\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_ema_open_mult_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v8_buy_condition_4_enable.value == True)\n            ),\n            ['v8_buy_condition_4_enable', 'buy_tag']] = (1, 'buy_signal_v8_4')\n\n        # start from here\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (\n                    dataframe[\"close\"]\n                    < dataframe[\"bb_lowerband\"]\n                    * self.buy_bb20_close_bblowerband_safe_1.value\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"open\"] - dataframe[\"close\"]\n                    < dataframe[\"bb_upperband\"].shift(2)\n                    - dataframe[\"bb_lowerband\"].shift(2)\n                )\n                & (self.v9_buy_condition_1_enable.value == True)\n            ),\n            ['v9_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_v9_1')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (\n                    dataframe[\"close\"]\n                    < dataframe[\"bb_lowerband\"]\n                    * self.buy_bb20_close_bblowerband_safe_2.value\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"open\"] - dataframe[\"close\"]\n                    < dataframe[\"bb_upperband\"].shift(2)\n                    - dataframe[\"bb_lowerband\"].shift(2)\n                )\n                & (self.v9_buy_condition_2_enable.value == True)\n            ),\n            ['v9_buy_condition_2_enable', 'buy_tag']] = (1, 'buy_signal_v9_2')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                & (dataframe[\"rsi\"] < self.buy_rsi_3.value)\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (self.v9_buy_condition_3_enable.value == True)\n            ),\n            ['v9_buy_condition_3_enable', 'buy_tag']] = (1, 'buy_signal_v9_3')\n\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_1.value)\n                & (dataframe[\"close\"] < dataframe[\"bb_lowerband\"])\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (self.v9_buy_condition_4_enable.value == True)\n            ),\n            ['v9_buy_condition_4_enable', 'buy_tag']] = (1, 'buy_signal_v9_4')\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_macd_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_5_enable.value == True)\n            ),\n            ['v9_buy_condition_5_enable', 'buy_tag']] = (1, 'buy_signal_v9_5')\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_macd_2.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (self.v9_buy_condition_6_enable.value == True)\n            ),\n            ['v9_buy_condition_6_enable', 'buy_tag']] = (1, 'buy_signal_v9_6')\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_2.value)\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * self.buy_macd_1.value)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_7_enable.value == True)\n            ),\n            ['v9_buy_condition_7_enable', 'buy_tag']] = (1, 'buy_signal_v9_7')\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_3.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi_1.value)\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_8_enable.value == True)\n            ),\n            ['v9_buy_condition_8_enable', 'buy_tag']] = (1, 'buy_signal_v9_8')\n        dataframe.loc[\n            (\n                (dataframe[\"rsi_1h\"] < self.buy_rsi_1h_4.value)\n                & (dataframe[\"rsi\"] < self.buy_rsi_2.value)\n                & (\n                    dataframe[\"volume\"]\n                    < (dataframe[\"volume\"].shift() * self.buy_volume_drop_1.value)\n                )\n                & (\n                    dataframe[\"volume_mean_slow\"]\n                    > dataframe[\"volume_mean_slow\"].shift(30)\n                    * self.buy_volume_pump_1.value\n                )\n                & (self.v9_buy_condition_9_enable.value == True)\n            ),\n            ['v9_buy_condition_9_enable', 'buy_tag']] = (1, 'buy_signal_v9_9')\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"sma_5\"])\n                & (dataframe[\"ssl_up_1h\"] > dataframe[\"ssl_down_1h\"])\n                & (dataframe[\"ema_50_1h\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"rsi\"] < dataframe[\"rsi_1h\"] - 43.276)\n                & (self.v9_buy_condition_10_enable.value == True)\n            ),\n            ['v9_buy_condition_10_enable', 'buy_tag']] = (1, 'buy_signal_v9_10')\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.99 * dataframe[\"bb_lowerband\"])\n                & (\n                    (\n                        dataframe[\"volume\"]\n                        < (dataframe[\"volume_mean_slow\"].shift(1) * 21)\n                    )\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > (dataframe[\"volume_mean_slow\"].shift(30) * 0.4)\n                    )\n                )\n                & (self.v6_buy_condition_0_enable.value == True)\n            ),\n            ['v6_buy_condition_0_enable', 'buy_tag']] = (1, 'buy_signal_v6_0')\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] < dataframe[\"ema_50\"])\n                & (dataframe[\"close\"] < 0.975 * dataframe[\"bb_lowerband\"])\n                & (\n                    (\n                        dataframe[\"volume\"]\n                        < (dataframe[\"volume_mean_slow\"].shift(1) * 20)\n                    )\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                )\n                & (dataframe[\"rsi_1h\"] < 15)  # Don't buy if someone drop the market.\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (self.v6_buy_condition_1_enable.value == True)\n            ),\n            ['v6_buy_condition_1_enable', 'buy_tag']] = (1, 'buy_signal_v6_1')\n\n\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"ema_200\"])\n                & (dataframe[\"close\"] > dataframe[\"ema_200_1h\"])\n                & (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * 0.02)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (\n                    (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                    | (\n                        dataframe[\"volume_mean_slow\"]\n                        > dataframe[\"volume_mean_slow\"].shift(30) * 0.4\n                    )\n                )\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_2_enable.value == True)\n            ),\n            ['v6_buy_condition_2_enable', 'buy_tag']] = (1, 'buy_signal_v6_2')\n\n        dataframe.loc[\n            (\n                (dataframe[\"ema_26\"] > dataframe[\"ema_12\"])\n                & (\n                    (dataframe[\"ema_26\"] - dataframe[\"ema_12\"])\n                    > (dataframe[\"open\"] * 0.03)\n                )\n                & (\n                    (dataframe[\"ema_26\"].shift() - dataframe[\"ema_12\"].shift())\n                    > (dataframe[\"open\"] / 100)\n                )\n                & (dataframe[\"volume\"] < (dataframe[\"volume\"].shift() * 4))\n                & (dataframe[\"close\"] < (dataframe[\"bb_lowerband\"]))\n                & (self.v6_buy_condition_3_enable.value == True)\n            ),\n            ['v6_buy_condition_3_enable', 'buy_tag']] = (1, 'buy_signal_v6_3')\n\n\n        # count the amount of conditions met\n        dataframe.loc[:, \"conditions_count\"] = (\n            dataframe[\"v9_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_4_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_5_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_6_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_7_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_8_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_9_enable\"].astype(int)\n            + dataframe[\"v9_buy_condition_10_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v6_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_1_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_2_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_3_enable\"].astype(int)\n            + dataframe[\"v8_buy_condition_4_enable\"].astype(int)\n            + dataframe[\"smaoffset_buy_condition_0_enable\"].astype(int)\n            + dataframe[\"smaoffset_buy_condition_1_enable\"].astype(int)\n        )\n\n        # append the minimum amount of conditions to be met\n        conditions.append(\n            dataframe[\"conditions_count\"] >= self.buy_minimum_conditions.value\n        )\n        conditions.append(dataframe[\"volume\"].gt(0))\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"buy\"] = 1\n\n        # verbose logging enable only for verbose information or troubleshooting\n        if self.cust_log_verbose == True:\n            for index, row in dataframe.iterrows():\n                if row[\"buy\"] == 1:\n                    buy_cond_details = f\"count={int(row['conditions_count'])}/v9_1={int(row['v9_buy_condition_1_enable'])}/v9_2={int(row['v9_buy_condition_2_enable'])}/v9_3={int(row['v9_buy_condition_3_enable'])}/v9_4={int(row['v9_buy_condition_4_enable'])}/v9_5={int(row['v9_buy_condition_5_enable'])}/v9_6={int(row['v9_buy_condition_6_enable'])}/v9_7={int(row['v9_buy_condition_7_enable'])}/v9_8={int(row['v9_buy_condition_8_enable'])}/v9_9={int(row['v9_buy_condition_9_enable'])}/v9_10={int(row['v9_buy_condition_10_enable'])}/v6_0={int(row['v6_buy_condition_0_enable'])}/v6_1={int(row['v6_buy_condition_1_enable'])}/v6_2={int(row['v6_buy_condition_2_enable'])}/v6_3={int(row['v6_buy_condition_3_enable'])}/v8_0={int(row['v8_buy_condition_0_enable'])}/v8_1={int(row['v8_buy_condition_1_enable'])}/v8_2={int(row['v8_buy_condition_2_enable'])}/v8_3={int(row['v8_buy_condition_3_enable'])}/v8_4={int(row['v8_buy_condition_4_enable'])}/sma_0={int(row['smaoffset_buy_condition_0_enable'])}/sma_1={int(row['smaoffset_buy_condition_1_enable'])}\"\n\n                    logger.info(\n                        f\"{metadata['pair']} - candle: {row['date']} - buy condition - details: {buy_cond_details}\"\n                    )\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe[\"ma_sell\"] = (\n            dataframe[f\"ma_sell_{self.base_nb_candles_sell.value}\"]\n            * self.high_offset.value\n        )\n        if self.smaoffset_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (qtpylib.crossed_below(dataframe[\"close\"], dataframe[\"ma_sell\"]))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v9_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_middleband\"] * 1.01)\n                    & (\n                        dataframe[\"volume\"] > 0\n                    )  # Don't be gready, sell fast  # Make sure Volume is not 0\n                )\n            )\n\n        if self.v8_sell_condition_0_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"close\"] > dataframe[\"bb_upperband\"])\n                    & (dataframe[\"close\"].shift(1) > dataframe[\"bb_upperband\"].shift(1))\n                    & (dataframe[\"close\"].shift(2) > dataframe[\"bb_upperband\"].shift(2))\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n        if self.v8_sell_condition_1_enable.value:\n            conditions.append(\n                (\n                    (dataframe[\"rsi_1h\"] > self.v8_sell_rsi_main.value)\n                    & (dataframe[\"volume\"] > 0)\n                )\n            )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n\n        return dataframe\n\n\n# --- custom indicators ---------------------------------------------------------------------------\n\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(\n        df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN)\n    )\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    df = dataframe.copy()\n    df[\"ATR\"] = ta.ATR(df, timeperiod=14)\n    df[\"smaHigh\"] = df[\"high\"].rolling(length).mean() + df[\"ATR\"]\n    df[\"smaLow\"] = df[\"low\"].rolling(length).mean() - df[\"ATR\"]\n    df[\"hlv\"] = np.where(\n        df[\"close\"] > df[\"smaHigh\"], 1, np.where(df[\"close\"] < df[\"smaLow\"], -1, np.NAN)\n    )\n    df[\"hlv\"] = df[\"hlv\"].ffill()\n    df[\"sslDown\"] = np.where(df[\"hlv\"] < 0, df[\"smaHigh\"], df[\"smaLow\"])\n    df[\"sslUp\"] = np.where(df[\"hlv\"] < 0, df[\"smaLow\"], df[\"smaHigh\"])\n    return df[\"sslDown\"], df[\"sslUp\"]\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df[\"close\"] * 100\n    return emadif\n\n\nclass BinClucMadv1(CoreStrategy):\n    INTERFACE_VERSION = 2\n\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        \"smaoffset_buy_condition_0_enable\": False,\n        \"smaoffset_buy_condition_1_enable\": False,\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": True,\n        \"v9_buy_condition_2_enable\": True,\n        \"v9_buy_condition_3_enable\": True,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": True,\n        \"v9_buy_condition_6_enable\": True,\n        \"v9_buy_condition_7_enable\": True,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n\n    }\n\n\nclass BinClucMadv2(CoreStrategy):\n    INTERFACE_VERSION = 2\n\n    stoploss = -0.99\n\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        \"smaoffset_buy_condition_0_enable\": False,\n        \"smaoffset_buy_condition_1_enable\": False,\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": False,\n        \"v9_buy_condition_2_enable\": False,\n        \"v9_buy_condition_3_enable\": False,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": False,\n        \"v9_buy_condition_6_enable\": False,\n        \"v9_buy_condition_7_enable\": False,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n\n    }\n\n\n\nclass BinClucMadSMAv1(CoreStrategy):\n\n    INTERFACE_VERSION = 2\n\n\n    stoploss = -0.228  # effectively disabled.\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n        \"smaoffset_buy_condition_0_enable\": True,\n        \"smaoffset_buy_condition_1_enable\": True,\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": False,\n        \"v9_buy_condition_2_enable\": False,\n        \"v9_buy_condition_3_enable\": False,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": False,\n        \"v9_buy_condition_6_enable\": False,\n        \"v9_buy_condition_7_enable\": False,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n\n\n    }\n\n\n\n\nclass BinClucMadSMAv2(CoreStrategy):\n\n    INTERFACE_VERSION = 2\n\n    stoploss = -0.228  # effectively disabled.\n    # Custom stoploss\n    use_custom_stoploss = False\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    buy_params = {\n        \"buy_minimum_conditions\": 1,\n\n        \"smaoffset_buy_condition_0_enable\": True,\n        \"smaoffset_buy_condition_1_enable\": True,\n        \"v6_buy_condition_0_enable\": False, # avg 0.47 dd 27%\n        \"v6_buy_condition_1_enable\": True, # no trade\n        \"v6_buy_condition_2_enable\": True,  # avg 2.32\n        \"v6_buy_condition_3_enable\": True, # avg 1.12 dd 6%\n        \"v8_buy_condition_0_enable\": True, # avg 0.74\n        \"v8_buy_condition_1_enable\": False,  # avg 0.41 dd 37%\n        \"v8_buy_condition_2_enable\": True,   # avg 1.37\n        \"v8_buy_condition_3_enable\": False,  # avg 0.41\n        \"v8_buy_condition_4_enable\": True,   # avg 1.29\n        \"v9_buy_condition_0_enable\": False,\n        \"v9_buy_condition_1_enable\": True,\n        \"v9_buy_condition_2_enable\": True,\n        \"v9_buy_condition_3_enable\": True,\n        \"v9_buy_condition_4_enable\": False,\n        \"v9_buy_condition_5_enable\": True,\n        \"v9_buy_condition_6_enable\": True,\n        \"v9_buy_condition_7_enable\": True,\n        \"v9_buy_condition_8_enable\": False,\n        \"v9_buy_condition_9_enable\": False,\n        \"v9_buy_condition_10_enable\": False,\n\n    }\n\n\n\n"
  },
  {
    "path": "strategies/CrossEMAStrategy/CrossEMAStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\n# import talib.abstract as ta\nimport ta\n\n\n# This class is a sample. Feel free to customize it.\nclass CrossEMAStrategy(IStrategy):\n    \"\"\"\n    Cross EMA + stoch RSI\n\n    By Crypto Robot : https://www.youtube.com/watch?v=z9dbgvAYDuA\n    GitHub : https://github.com/CryptoRobotFr/TrueStrategy/\n\n    freqtrade backtesting -s CrossEMAStrategy --timerange=20170817-20210808 --stake-amount unlimited -p ETH/USDT --config user_data/config_binance.json --enable-position-stacking --max-open-trades 1\n    =============== SUMMARY METRICS ================\n    | Metric                 | Value               |\n    |------------------------+---------------------|\n    | Backtesting from       | 2017-08-19 05:00:00 |\n    | Backtesting to         | 2021-08-08 00:00:00 |\n    | Max open trades        | 1                   |\n    |                        |                     |\n    | Total/Daily Avg Trades | 250 / 0.17          |\n    | Starting balance       | 1000.000 USDT       |\n    | Final balance          | 135855.953 USDT     |\n    | Absolute profit        | 134855.953 USDT     |\n    | Total profit %         | 13485.6%            |\n    | Trades per day         | 0.17                |\n    | Avg. daily profit %    | 9.31%               |\n    | Avg. stake amount      | 17038.974 USDT      |\n    | Total trade volume     | 4259743.407 USDT    |\n    |                        |                     |\n    | Best Pair              | ETH/USDT 628.7%     |\n    | Worst Pair             | ETH/USDT 628.7%     |\n    | Best trade             | ETH/USDT 65.48%     |\n    | Worst trade            | ETH/USDT -10.02%    |\n    | Best day               | 50942.482 USDT      |\n    | Worst day              | -9651.772 USDT      |\n    | Days win/draw/lose     | 88 / 1193 / 156     |\n    | Avg. Duration Winners  | 6 days, 2:44:00     |\n    | Avg. Duration Loser    | 1 day, 10:12:00     |\n    | Rejected Buy signals   | 18454               |\n    |                        |                     |\n    | Min balance            | 1015.748 USDT       |\n    | Max balance            | 135855.953 USDT     |\n    | Drawdown               | 45.55%              |\n    | Drawdown               | 40840.978 USDT      |\n    | Drawdown high          | 131200.572 USDT     |\n    | Drawdown low           | 90359.594 USDT      |\n    | Drawdown Start         | 2021-05-13 06:00:00 |\n    | Drawdown End           | 2021-07-19 04:00:00 |\n    | Market change          | 948.1%              |\n    ================================================\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 100 # inactive\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.99 # inactive\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Hyperoptable parameters\n    buy_stoch_rsi = DecimalParameter(0.5, 1, decimals=3, default=0.8, space=\"buy\")\n    sell_stoch_rsi = DecimalParameter(0, 0.5, decimals=3, default=0.2, space=\"sell\")\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 49 # EMA 48 + 1\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'ema28': {},\n            'ema48': {}\n        },\n        'subplots': {\n            \"RSI\": {\n                'stoch_rsi': {}\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        \n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # Momentum Indicators\n        # ------------------------------------\n\n        # # Stochastic RSI\n        dataframe['stoch_rsi'] = ta.momentum.stochrsi(dataframe['close'])\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema28']=ta.trend.ema_indicator(dataframe['close'], 28)\n        dataframe['ema48']=ta.trend.ema_indicator(dataframe['close'], 48)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema28'] > dataframe['ema48']) &\n                (dataframe['stoch_rsi'] < self.buy_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema28'] < dataframe['ema48']) &\n                (dataframe['stoch_rsi'] > self.sell_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/CryptoFrog/CryptoFrog.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrog(IStrategy):\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.213,\n        \"39\": 0.103,\n        \"96\": 0.037,\n        \"166\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.085\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.047\n    trailing_only_offset_is_reached = False\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 166,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.085, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO/CryptoFrogHO.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"any\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 763,\n        \"cstp_threshold\": -0.001,\n        \"droi_pullback\": False,\n        \"droi_pullback_amount\": 0.005,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"candle\",\n    }\n    \n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.09,\n        \"39\": 0.028,\n        \"49\": 0.011,\n        \"105\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.13\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.221\n    trailing_stop_positive_offset = 0.321\n    trailing_only_offset_is_reached = True\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 166,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.085, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO2/CryptoFrogHO2.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO2(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 1432,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": True,\n        \"droi_pullback_amount\": 0.014,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.09,\n        \"39\": 0.028,\n        \"49\": 0.011,\n        \"105\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.13\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.221\n    trailing_stop_positive_offset = 0.321\n    trailing_only_offset_is_reached = True\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 105,      #166 # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.13, # -0.085,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_dynamic_roi = True\n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO2A/CryptoFrogHO2A.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO2A(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 1432,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": True,\n        \"droi_pullback_amount\": 0.014,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.09,\n        \"39\": 0.028,\n        \"49\": 0.011,\n        \"105\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.13\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.097\n    trailing_stop_positive_offset = 0.197\n    trailing_only_offset_is_reached = True\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 105,      #166 # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.13, # -0.085,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_dynamic_roi = True\n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO3A1/CryptoFrogHO3A1.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO3A1(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 1310,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": True,\n        \"droi_pullback_amount\": 0.009,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.055,\n        \"10\": 0.02,\n        \"43\": 0.01,\n        \"60\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.299\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.295\n    trailing_stop_positive_offset = 0.378\n    trailing_only_offset_is_reached = True\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 166,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.085, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO3A2/CryptoFrogHO3A2.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO3A2(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 1310,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": True,\n        \"droi_pullback_amount\": 0.009,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.051,\n        \"10\": 0.02,\n        \"24\": 0.01,\n        \"64\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.239\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.221\n    trailing_stop_positive_offset = 0.3\n    trailing_only_offset_is_reached = True\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 166,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.085, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO3A3/CryptoFrogHO3A3.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO3A3(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 1310,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": True,\n        \"droi_pullback_amount\": 0.009,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.143,\n        \"10\": 0.022,\n        \"20\": 0.011,\n        \"53\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.024\n    trailing_stop_positive_offset = 0.117\n    trailing_only_offset_is_reached = True\n\n    # Stoploss:\n    stoploss = -0.299\n\n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 53,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.299, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogHO3A4/CryptoFrogHO3A4.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogHO3A4(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.01,\n        \"cstp_bail_time\": 1124,\n        \"cstp_threshold\": -0.001,\n        \"droi_pullback\": False,\n        \"droi_pullback_amount\": 0.005,\n        \"droi_pullback_respect_table\": True,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.219,\n        \"14\": 0.021,\n        \"24\": 0.01,\n        \"49\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.324\n    trailing_stop_positive_offset = 0.42\n    trailing_only_offset_is_reached = True\n\n    # Stoploss:\n    stoploss = -0.299\n\n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 49,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.299, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = True\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n            \n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/CryptoFrogNFI/CryptoFrogNFI.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom functools import reduce\n\n## I hope you know what these are already\nfrom pandas import DataFrame, Series\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogNFI(IStrategy):\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.016,\n        \"cstp_bail_time\": 901,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": False,\n        \"droi_pullback_amount\": 0.008,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.191,\n        \"35\": 0.025,\n        \"77\": 0.012,\n        \"188\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.299\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.278\n    trailing_stop_positive_offset = 0.338\n    trailing_only_offset_is_reached = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 166,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.085, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n#############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=True, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.024, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.965, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n        \n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['lower'].shift().gt(0))\n        buy_03_logic.append(dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['lower'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_normal_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_loose_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_24_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/CryptoFrogNFIHO1A/CryptoFrogNFIHO1A.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom functools import reduce\n\n## I hope you know what these are already\nfrom pandas import DataFrame, Series\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogNFIHO1A(IStrategy):\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_01_protection__close_above_ema_fast\": False,\n        \"buy_01_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_01_protection__close_above_ema_slow\": False,\n        \"buy_01_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_01_protection__ema_fast\": False,\n        \"buy_01_protection__ema_fast_len\": \"26\",\n        \"buy_01_protection__ema_slow\": False,\n        \"buy_01_protection__ema_slow_len\": \"100\",\n        \"buy_01_protection__safe_dips\": True,\n        \"buy_01_protection__safe_dips_type\": \"strict\",\n        \"buy_01_protection__safe_pump\": False,\n        \"buy_01_protection__safe_pump_period\": \"48\",\n        \"buy_01_protection__safe_pump_type\": \"strict\",\n        \"buy_01_protection__sma200_1h_rising\": True,\n        \"buy_01_protection__sma200_1h_rising_val\": \"30\",\n        \"buy_01_protection__sma200_rising\": False,\n        \"buy_01_protection__sma200_rising_val\": \"44\",\n        \"buy_02_protection__close_above_ema_fast\": True,\n        \"buy_02_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_02_protection__close_above_ema_slow\": False,\n        \"buy_02_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_02_protection__ema_fast\": True,\n        \"buy_02_protection__ema_fast_len\": \"50\",\n        \"buy_02_protection__ema_slow\": True,\n        \"buy_02_protection__ema_slow_len\": \"200\",\n        \"buy_02_protection__safe_dips\": False,\n        \"buy_02_protection__safe_dips_type\": \"normal\",\n        \"buy_02_protection__safe_pump\": True,\n        \"buy_02_protection__safe_pump_period\": \"48\",\n        \"buy_02_protection__safe_pump_type\": \"normal\",\n        \"buy_02_protection__sma200_1h_rising\": False,\n        \"buy_02_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_02_protection__sma200_rising\": False,\n        \"buy_02_protection__sma200_rising_val\": \"20\",\n        \"buy_03_protection__close_above_ema_fast\": False,\n        \"buy_03_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_03_protection__close_above_ema_slow\": True,\n        \"buy_03_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_03_protection__ema_fast\": False,\n        \"buy_03_protection__ema_fast_len\": \"100\",\n        \"buy_03_protection__ema_slow\": True,\n        \"buy_03_protection__ema_slow_len\": \"200\",\n        \"buy_03_protection__safe_dips\": True,\n        \"buy_03_protection__safe_dips_type\": \"loose\",\n        \"buy_03_protection__safe_pump\": True,\n        \"buy_03_protection__safe_pump_period\": \"24\",\n        \"buy_03_protection__safe_pump_type\": \"loose\",\n        \"buy_03_protection__sma200_1h_rising\": False,\n        \"buy_03_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_03_protection__sma200_rising\": True,\n        \"buy_03_protection__sma200_rising_val\": \"30\",\n        \"buy_04_protection__close_above_ema_fast\": False,\n        \"buy_04_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_04_protection__close_above_ema_slow\": False,\n        \"buy_04_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_04_protection__ema_fast\": True,\n        \"buy_04_protection__ema_fast_len\": \"200\",\n        \"buy_04_protection__ema_slow\": True,\n        \"buy_04_protection__ema_slow_len\": \"26\",\n        \"buy_04_protection__safe_dips\": False,\n        \"buy_04_protection__safe_dips_type\": \"normal\",\n        \"buy_04_protection__safe_pump\": False,\n        \"buy_04_protection__safe_pump_period\": \"24\",\n        \"buy_04_protection__safe_pump_type\": \"normal\",\n        \"buy_04_protection__sma200_1h_rising\": True,\n        \"buy_04_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_04_protection__sma200_rising\": False,\n        \"buy_04_protection__sma200_rising_val\": \"36\",\n        \"buy_05_protection__close_above_ema_fast\": True,\n        \"buy_05_protection__close_above_ema_fast_len\": \"100\",\n        \"buy_05_protection__close_above_ema_slow\": True,\n        \"buy_05_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_05_protection__ema_fast\": False,\n        \"buy_05_protection__ema_fast_len\": \"200\",\n        \"buy_05_protection__ema_slow\": False,\n        \"buy_05_protection__ema_slow_len\": \"26\",\n        \"buy_05_protection__safe_dips\": False,\n        \"buy_05_protection__safe_dips_type\": \"strict\",\n        \"buy_05_protection__safe_pump\": True,\n        \"buy_05_protection__safe_pump_period\": \"24\",\n        \"buy_05_protection__safe_pump_type\": \"strict\",\n        \"buy_05_protection__sma200_1h_rising\": True,\n        \"buy_05_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_05_protection__sma200_rising\": False,\n        \"buy_05_protection__sma200_rising_val\": \"30\",\n        \"buy_06_protection__close_above_ema_fast\": False,\n        \"buy_06_protection__close_above_ema_fast_len\": \"12\",\n        \"buy_06_protection__close_above_ema_slow\": True,\n        \"buy_06_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_06_protection__ema_fast\": True,\n        \"buy_06_protection__ema_fast_len\": \"26\",\n        \"buy_06_protection__ema_slow\": True,\n        \"buy_06_protection__ema_slow_len\": \"100\",\n        \"buy_06_protection__safe_dips\": False,\n        \"buy_06_protection__safe_dips_type\": \"strict\",\n        \"buy_06_protection__safe_pump\": True,\n        \"buy_06_protection__safe_pump_period\": \"36\",\n        \"buy_06_protection__safe_pump_type\": \"strict\",\n        \"buy_06_protection__sma200_1h_rising\": True,\n        \"buy_06_protection__sma200_1h_rising_val\": \"30\",\n        \"buy_06_protection__sma200_rising\": True,\n        \"buy_06_protection__sma200_rising_val\": \"44\",\n        \"buy_07_protection__close_above_ema_fast\": True,\n        \"buy_07_protection__close_above_ema_fast_len\": \"26\",\n        \"buy_07_protection__close_above_ema_slow\": True,\n        \"buy_07_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_07_protection__ema_fast\": False,\n        \"buy_07_protection__ema_fast_len\": \"50\",\n        \"buy_07_protection__ema_slow\": False,\n        \"buy_07_protection__ema_slow_len\": \"100\",\n        \"buy_07_protection__safe_dips\": True,\n        \"buy_07_protection__safe_dips_type\": \"strict\",\n        \"buy_07_protection__safe_pump\": True,\n        \"buy_07_protection__safe_pump_period\": \"48\",\n        \"buy_07_protection__safe_pump_type\": \"normal\",\n        \"buy_07_protection__sma200_1h_rising\": False,\n        \"buy_07_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_07_protection__sma200_rising\": False,\n        \"buy_07_protection__sma200_rising_val\": \"44\",\n        \"buy_08_protection__close_above_ema_fast\": False,\n        \"buy_08_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_08_protection__close_above_ema_slow\": False,\n        \"buy_08_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_08_protection__ema_fast\": False,\n        \"buy_08_protection__ema_fast_len\": \"100\",\n        \"buy_08_protection__ema_slow\": False,\n        \"buy_08_protection__ema_slow_len\": \"26\",\n        \"buy_08_protection__safe_dips\": False,\n        \"buy_08_protection__safe_dips_type\": \"strict\",\n        \"buy_08_protection__safe_pump\": True,\n        \"buy_08_protection__safe_pump_period\": \"24\",\n        \"buy_08_protection__safe_pump_type\": \"loose\",\n        \"buy_08_protection__sma200_1h_rising\": False,\n        \"buy_08_protection__sma200_1h_rising_val\": \"30\",\n        \"buy_08_protection__sma200_rising\": False,\n        \"buy_08_protection__sma200_rising_val\": \"30\",\n        \"buy_09_protection__close_above_ema_fast\": False,\n        \"buy_09_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_09_protection__close_above_ema_slow\": False,\n        \"buy_09_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_09_protection__ema_fast\": False,\n        \"buy_09_protection__ema_fast_len\": \"100\",\n        \"buy_09_protection__ema_slow\": False,\n        \"buy_09_protection__ema_slow_len\": \"26\",\n        \"buy_09_protection__safe_dips\": True,\n        \"buy_09_protection__safe_dips_type\": \"loose\",\n        \"buy_09_protection__safe_pump\": False,\n        \"buy_09_protection__safe_pump_period\": \"36\",\n        \"buy_09_protection__safe_pump_type\": \"strict\",\n        \"buy_09_protection__sma200_1h_rising\": False,\n        \"buy_09_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_09_protection__sma200_rising\": False,\n        \"buy_09_protection__sma200_rising_val\": \"36\",\n        \"buy_10_protection__close_above_ema_fast\": True,\n        \"buy_10_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_10_protection__close_above_ema_slow\": False,\n        \"buy_10_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_10_protection__ema_fast\": False,\n        \"buy_10_protection__ema_fast_len\": \"200\",\n        \"buy_10_protection__ema_slow\": False,\n        \"buy_10_protection__ema_slow_len\": \"50\",\n        \"buy_10_protection__safe_dips\": True,\n        \"buy_10_protection__safe_dips_type\": \"strict\",\n        \"buy_10_protection__safe_pump\": False,\n        \"buy_10_protection__safe_pump_period\": \"24\",\n        \"buy_10_protection__safe_pump_type\": \"normal\",\n        \"buy_10_protection__sma200_1h_rising\": True,\n        \"buy_10_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_10_protection__sma200_rising\": False,\n        \"buy_10_protection__sma200_rising_val\": \"20\",\n        \"buy_11_protection__close_above_ema_fast\": False,\n        \"buy_11_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_11_protection__close_above_ema_slow\": False,\n        \"buy_11_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_11_protection__ema_fast\": False,\n        \"buy_11_protection__ema_fast_len\": \"50\",\n        \"buy_11_protection__ema_slow\": True,\n        \"buy_11_protection__ema_slow_len\": \"26\",\n        \"buy_11_protection__safe_dips\": True,\n        \"buy_11_protection__safe_dips_type\": \"strict\",\n        \"buy_11_protection__safe_pump\": True,\n        \"buy_11_protection__safe_pump_period\": \"48\",\n        \"buy_11_protection__safe_pump_type\": \"loose\",\n        \"buy_11_protection__sma200_1h_rising\": False,\n        \"buy_11_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_11_protection__sma200_rising\": True,\n        \"buy_11_protection__sma200_rising_val\": \"36\",\n        \"buy_12_protection__close_above_ema_fast\": False,\n        \"buy_12_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_12_protection__close_above_ema_slow\": False,\n        \"buy_12_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_12_protection__ema_fast\": True,\n        \"buy_12_protection__ema_fast_len\": \"50\",\n        \"buy_12_protection__ema_slow\": False,\n        \"buy_12_protection__ema_slow_len\": \"50\",\n        \"buy_12_protection__safe_dips\": True,\n        \"buy_12_protection__safe_dips_type\": \"strict\",\n        \"buy_12_protection__safe_pump\": False,\n        \"buy_12_protection__safe_pump_period\": \"36\",\n        \"buy_12_protection__safe_pump_type\": \"normal\",\n        \"buy_12_protection__sma200_1h_rising\": False,\n        \"buy_12_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_12_protection__sma200_rising\": True,\n        \"buy_12_protection__sma200_rising_val\": \"30\",\n        \"buy_13_protection__close_above_ema_fast\": True,\n        \"buy_13_protection__close_above_ema_fast_len\": \"26\",\n        \"buy_13_protection__close_above_ema_slow\": True,\n        \"buy_13_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_13_protection__ema_fast\": True,\n        \"buy_13_protection__ema_fast_len\": \"200\",\n        \"buy_13_protection__ema_slow\": False,\n        \"buy_13_protection__ema_slow_len\": \"200\",\n        \"buy_13_protection__safe_dips\": True,\n        \"buy_13_protection__safe_dips_type\": \"strict\",\n        \"buy_13_protection__safe_pump\": False,\n        \"buy_13_protection__safe_pump_period\": \"24\",\n        \"buy_13_protection__safe_pump_type\": \"strict\",\n        \"buy_13_protection__sma200_1h_rising\": False,\n        \"buy_13_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_13_protection__sma200_rising\": False,\n        \"buy_13_protection__sma200_rising_val\": \"36\",\n        \"buy_14_protection__close_above_ema_fast\": False,\n        \"buy_14_protection__close_above_ema_fast_len\": \"12\",\n        \"buy_14_protection__close_above_ema_slow\": False,\n        \"buy_14_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_14_protection__ema_fast\": False,\n        \"buy_14_protection__ema_fast_len\": \"50\",\n        \"buy_14_protection__ema_slow\": True,\n        \"buy_14_protection__ema_slow_len\": \"200\",\n        \"buy_14_protection__safe_dips\": False,\n        \"buy_14_protection__safe_dips_type\": \"normal\",\n        \"buy_14_protection__safe_pump\": False,\n        \"buy_14_protection__safe_pump_period\": \"24\",\n        \"buy_14_protection__safe_pump_type\": \"strict\",\n        \"buy_14_protection__sma200_1h_rising\": False,\n        \"buy_14_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_14_protection__sma200_rising\": False,\n        \"buy_14_protection__sma200_rising_val\": \"20\",\n        \"buy_15_protection__close_above_ema_fast\": True,\n        \"buy_15_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_15_protection__close_above_ema_slow\": True,\n        \"buy_15_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_15_protection__ema_fast\": True,\n        \"buy_15_protection__ema_fast_len\": \"26\",\n        \"buy_15_protection__ema_slow\": True,\n        \"buy_15_protection__ema_slow_len\": \"26\",\n        \"buy_15_protection__safe_dips\": True,\n        \"buy_15_protection__safe_dips_type\": \"loose\",\n        \"buy_15_protection__safe_pump\": False,\n        \"buy_15_protection__safe_pump_period\": \"24\",\n        \"buy_15_protection__safe_pump_type\": \"loose\",\n        \"buy_15_protection__sma200_1h_rising\": True,\n        \"buy_15_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_15_protection__sma200_rising\": False,\n        \"buy_15_protection__sma200_rising_val\": \"30\",\n        \"buy_16_protection__close_above_ema_fast\": False,\n        \"buy_16_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_16_protection__close_above_ema_slow\": False,\n        \"buy_16_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_16_protection__ema_fast\": False,\n        \"buy_16_protection__ema_fast_len\": \"200\",\n        \"buy_16_protection__ema_slow\": False,\n        \"buy_16_protection__ema_slow_len\": \"200\",\n        \"buy_16_protection__safe_dips\": False,\n        \"buy_16_protection__safe_dips_type\": \"normal\",\n        \"buy_16_protection__safe_pump\": False,\n        \"buy_16_protection__safe_pump_period\": \"36\",\n        \"buy_16_protection__safe_pump_type\": \"strict\",\n        \"buy_16_protection__sma200_1h_rising\": True,\n        \"buy_16_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_16_protection__sma200_rising\": True,\n        \"buy_16_protection__sma200_rising_val\": \"36\",\n        \"buy_17_protection__close_above_ema_fast\": False,\n        \"buy_17_protection__close_above_ema_fast_len\": \"12\",\n        \"buy_17_protection__close_above_ema_slow\": True,\n        \"buy_17_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_17_protection__ema_fast\": True,\n        \"buy_17_protection__ema_fast_len\": \"200\",\n        \"buy_17_protection__ema_slow\": True,\n        \"buy_17_protection__ema_slow_len\": \"50\",\n        \"buy_17_protection__safe_dips\": False,\n        \"buy_17_protection__safe_dips_type\": \"normal\",\n        \"buy_17_protection__safe_pump\": True,\n        \"buy_17_protection__safe_pump_period\": \"24\",\n        \"buy_17_protection__safe_pump_type\": \"normal\",\n        \"buy_17_protection__sma200_1h_rising\": True,\n        \"buy_17_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_17_protection__sma200_rising\": True,\n        \"buy_17_protection__sma200_rising_val\": \"44\",\n        \"buy_18_protection__close_above_ema_fast\": True,\n        \"buy_18_protection__close_above_ema_fast_len\": \"100\",\n        \"buy_18_protection__close_above_ema_slow\": True,\n        \"buy_18_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_18_protection__ema_fast\": True,\n        \"buy_18_protection__ema_fast_len\": \"100\",\n        \"buy_18_protection__ema_slow\": False,\n        \"buy_18_protection__ema_slow_len\": \"200\",\n        \"buy_18_protection__safe_dips\": True,\n        \"buy_18_protection__safe_dips_type\": \"normal\",\n        \"buy_18_protection__safe_pump\": True,\n        \"buy_18_protection__safe_pump_period\": \"36\",\n        \"buy_18_protection__safe_pump_type\": \"loose\",\n        \"buy_18_protection__sma200_1h_rising\": True,\n        \"buy_18_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_18_protection__sma200_rising\": False,\n        \"buy_18_protection__sma200_rising_val\": \"50\",\n        \"buy_19_protection__close_above_ema_fast\": False,\n        \"buy_19_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_19_protection__close_above_ema_slow\": False,\n        \"buy_19_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_19_protection__ema_fast\": False,\n        \"buy_19_protection__ema_fast_len\": \"200\",\n        \"buy_19_protection__ema_slow\": True,\n        \"buy_19_protection__ema_slow_len\": \"200\",\n        \"buy_19_protection__safe_dips\": True,\n        \"buy_19_protection__safe_dips_type\": \"strict\",\n        \"buy_19_protection__safe_pump\": False,\n        \"buy_19_protection__safe_pump_period\": \"48\",\n        \"buy_19_protection__safe_pump_type\": \"loose\",\n        \"buy_19_protection__sma200_1h_rising\": False,\n        \"buy_19_protection__sma200_1h_rising_val\": \"36\",\n        \"buy_19_protection__sma200_rising\": False,\n        \"buy_19_protection__sma200_rising_val\": \"36\",\n        \"buy_20_protection__close_above_ema_fast\": True,\n        \"buy_20_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_20_protection__close_above_ema_slow\": False,\n        \"buy_20_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_20_protection__ema_fast\": False,\n        \"buy_20_protection__ema_fast_len\": \"100\",\n        \"buy_20_protection__ema_slow\": True,\n        \"buy_20_protection__ema_slow_len\": \"200\",\n        \"buy_20_protection__safe_dips\": False,\n        \"buy_20_protection__safe_dips_type\": \"normal\",\n        \"buy_20_protection__safe_pump\": False,\n        \"buy_20_protection__safe_pump_period\": \"36\",\n        \"buy_20_protection__safe_pump_type\": \"loose\",\n        \"buy_20_protection__sma200_1h_rising\": True,\n        \"buy_20_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_20_protection__sma200_rising\": False,\n        \"buy_20_protection__sma200_rising_val\": \"20\",\n        \"buy_21_protection__close_above_ema_fast\": False,\n        \"buy_21_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_21_protection__close_above_ema_slow\": False,\n        \"buy_21_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_21_protection__ema_fast\": True,\n        \"buy_21_protection__ema_fast_len\": \"26\",\n        \"buy_21_protection__ema_slow\": True,\n        \"buy_21_protection__ema_slow_len\": \"26\",\n        \"buy_21_protection__safe_dips\": False,\n        \"buy_21_protection__safe_dips_type\": \"normal\",\n        \"buy_21_protection__safe_pump\": True,\n        \"buy_21_protection__safe_pump_period\": \"24\",\n        \"buy_21_protection__safe_pump_type\": \"strict\",\n        \"buy_21_protection__sma200_1h_rising\": True,\n        \"buy_21_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_21_protection__sma200_rising\": False,\n        \"buy_21_protection__sma200_rising_val\": \"44\",\n        \"buy_22_protection__close_above_ema_fast\": True,\n        \"buy_22_protection__close_above_ema_fast_len\": \"26\",\n        \"buy_22_protection__close_above_ema_slow\": False,\n        \"buy_22_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_22_protection__ema_fast\": False,\n        \"buy_22_protection__ema_fast_len\": \"26\",\n        \"buy_22_protection__ema_slow\": True,\n        \"buy_22_protection__ema_slow_len\": \"26\",\n        \"buy_22_protection__safe_dips\": False,\n        \"buy_22_protection__safe_dips_type\": \"normal\",\n        \"buy_22_protection__safe_pump\": True,\n        \"buy_22_protection__safe_pump_period\": \"36\",\n        \"buy_22_protection__safe_pump_type\": \"strict\",\n        \"buy_22_protection__sma200_1h_rising\": True,\n        \"buy_22_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_22_protection__sma200_rising\": True,\n        \"buy_22_protection__sma200_rising_val\": \"20\",\n        \"buy_23_protection__close_above_ema_fast\": True,\n        \"buy_23_protection__close_above_ema_fast_len\": \"12\",\n        \"buy_23_protection__close_above_ema_slow\": True,\n        \"buy_23_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_23_protection__ema_fast\": True,\n        \"buy_23_protection__ema_fast_len\": \"100\",\n        \"buy_23_protection__ema_slow\": False,\n        \"buy_23_protection__ema_slow_len\": \"50\",\n        \"buy_23_protection__safe_dips\": False,\n        \"buy_23_protection__safe_dips_type\": \"loose\",\n        \"buy_23_protection__safe_pump\": False,\n        \"buy_23_protection__safe_pump_period\": \"24\",\n        \"buy_23_protection__safe_pump_type\": \"strict\",\n        \"buy_23_protection__sma200_1h_rising\": True,\n        \"buy_23_protection__sma200_1h_rising_val\": \"36\",\n        \"buy_23_protection__sma200_rising\": False,\n        \"buy_23_protection__sma200_rising_val\": \"50\",\n        \"buy_24_protection__close_above_ema_fast\": True,\n        \"buy_24_protection__close_above_ema_fast_len\": \"100\",\n        \"buy_24_protection__close_above_ema_slow\": False,\n        \"buy_24_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_24_protection__ema_fast\": False,\n        \"buy_24_protection__ema_fast_len\": \"100\",\n        \"buy_24_protection__ema_slow\": True,\n        \"buy_24_protection__ema_slow_len\": \"200\",\n        \"buy_24_protection__safe_dips\": False,\n        \"buy_24_protection__safe_dips_type\": \"normal\",\n        \"buy_24_protection__safe_pump\": True,\n        \"buy_24_protection__safe_pump_period\": \"36\",\n        \"buy_24_protection__safe_pump_type\": \"strict\",\n        \"buy_24_protection__sma200_1h_rising\": True,\n        \"buy_24_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_24_protection__sma200_rising\": False,\n        \"buy_24_protection__sma200_rising_val\": \"30\",\n        \"buy_24_rsi_1h_min\": 87.8,\n        \"buy_24_rsi_max\": 60.0,\n        \"buy_bb20_close_bblowerband_4\": 0.978,\n        \"buy_bb20_volume_4\": 13.49,\n        \"buy_bb40_bbdelta_close_3\": 0.019,\n        \"buy_bb40_closedelta_close_3\": 0.025,\n        \"buy_bb40_tail_bbdelta_3\": 0.411,\n        \"buy_bb_offset_10\": 0.98,\n        \"buy_bb_offset_14\": 0.986,\n        \"buy_bb_offset_18\": 0.999,\n        \"buy_bb_offset_2\": 0.975,\n        \"buy_bb_offset_22\": 0.988,\n        \"buy_bb_offset_23\": 0.99,\n        \"buy_bb_offset_5\": 0.992,\n        \"buy_bb_offset_6\": 0.996,\n        \"buy_bb_offset_9\": 0.973,\n        \"buy_chop_min_19\": 28.0,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": False,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": False,\n        \"buy_condition_14_enable\": False,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": False,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_1_enable\": False,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": False,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": False,\n        \"buy_condition_4_enable\": False,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": False,\n        \"buy_condition_7_enable\": False,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_dip_threshold_1\": 0.019,\n        \"buy_dip_threshold_10\": 0.118,\n        \"buy_dip_threshold_11\": 0.268,\n        \"buy_dip_threshold_12\": 0.358,\n        \"buy_dip_threshold_2\": 0.12,\n        \"buy_dip_threshold_3\": 0.279,\n        \"buy_dip_threshold_4\": 0.231,\n        \"buy_dip_threshold_5\": 0.016,\n        \"buy_dip_threshold_6\": 0.066,\n        \"buy_dip_threshold_7\": 0.321,\n        \"buy_dip_threshold_8\": 0.408,\n        \"buy_dip_threshold_9\": 0.04,\n        \"buy_ema_open_mult_14\": 0.025,\n        \"buy_ema_open_mult_15\": 0.012,\n        \"buy_ema_open_mult_5\": 0.025,\n        \"buy_ema_open_mult_6\": 0.023,\n        \"buy_ema_open_mult_7\": 0.028,\n        \"buy_ema_rel_15\": 0.978,\n        \"buy_ema_rel_3\": 0.976,\n        \"buy_ema_rel_5\": 0.98,\n        \"buy_ewo_12\": 1.6,\n        \"buy_ewo_13\": -7.0,\n        \"buy_ewo_16\": 2.6,\n        \"buy_ewo_17\": -16.0,\n        \"buy_ewo_22\": 8.0,\n        \"buy_ewo_23\": 7.7,\n        \"buy_ma_offset_10\": 0.953,\n        \"buy_ma_offset_11\": 0.952,\n        \"buy_ma_offset_12\": 0.96,\n        \"buy_ma_offset_13\": 0.955,\n        \"buy_ma_offset_14\": 0.971,\n        \"buy_ma_offset_15\": 0.944,\n        \"buy_ma_offset_16\": 0.933,\n        \"buy_ma_offset_17\": 0.934,\n        \"buy_ma_offset_22\": 0.961,\n        \"buy_ma_offset_9\": 0.939,\n        \"buy_mfi_1\": 24.0,\n        \"buy_mfi_11\": 35.8,\n        \"buy_mfi_2\": 40.5,\n        \"buy_mfi_9\": 52.4,\n        \"buy_min_inc_1\": 0.045,\n        \"buy_min_inc_11\": 0.011,\n        \"buy_pump_pull_threshold_1\": 2.62,\n        \"buy_pump_pull_threshold_2\": 2.05,\n        \"buy_pump_pull_threshold_3\": 2.95,\n        \"buy_pump_pull_threshold_4\": 2.34,\n        \"buy_pump_pull_threshold_5\": 1.62,\n        \"buy_pump_pull_threshold_6\": 1.55,\n        \"buy_pump_pull_threshold_7\": 2.36,\n        \"buy_pump_pull_threshold_8\": 2.27,\n        \"buy_pump_pull_threshold_9\": 1.35,\n        \"buy_pump_threshold_1\": 0.698,\n        \"buy_pump_threshold_2\": 0.686,\n        \"buy_pump_threshold_3\": 0.692,\n        \"buy_pump_threshold_4\": 0.981,\n        \"buy_pump_threshold_5\": 0.625,\n        \"buy_pump_threshold_6\": 0.796,\n        \"buy_pump_threshold_7\": 0.944,\n        \"buy_pump_threshold_8\": 0.626,\n        \"buy_pump_threshold_9\": 1.166,\n        \"buy_rsi_1\": 26.9,\n        \"buy_rsi_11\": 38.5,\n        \"buy_rsi_12\": 39.3,\n        \"buy_rsi_15\": 28.9,\n        \"buy_rsi_16\": 40.0,\n        \"buy_rsi_18\": 26.5,\n        \"buy_rsi_1h_10\": 33.3,\n        \"buy_rsi_1h_20\": 16.8,\n        \"buy_rsi_1h_21\": 19.3,\n        \"buy_rsi_1h_23\": 69.0,\n        \"buy_rsi_1h_diff_2\": 40.2,\n        \"buy_rsi_1h_max_1\": 79.0,\n        \"buy_rsi_1h_max_11\": 70.7,\n        \"buy_rsi_1h_max_2\": 72.8,\n        \"buy_rsi_1h_max_9\": 85.8,\n        \"buy_rsi_1h_min_1\": 30.1,\n        \"buy_rsi_1h_min_11\": 57.3,\n        \"buy_rsi_1h_min_19\": 63.9,\n        \"buy_rsi_1h_min_2\": 31.3,\n        \"buy_rsi_1h_min_9\": 34.2,\n        \"buy_rsi_20\": 21.9,\n        \"buy_rsi_21\": 25.3,\n        \"buy_rsi_22\": 29.5,\n        \"buy_rsi_23\": 23.4,\n        \"buy_rsi_7\": 44.1,\n        \"buy_rsi_8\": 25.1,\n        \"buy_tail_diff_8\": 8.9,\n        \"buy_volume_22\": 4.7,\n        \"buy_volume_8\": 4.3,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.016,\n        \"cstp_bail_time\": 901,\n        \"cstp_threshold\": 0.0,\n        \"droi_pullback\": False,\n        \"droi_pullback_amount\": 0.008,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"rmi\",\n    }\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.191,\n        \"35\": 0.025,\n        \"77\": 0.012,\n        \"188\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.299\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.278\n    trailing_stop_positive_offset = 0.338\n    trailing_only_offset_is_reached = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n    \n    use_custom_stoploss = True\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 188,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.299, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n#############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=True, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.024, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.965, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n        \n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['lower'].shift().gt(0))\n        buy_03_logic.append(dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['lower'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_normal_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_loose_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_24_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/CryptoFrogOffset/CryptoFrogOffset.py",
    "content": "from typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom functools import reduce\n\n## I hope you know what these are already\nfrom pandas import DataFrame\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\nclass CryptoFrogOffset(IStrategy):\n\n    # ROI table - this strat REALLY benefits from roi and trailing hyperopt:\n    minimal_roi = {\n        \"0\": 0.213,\n        \"39\": 0.103,\n        \"96\": 0.037,\n        \"166\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.085\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.047\n    trailing_only_offset_is_reached = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n    \n    use_custom_stoploss = False\n    custom_stop = {\n        # Linear Decay Parameters\n        'decay-time': 166,       # minutes to reach end, I find it works well to match this to the final ROI value - default 1080\n        'decay-delay': 0,         # minutes to wait before decay starts\n        'decay-start': -0.085, # -0.32118, # -0.07163,     # starting value: should be the same or smaller than initial stoploss - default -0.30\n        'decay-end': -0.02,       # ending value - default -0.03\n        # Profit and TA  \n        'cur-min-diff': 0.03,     # diff between current and minimum profit to move stoploss up to min profit point\n        'cur-threshold': -0.02,   # how far negative should current profit be before we consider moving it up based on cur/min or roc\n        'roc-bail': -0.03,        # value for roc to use for dynamic bailout\n        'rmi-trend': 50,          # rmi-slow value to pause stoploss decay\n        'bail-how': 'immediate',  # set the stoploss to the atr offset below current price, or immediate\n        # Positive Trailing\n        'pos-trail': True,        # enable trailing once positive  \n        'pos-threshold': 0.005,   # trail after how far positive\n        'pos-trail-dist': 0.015   # how far behind to place the trail\n    }\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.005, space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=False, space='sell', optimize=True)    \n    \n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=-0.03, space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='roc', space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=-0.03, space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=720, space='sell')    \n    \n    stoploss = custom_stop['decay-start']    \n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n        \n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = True\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    use_dynamic_roi = True    \n    \n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    \n    plot_config = {\n        'main_plot': {\n            'Smooth_HA_H': {'color': 'orange'},\n            'Smooth_HA_L': {'color': 'yellow'},\n        },\n        'subplots': {\n            \"StochRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"MFI\": {\n                'mfi': {'color': 'green'},\n            },\n            \"BBEXP\": {\n                'bbw_expansion': {'color': 'orange'},\n            },\n            \"FAST\": {\n                'fastd': {'color': 'red'},\n                'fastk': {'color': 'blue'},\n            },\n            \"SQZMI\": {\n                'sqzmi': {'color': 'lightgreen'},\n            },\n            \"VFI\": {\n                'vfi': {'color': 'lightblue'},\n            },\n            \"DMI\": {\n                'dmi_plus': {'color': 'orange'},\n                'dmi_minus': {'color': 'yellow'},\n            },\n            \"EMACO\": {\n                'emac_1h': {'color': 'red'},\n                'emao_1h': {'color': 'blue'},\n            },\n        }\n    }\n\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        #-------------------------------------------------------------\n\n        # Buy signal 1 - RSI/MFI/INC\n        \"buy_condition_1_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_01_protection__close_above_ema_fast\": True,\n        \"buy_01_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_01_protection__close_above_ema_slow\": False,\n        \"buy_01_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_01_protection__ema_fast\": False,\n        \"buy_01_protection__ema_fast_len\": \"26\",\n        \"buy_01_protection__ema_slow\": True,\n        \"buy_01_protection__ema_slow_len\": \"100\",\n        \"buy_01_protection__safe_dips\": True,\n        \"buy_01_protection__safe_dips_type\": \"normal\",\n        \"buy_01_protection__safe_pump\": True,\n        \"buy_01_protection__safe_pump_period\": \"36\",\n        \"buy_01_protection__safe_pump_type\": \"loose\",\n        \"buy_01_protection__sma200_1h_rising\": False,\n        \"buy_01_protection__sma200_1h_rising_val\": \"36\",\n        \"buy_01_protection__sma200_rising\": True,\n        \"buy_01_protection__sma200_rising_val\": \"36\",\n\n        \"buy_mfi_1\": 36.0,\n        \"buy_min_inc_1\": 0.022,\n        \"buy_rsi_1\": 36.0,\n        \"buy_rsi_1h_max_1\": 84.0,\n        \"buy_rsi_1h_min_1\": 30.0,\n\n        #-------------------------------------------------------------\n\n        # Buy signal 2 - RSI diff\n        \"buy_condition_2_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_02_protection__close_above_ema_slow\": False,\n        \"buy_02_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_02_protection__close_above_ema_fast\": False,\n        \"buy_02_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_02_protection__ema_fast\": False,\n        \"buy_02_protection__ema_fast_len\": \"50\",\n        \"buy_02_protection__ema_slow\": False,\n        \"buy_02_protection__ema_slow_len\": \"50\",\n        \"buy_02_protection__safe_dips\": True,\n        \"buy_02_protection__safe_dips_type\": \"normal\",\n        \"buy_02_protection__safe_pump\": False,\n        \"buy_02_protection__safe_pump_period\": \"48\",\n        \"buy_02_protection__safe_pump_type\": \"loose\",\n        \"buy_02_protection__sma200_rising\": False,\n        \"buy_02_protection__sma200_rising_val\": \"50\",\n        \"buy_02_protection__sma200_1h_rising\": True,\n        \"buy_02_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_bb_offset_2\": 0.983,\n        \"buy_mfi_2\": 49.0,\n        \"buy_rsi_1h_diff_2\": 39.0,\n        \"buy_rsi_1h_max_2\": 84.0,\n        \"buy_rsi_1h_min_2\": 32.0,\n        #\"buy_volume_2\": 2.6, # removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 3 BHV\n        \"buy_condition_3_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_03_protection__close_above_ema_slow\": False,\n        \"buy_03_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_03_protection__close_above_ema_fast\": False,\n        \"buy_03_protection__close_above_ema_fast_len\": \"5\",\n        \"buy_03_protection__ema_fast\": True,\n        \"buy_03_protection__ema_fast_len\": \"100\",\n        \"buy_03_protection__ema_slow\": True,\n        \"buy_03_protection__ema_slow_len\": \"100\",\n        \"buy_03_protection__safe_dips\": False,\n        \"buy_03_protection__safe_dips_type\": \"loose\",\n        \"buy_03_protection__safe_pump\": True,\n        \"buy_03_protection__safe_pump_period\": \"36\",\n        \"buy_03_protection__safe_pump_type\": \"loose\",\n        \"buy_03_protection__sma200_rising\": False,\n        \"buy_03_protection__sma200_rising_val\": \"50\",\n        \"buy_03_protection__sma200_1h_rising\": False,\n        \"buy_03_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 4 - Cluc\n        \"buy_condition_4_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_04_protection__close_above_ema_slow\": False,\n        \"buy_04_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_04_protection__close_above_ema_fast\": False,\n        \"buy_04_protection__close_above_ema_fast_len\": \"30\",\n        \"buy_04_protection__ema_fast\": False,\n        \"buy_04_protection__ema_fast_len\": \"50\",\n        \"buy_04_protection__ema_slow\": False,\n        \"buy_04_protection__ema_slow_len\": \"50\",\n        \"buy_04_protection__safe_dips\": True,\n        \"buy_04_protection__safe_dips_type\": \"normal\",\n        \"buy_04_protection__safe_pump\": True,\n        \"buy_04_protection__safe_pump_period\": \"48\",\n        \"buy_04_protection__safe_pump_type\": \"normal\",\n        \"buy_04_protection__sma200_1h_rising\": True,\n        \"buy_04_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_04_protection__sma200_rising\": True,\n        \"buy_04_protection__sma200_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 5 - MACD/BB/more checks\n        \"buy_condition_5_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_05_protection__close_above_ema_fast\": False,\n        \"buy_05_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_05_protection__close_above_ema_slow\": False,\n        \"buy_05_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_05_protection__ema_fast\": True,\n        \"buy_05_protection__ema_fast_len\": \"100\",\n        \"buy_05_protection__ema_slow\": False,\n        \"buy_05_protection__ema_slow_len\": \"50\",\n        \"buy_05_protection__safe_dips\": True,\n        \"buy_05_protection__safe_dips_type\": \"loose\",\n        \"buy_05_protection__safe_pump\": True,\n        \"buy_05_protection__safe_pump_period\": \"36\",\n        \"buy_05_protection__safe_pump_type\": \"strict\",\n        \"buy_05_protection__sma200_rising\": False,\n        \"buy_05_protection__sma200_rising_val\": \"50\",\n        \"buy_05_protection__sma200_1h_rising\": False,\n        \"buy_05_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 6 - MACD/BB/less checks\n        \"buy_condition_6_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_06_protection__close_above_ema_slow\": False,\n        \"buy_06_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_06_protection__close_above_ema_fast\": False,\n        \"buy_06_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_06_protection__ema_fast\": False,\n        \"buy_06_protection__ema_fast_len\": \"50\",\n        \"buy_06_protection__ema_slow\": True,\n        \"buy_06_protection__ema_slow_len\": \"100\",\n        \"buy_06_protection__safe_dips\": True,\n        \"buy_06_protection__safe_dips_type\": \"normal\",\n        \"buy_06_protection__safe_pump\": True,\n        \"buy_06_protection__safe_pump_period\": \"36\",\n        \"buy_06_protection__safe_pump_type\": \"strict\",\n        \"buy_06_protection__sma200_rising\": False,\n        \"buy_06_protection__sma200_rising_val\": \"50\",\n        \"buy_06_protection__sma200_1h_rising\": False,\n        \"buy_06_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        \"buy_condition_7_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_07_protection__close_above_ema_slow\": False,\n        \"buy_07_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_07_protection__close_above_ema_fast\": False,\n        \"buy_07_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_07_protection__ema_fast\": True,\n        \"buy_07_protection__ema_fast_len\": \"100\",\n        \"buy_07_protection__ema_slow\": True,\n        \"buy_07_protection__ema_slow_len\": \"50\",\n        \"buy_07_protection__safe_dips\": True,\n        \"buy_07_protection__safe_dips_type\": \"normal\",\n        \"buy_07_protection__safe_pump\": False,\n        \"buy_07_protection__safe_pump_period\": \"36\",\n        \"buy_07_protection__safe_pump_type\": \"loose\",\n        \"buy_07_protection__sma200_rising\": False,\n        \"buy_07_protection__sma200_rising_val\": \"50\",\n        \"buy_07_protection__sma200_1h_rising\": False,\n        \"buy_07_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_ema_open_mult_7\": 0.03,\n        \"buy_rsi_7\": 36.0,\n        #\"buy_volume_7\": 2.0,\n        #\"buy_ema_rel_7\": 0.986, # Not used\n\n        #-------------------------------------------------------------\n\n        \"buy_condition_8_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_08_protection__close_above_ema_slow\": False,\n        \"buy_08_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_08_protection__close_above_ema_fast\": False,\n        \"buy_08_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_08_protection__ema_fast\": False,\n        \"buy_08_protection__ema_fast_len\": \"50\",\n        \"buy_08_protection__ema_slow\": True,\n        \"buy_08_protection__ema_slow_len\": \"50\",\n        \"buy_08_protection__safe_dips\": True,\n        \"buy_08_protection__safe_dips_type\": \"loose\",\n        \"buy_08_protection__safe_pump\": True,\n        \"buy_08_protection__safe_pump_period\": \"24\",\n        \"buy_08_protection__safe_pump_type\": \"loose\",\n        \"buy_08_protection__sma200_rising\": False,\n        \"buy_08_protection__sma200_rising_val\": \"50\",\n        \"buy_08_protection__sma200_1h_rising\": False,\n        \"buy_08_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        \"buy_condition_9_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_09_protection__close_above_ema_slow\": False,\n        \"buy_09_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_09_protection__close_above_ema_fast\": False,\n        \"buy_09_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_09_protection__ema_fast\": True,\n        \"buy_09_protection__ema_fast_len\": \"100\",\n        \"buy_09_protection__ema_slow\": False,\n        \"buy_09_protection__ema_slow_len\": \"50\",\n        \"buy_09_protection__safe_dips\": False,\n        \"buy_09_protection__safe_dips_type\": \"strict\",\n        \"buy_09_protection__safe_pump\": False,\n        \"buy_09_protection__safe_pump_period\": \"24\",\n        \"buy_09_protection__safe_pump_type\": \"loose\",\n        \"buy_09_protection__sma200_rising\": False,\n        \"buy_09_protection__sma200_rising_val\": \"50\",\n        \"buy_09_protection__sma200_1h_rising\": False,\n        \"buy_09_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_bb_offset_9\": 0.985,\n        \"buy_ma_offset_9\": 0.97,\n        \"buy_mfi_9\": 30.0,\n        \"buy_rsi_1h_max_9\": 88.0,\n        \"buy_rsi_1h_min_9\": 30.0,\n        \"buy_volume_9\": 1.0,\n\n        \"buy_bb_offset_9\": 0.96,\n        \"buy_ma_offset_9\": 0.96,\n        \"buy_mfi_9\": 36.0,\n        \"buy_rsi_1h_max_9\": 88.0,\n        \"buy_rsi_1h_min_9\": 30.0,\n        \"buy_volume_9\": 1.0,\n\n        \"buy_bb_offset_9\": 0.965,\n        \"buy_ma_offset_9\": 0.922,\n        \"buy_mfi_9\": 50.0,\n        \"buy_rsi_1h_max_9\": 88.0,\n        \"buy_rsi_1h_min_9\": 30.0,\n        #\"buy_volume_9\": 1.0, #removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 10 - BB/SMA/Less checks\n        \"buy_condition_10_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_10_protection__close_above_ema_slow\": False,\n        \"buy_10_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_10_protection__close_above_ema_fast\": False,\n        \"buy_10_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_10_protection__ema_fast\": False,\n        \"buy_10_protection__ema_fast_len\": \"50\",\n        \"buy_10_protection__ema_slow\": False,\n        \"buy_10_protection__ema_slow_len\": \"50\",\n        \"buy_10_protection__safe_dips\": True,\n        \"buy_10_protection__safe_dips_type\": \"loose\",\n        \"buy_10_protection__safe_pump\": False,\n        \"buy_10_protection__safe_pump_period\": \"24\",\n        \"buy_10_protection__safe_pump_type\": \"loose\",\n        \"buy_10_protection__sma200_rising\": False,\n        \"buy_10_protection__sma200_rising_val\": \"50\",\n        \"buy_10_protection__sma200_1h_rising\": True,\n        \"buy_10_protection__sma200_1h_rising_val\": \"24\",\n\n        \"buy_bb_offset_10\": 0.994,\n        \"buy_ma_offset_10\": 0.948,\n        \"buy_rsi_1h_10\": 37.0,\n        \"buy_volume_10\": 2.4,\n\n        #-------------------------------------------------------------\n\n        # Buy signal 11 - INC/RSI/MFI/SMA\n        \"buy_condition_11_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_11_protection__close_above_ema_slow\": False,\n        \"buy_11_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_11_protection__close_above_ema_fast\": False,\n        \"buy_11_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_11_protection__ema_fast\": False,\n        \"buy_11_protection__ema_fast_len\": \"50\",\n        \"buy_11_protection__ema_slow\": False,\n        \"buy_11_protection__ema_slow_len\": \"50\",\n        \"buy_11_protection__safe_dips\": True,\n        \"buy_11_protection__safe_dips_type\": \"loose\",\n        \"buy_11_protection__safe_pump\": True,\n        \"buy_11_protection__safe_pump_period\": \"24\",\n        \"buy_11_protection__safe_pump_type\": \"loose\",\n        \"buy_11_protection__sma200_rising\": False,\n        \"buy_11_protection__sma200_rising_val\": \"50\",\n        \"buy_11_protection__sma200_1h_rising\": False,\n        \"buy_11_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_ma_offset_11\": 0.939, #0.939\n        \"buy_mfi_11\": 36.0,\n        \"buy_min_inc_11\": 0.01,\n        \"buy_rsi_11\": 48.0,\n        \"buy_rsi_1h_max_11\": 84.0,\n        \"buy_rsi_1h_min_11\": 56.0, # lower can have losses\n\n        #-------------------------------------------------------------\n\n        # Buy signal 12 - EWO high/MA offset/RSI\n        \"buy_condition_12_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_12_protection__close_above_ema_slow\": False,\n        \"buy_12_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_12_protection__close_above_ema_fast\": False,\n        \"buy_12_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_12_protection__ema_fast\": False,\n        \"buy_12_protection__ema_fast_len\": \"50\",\n        \"buy_12_protection__ema_slow\": False,\n        \"buy_12_protection__ema_slow_len\": \"50\",\n        \"buy_12_protection__safe_dips\": True,\n        \"buy_12_protection__safe_dips_type\": \"strict\",\n        \"buy_12_protection__safe_pump\": False,\n        \"buy_12_protection__safe_pump_period\": \"24\",\n        \"buy_12_protection__safe_pump_type\": \"loose\",\n        \"buy_12_protection__sma200_rising\": False,\n        \"buy_12_protection__sma200_rising_val\": \"50\",\n        \"buy_12_protection__sma200_1h_rising\": True,\n        \"buy_12_protection__sma200_1h_rising_val\": \"24\",\n\n        \"buy_ewo_12\": 1.8,\n        \"buy_ma_offset_12\": 0.922,\n        \"buy_rsi_12\": 30.0,\n        #\"buy_volume_12\": 1.7, # removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 13 - EWO low/MA Offset\n        \"buy_condition_13_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_13_protection__close_above_ema_slow\": False,\n        \"buy_13_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_13_protection__close_above_ema_fast\": False,\n        \"buy_13_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_13_protection__ema_fast\": False,\n        \"buy_13_protection__ema_fast_len\": \"50\",\n        \"buy_13_protection__ema_slow\": False,\n        \"buy_13_protection__ema_slow_len\": \"50\",\n        \"buy_13_protection__safe_dips\": True,\n        \"buy_13_protection__safe_dips_type\": \"strict\",\n        \"buy_13_protection__safe_pump\": False,\n        \"buy_13_protection__safe_pump_period\": \"24\",\n        \"buy_13_protection__safe_pump_type\": \"loose\",\n        \"buy_13_protection__sma200_rising\": False,\n        \"buy_13_protection__sma200_rising_val\": \"50\",\n        \"buy_13_protection__sma200_1h_rising\": True,\n        \"buy_13_protection__sma200_1h_rising_val\": \"24\",\n\n        \"buy_ewo_13\": -11.8,\n        \"buy_ma_offset_13\": 0.99,\n        #\"buy_volume_13\": 1.6, # Removed\n\n        #-------------------------------------------------------------\n\n        \"buy_condition_14_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_14_protection__close_above_ema_slow\": False,\n        \"buy_14_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_14_protection__close_above_ema_fast\": False,\n        \"buy_14_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_14_protection__ema_fast\": False,\n        \"buy_14_protection__ema_fast_len\": \"50\",\n        \"buy_14_protection__ema_slow\": False,\n        \"buy_14_protection__ema_slow_len\": \"50\",\n        \"buy_14_protection__safe_dips\": True,\n        \"buy_14_protection__safe_dips_type\": \"strict\",\n        \"buy_14_protection__safe_pump\": True,\n        \"buy_14_protection__safe_pump_period\": \"24\",\n        \"buy_14_protection__safe_pump_type\": \"normal\",\n        \"buy_14_protection__sma200_rising\": True,\n        \"buy_14_protection__sma200_rising_val\": \"30\",\n        \"buy_14_protection__sma200_1h_rising\": True,\n        \"buy_14_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_bb_offset_14\": 0.988,\n        \"buy_ema_open_mult_14\": 0.014,\n        \"buy_ma_offset_14\": 0.98,\n        #\"buy_volume_14\": 2.0, # Removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 15 - MACD/MA Offset/RSI\n        \"buy_condition_15_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_15_protection__close_above_ema_slow\": False,\n        \"buy_15_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_15_protection__close_above_ema_fast\": False,\n        \"buy_15_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_15_protection__ema_fast\": False,\n        \"buy_15_protection__ema_fast_len\": \"50\",\n        \"buy_15_protection__ema_slow\": True,\n        \"buy_15_protection__ema_slow_len\": \"50\",\n        \"buy_15_protection__safe_dips\": True,\n        \"buy_15_protection__safe_dips_type\": \"normal\",\n        \"buy_15_protection__safe_pump\": True,\n        \"buy_15_protection__safe_pump_period\": \"36\",\n        \"buy_15_protection__safe_pump_type\": \"strict\",\n        \"buy_15_protection__sma200_rising\": False,\n        \"buy_15_protection__sma200_rising_val\": \"50\",\n        \"buy_15_protection__sma200_1h_rising\": False,\n        \"buy_15_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_ema_open_mult_15\": 0.018,\n        \"buy_ma_offset_15\": 0.954,\n        \"buy_rsi_15\": 28.0,\n        \"buy_ema_rel_15\": 0.988,\n        #\"buy_volume_15\": 2.0, # Removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 16 - EWO/EMA/RSI\n        \"buy_condition_16_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_16_protection__close_above_ema_slow\": False,\n        \"buy_16_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_16_protection__close_above_ema_fast\": False,\n        \"buy_16_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_16_protection__ema_fast\": False,\n        \"buy_16_protection__ema_fast_len\": \"50\",\n        \"buy_16_protection__ema_slow\": True,\n        \"buy_16_protection__ema_slow_len\": \"50\",\n        \"buy_16_protection__safe_dips\": True,\n        \"buy_16_protection__safe_dips_type\": \"strict\",\n        \"buy_16_protection__safe_pump\": True,\n        \"buy_16_protection__safe_pump_period\": \"24\",\n        \"buy_16_protection__safe_pump_type\": \"strict\",\n        \"buy_16_protection__sma200_rising\": False,\n        \"buy_16_protection__sma200_rising_val\": \"50\",\n        \"buy_16_protection__sma200_1h_rising\": False,\n        \"buy_16_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_ewo_16\": 2.8,\n        \"buy_ma_offset_16\": 0.952,\n        \"buy_rsi_16\": 31.0,\n        #\"buy_volume_16\": 2.0, # removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 17 - EWO low/EMA Offset\n        \"buy_condition_17_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_17_protection__close_above_ema_slow\": False,\n        \"buy_17_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_17_protection__close_above_ema_fast\": False,\n        \"buy_17_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_17_protection__ema_fast\": False,\n        \"buy_17_protection__ema_fast_len\": \"50\",\n        \"buy_17_protection__ema_slow\": False,\n        \"buy_17_protection__ema_slow_len\": \"50\",\n        \"buy_17_protection__safe_dips\": True,\n        \"buy_17_protection__safe_dips_type\": \"strict\",\n        \"buy_17_protection__safe_pump\": True,\n        \"buy_17_protection__safe_pump_period\": \"24\",\n        \"buy_17_protection__safe_pump_type\": \"loose\",\n        \"buy_17_protection__sma200_rising\": False,\n        \"buy_17_protection__sma200_rising_val\": \"50\",\n        \"buy_17_protection__sma200_1h_rising\": False,\n        \"buy_17_protection__sma200_1h_rising_val\": \"50\",\n\n        \"buy_ewo_17\": -12.0,\n        \"buy_ma_offset_17\": 0.952,\n\n        #-------------------------------------------------------------\n\n        \"buy_condition_18_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_18_protection__close_above_ema_slow\": True,\n        \"buy_18_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_18_protection__close_above_ema_fast\": False,\n        \"buy_18_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_18_protection__ema_fast\": True,\n        \"buy_18_protection__ema_fast_len\": \"100\",\n        \"buy_18_protection__ema_slow\": True,\n        \"buy_18_protection__ema_slow_len\": \"50\",\n        \"buy_18_protection__safe_dips\": True,\n        \"buy_18_protection__safe_dips_type\": \"normal\",\n        \"buy_18_protection__safe_pump\": True,\n        \"buy_18_protection__safe_pump_period\": \"24\",\n        \"buy_18_protection__safe_pump_type\": \"strict\",\n        \"buy_18_protection__sma200_rising\": True,\n        \"buy_18_protection__sma200_rising_val\": \"44\",\n        \"buy_18_protection__sma200_1h_rising\": True,\n        \"buy_18_protection__sma200_1h_rising_val\": \"72\",\n\n        \"buy_bb_offset_18\": 0.982,\n        \"buy_rsi_18\": 26.0,\n        #\"buy_volume_18\": 2.0, # removed\n\n        #-------------------------------------------------------------\n\n        # Buy signal 19 - Chopiness/RSI\n        \"buy_condition_19_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_19_protection__close_above_ema_slow\": False,\n        \"buy_19_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_19_protection__close_above_ema_fast\": False,\n        \"buy_19_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_19_protection__ema_fast\": False,\n        \"buy_19_protection__ema_fast_len\": \"50\",\n        \"buy_19_protection__ema_slow\": True,\n        \"buy_19_protection__ema_slow_len\": \"100\",\n        \"buy_19_protection__safe_dips\": True,\n        \"buy_19_protection__safe_dips_type\": \"normal\",\n        \"buy_19_protection__safe_pump\": True,\n        \"buy_19_protection__safe_pump_period\": \"24\",\n        \"buy_19_protection__safe_pump_type\": \"normal\",\n        \"buy_19_protection__sma200_rising\": True,\n        \"buy_19_protection__sma200_rising_val\": \"36\",\n        \"buy_19_protection__sma200_1h_rising\": False,\n        \"buy_19_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 20 - Double RSI\n        \"buy_condition_20_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_20_protection__close_above_ema_slow\": False,\n        \"buy_20_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_20_protection__close_above_ema_fast\": False,\n        \"buy_20_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_20_protection__ema_fast\": False,\n        \"buy_20_protection__ema_fast_len\": \"50\",\n        \"buy_20_protection__ema_slow\": True,\n        \"buy_20_protection__ema_slow_len\": \"50\",\n        \"buy_20_protection__safe_dips\": False,\n        \"buy_20_protection__safe_dips_type\": \"normal\",\n        \"buy_20_protection__safe_pump\": False,\n        \"buy_20_protection__safe_pump_period\": \"24\",\n        \"buy_20_protection__safe_pump_type\": \"loose\",\n        \"buy_20_protection__sma200_rising\": False,\n        \"buy_20_protection__sma200_rising_val\": \"50\",\n        \"buy_20_protection__sma200_1h_rising\": False,\n        \"buy_20_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 21 - Double RSI\n        \"buy_condition_21_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_21_protection__close_above_ema_slow\": False,\n        \"buy_21_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_21_protection__close_above_ema_fast\": False,\n        \"buy_21_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_21_protection__ema_fast\": False,\n        \"buy_21_protection__ema_fast_len\": \"50\",\n        \"buy_21_protection__ema_slow\": True,\n        \"buy_21_protection__ema_slow_len\": \"50\",\n        \"buy_21_protection__safe_dips\": True,\n        \"buy_21_protection__safe_dips_type\": \"normal\",\n        \"buy_21_protection__safe_pump\": False,\n        \"buy_21_protection__safe_pump_period\": \"36\",\n        \"buy_21_protection__safe_pump_type\": \"loose\",\n        \"buy_21_protection__sma200_rising\": False,\n        \"buy_21_protection__sma200_rising_val\": \"50\",\n        \"buy_21_protection__sma200_1h_rising\": False,\n        \"buy_21_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 22\n        \"buy_condition_22_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_22_protection__close_above_ema_slow\": False,\n        \"buy_22_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_22_protection__close_above_ema_fast\": False,\n        \"buy_22_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_22_protection__ema_fast\": False,\n        \"buy_22_protection__ema_fast_len\": \"50\",\n        \"buy_22_protection__ema_slow\": False,\n        \"buy_22_protection__ema_slow_len\": \"50\",\n        \"buy_22_protection__safe_dips\": False,\n        \"buy_22_protection__safe_dips_type\": \"normal\",\n        \"buy_22_protection__safe_pump\": False,\n        \"buy_22_protection__safe_pump_period\": \"36\",\n        \"buy_22_protection__safe_pump_type\": \"loose\",\n        \"buy_22_protection__sma200_rising\": False,\n        \"buy_22_protection__sma200_rising_val\": \"50\",\n        \"buy_22_protection__sma200_1h_rising\": False,\n        \"buy_22_protection__sma200_1h_rising_val\": \"50\",\n\n        #-------------------------------------------------------------\n\n        # Buy signal 23 - Over EMA200/2001h/RSI/BB/EWO\n        \"buy_condition_23_enable\": True,\n        #-------------------------------------------------------------\n        \"buy_23_protection__close_above_ema_slow\": True,\n        \"buy_23_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_23_protection__close_above_ema_fast\": True,\n        \"buy_23_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_23_protection__ema_fast\": False,\n        \"buy_23_protection__ema_fast_len\": \"50\",\n        \"buy_23_protection__ema_slow\": False,\n        \"buy_23_protection__ema_slow_len\": \"50\",\n        \"buy_23_protection__safe_dips\": True,\n        \"buy_23_protection__safe_dips_type\": \"loose\",\n        \"buy_23_protection__safe_pump\": False,\n        \"buy_23_protection__safe_pump_period\": \"36\",\n        \"buy_23_protection__safe_pump_type\": \"loose\",\n        \"buy_23_protection__sma200_rising\": False,\n        \"buy_23_protection__sma200_rising_val\": \"50\",\n        \"buy_23_protection__sma200_1h_rising\": False,\n        \"buy_23_protection__sma200_1h_rising_val\": \"50\",\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.06, 0.30, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(38.0, 55.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.2, 0.45, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.05, 0.12, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.06, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        #pairs.append(\"BTC/USDT\")\n        #pairs.append(\"ETH/USDT\")\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    ## stolen from Obelisk's Ichi strat code and backtest blog post, and Solipsis4\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n        \n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    ## cryptofrog signals\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n    \n    ## more going on here\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n## goddamnit\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif"
  },
  {
    "path": "strategies/CustomStoplossWithPSAR/CustomStoplossWithPSAR.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\n\n\nclass CustomStoplossWithPSAR(IStrategy):\n    \"\"\"\n    this is an example class, implementing a PSAR based trailing stop loss\n    you are supposed to take the `custom_stoploss()` and `populate_indicators()`\n    parts and adapt it to your own strategy\n\n    the populate_buy_trend() function is pretty nonsencial\n    \"\"\"\n    timeframe = '1h'\n    stoploss = -0.2\n    custom_info = {}\n    use_custom_stoploss = True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        result = 1\n        if self.custom_info and pair in self.custom_info and trade:\n            # using current_time directly (like below) will only work in backtesting/hyperopt.\n            # in live / dry-run, it'll be really the current time\n            relative_sl = None\n            if self.dp:\n                # so we need to get analyzed_dataframe from dp\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n                # only use .iat[-1] in callback methods, never in \"populate_*\" methods.\n                # see: https://www.freqtrade.io/en/latest/strategy-customization/#common-mistakes-when-developing-strategies\n                last_candle = dataframe.iloc[-1].squeeze()\n                relative_sl = last_candle['sar']\n\n            if (relative_sl is not None):\n                # print(\"custom_stoploss().relative_sl: {}\".format(relative_sl))\n                # calculate new_stoploss relative to current_rate\n                new_stoploss = (current_rate - relative_sl) / current_rate\n                # turn into relative negative offset required by `custom_stoploss` return implementation\n                result = new_stoploss - 1\n\n        # print(\"custom_stoploss() -> {}\".format(result))\n        return result\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['sar'] = ta.SAR(dataframe)\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_info[metadata['pair']] = dataframe[['date', 'sar']].copy().set_index('date')\n\n        # all \"normal\" indicators:\n        # e.g.\n        # dataframe['rsi'] = ta.RSI(dataframe)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Placeholder Strategy: buys when SAR is smaller then candle before\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['sar'] < dataframe['sar'].shift())\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Placeholder Strategy: does nothing\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        # Deactivated sell signal to allow the strategy to work correctly\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/DCBBBounce/DCBBBounce.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter, IntParameter\n\n\n\nclass DCBBBounce(IStrategy):\n    \"\"\"\n    Simple strategy based on Contrarian Donchian Channels crossing Bollinger Bands\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s DCBBBounce.py\n    \"\"\"\n\n    # Hyperparameters\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_adx\": 25.0,\n        \"buy_adx_enabled\": True,\n        \"buy_ema_enabled\": False,\n        \"buy_period\": 52,\n        \"buy_sar_enabled\": True,\n        \"buy_sma_enabled\": False,\n    }\n\n    buy_period = IntParameter(10, 120, default=52, space=\"buy\")\n\n    buy_adx = DecimalParameter(1, 99, decimals=0, default=25, space=\"buy\")\n    buy_sma_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_ema_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_adx_enabled = CategoricalParameter([True, False], default=True, space=\"buy\")\n    buy_sar_enabled = CategoricalParameter([True, False], default=True, space=\"buy\")\n\n    sell_hold = CategoricalParameter([True, False], default=True, space=\"sell\")\n\n    # set the startup candles count to the longest average used (SMA, EMA etc)\n    startup_candle_count = buy_period.value\n\n    # The ROI, Stoploss and Trailing Stop values are typically found using hyperopt\n    # if hold enabled, then use the 'common' ROI params\n    if sell_hold.value:\n        # ROI table:\n        minimal_roi = {\n            \"0\": 0.278,\n            \"39\": 0.087,\n            \"124\": 0.038,\n            \"135\": 0\n        }\n\n        # Trailing stop:\n        trailing_stop = True\n        trailing_stop_positive = 0.172\n        trailing_stop_positive_offset = 0.212\n        trailing_only_offset_is_reached = False\n\n        # Stoploss:\n        stoploss = -0.333\n    else:\n        # ROI table:\n        minimal_roi = {\n            \"0\": 0.261,\n            \"40\": 0.087,\n            \"95\": 0.023,\n            \"192\": 0\n        }\n\n        # Stoploss:\n        stoploss = -0.33\n\n        # Trailing stop:\n        trailing_stop = True\n        trailing_stop_positive = 0.168\n        trailing_stop_positive_offset = 0.253\n        trailing_only_offset_is_reached = False\n\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': True\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n        bollinger = qtpylib.weighted_bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_lowerband'] = bollinger['lower']\n\n        # Donchian Channels\n        dataframe['dc_upper'] = ta.MAX(dataframe['high'], timeperiod=self.buy_period.value)\n        dataframe['dc_lower'] = ta.MIN(dataframe['low'], timeperiod=self.buy_period.value)\n\n        dataframe[\"dcbb_diff_upper\"] = (dataframe[\"dc_upper\"] - dataframe['bb_upperband'])\n        dataframe[\"dcbb_diff_lower\"] = (dataframe[\"dc_lower\"] - dataframe['bb_lowerband'])\n\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['dm_plus'] = ta.PLUS_DM(dataframe)\n        dataframe['dm_minus'] = ta.MINUS_DM(dataframe)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n\n        # EMA - Exponential Moving Average\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # SAR Parabolic\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=200)\n        #print(\"\\nSMA: \", dataframe['sma'])\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # GUARDS AND TRENDS\n\n        # check that volume is not 0 (can happen in testing, or if there are issues with exchange data)\n        # conditions.append(dataframe['volume'] > 0)\n\n        # during back testing, data can be undefined, so check\n        conditions.append(dataframe['dc_upper'].notnull())\n\n        if self.buy_sar_enabled.value:\n            conditions.append(dataframe['sar'].notnull())\n            conditions.append(dataframe['close'] < dataframe['sar'])\n\n        if self.buy_sma_enabled.value:\n            conditions.append(dataframe['sma'].notnull())\n            conditions.append(dataframe['close'] > dataframe['sma'])\n\n        if self.buy_ema_enabled.value:\n            conditions.append(dataframe['ema50'].notnull())\n            conditions.append(dataframe['close'] > dataframe['ema50'])\n\n        # ADX with DM+ > DM- indicates uptrend\n        if self.buy_adx_enabled.value:\n            conditions.append(\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['dm_plus'] >= dataframe['dm_minus'])\n            )\n\n        # TRIGGERS\n        # closing price above SAR\n        #conditions.append(dataframe['sar'] < dataframe['close'])\n\n        # green candle, Lower Bollinger goes below Donchian\n        conditions.append(\n            (dataframe['dcbb_diff_lower'].notnull()) &\n            (dataframe['close'] >= dataframe['open']) &\n            (qtpylib.crossed_above(dataframe['dcbb_diff_lower'], 0))\n        )\n\n        # build the dataframe using the conditions\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n\n        \"\"\"\n        # if hold, then don't set a sell signal\n        if self.sell_hold.value:\n            dataframe.loc[(dataframe['close'].notnull() ), 'sell'] = 0\n\n        else:\n\n            conditions = []\n            # Upper Bollinger goes above Donchian\n            conditions.append(\n                (dataframe['dcbb_diff_upper'].notnull()) &\n                #(dataframe['close'] <= dataframe['open']) &\n                (qtpylib.crossed_below(dataframe['dcbb_diff_upper'], 0))\n            )\n\n            # build the dataframe using the conditions\n            if conditions:\n                dataframe.loc[reduce(lambda x, y: x & y, conditions), 'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/DD/DD.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass DD(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/BbandRsi.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.11078,\n        \"33\": 0.06816,\n        \"68\": 0.02844,\n        \"165\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.0102\n    trailing_stop_positive_offset = 0.03701\n    trailing_only_offset_is_reached = False\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.32745\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators.\n        Can be a copy of the corresponding method from the strategy,\n        or will be loaded from the strategy.\n        Must align to populate_indicators used (either from this File, or from the strategy)\n        Only used when --spaces does not include buy\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n             #   (dataframe['mfi'] < 16) &\n              #  (dataframe['adx'] > 25) &\n                (dataframe['rsi'] < 40)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators.\n        Can be a copy of the corresponding method from the strategy,\n        or will be loaded from the strategy.\n        Must align to populate_indicators used (either from this File, or from the strategy)\n        Only used when --spaces does not include sell\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) \n             #   (dataframe['rsi'] > 21)\n                \n                \n                \n          #      (qtpylib.crossed_above(\n           #         dataframe['macdsignal'], dataframe['macd']\n          #      )) &\n          #      (dataframe['fastd'] > 54)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/DIV_v1/DIV_v1.py",
    "content": "from pandas import DataFrame\nimport talib.abstract as ta\nfrom functools import reduce\nimport numpy as np\nfrom freqtrade.strategy import (IStrategy)\n\n# DIV v1.0 - 2021-09-07\n# by Sanka \n\nclass DIV_v1(IStrategy):\n\n    minimal_roi = {\n        \"0\": 0.10347601757573865,\n        \"3\": 0.050495605759981035,\n        \"5\": 0.03350898081823659,\n        \"61\": 0.0275218557571848,\n        \"292\": 0.005185372158403069,\n        \"399\": 0,\n        \n    }\n    stoploss = -0.15\n\n    timeframe = '5m'\n    startup_candle_count = 200\n    process_only_new_candles = True\n\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    plot_config = {\n        \"main_plot\": {\n            \"ohlc_bottom\" : {\n                \"type\": \"scatter\",\n                'plotly': {\n                    \"mode\": \"markers\",\n                    \"name\": \"a\",\n                    \"text\": \"aa\",\n                    \"marker\": {\n                        \"symbol\": \"cross-dot\",\n                        \"size\": 3,\n                        \"color\": \"black\"\n                    }\n                }\n            },\n        },\n        \"subplots\": {\n            \"rsi\": {\n                \"rsi\": {\"color\": \"blue\"},\n                \"rsi_bottom\" : {\n                    \"type\": \"scatter\",\n                    'plotly': {\n                        \"mode\": \"markers\",\n                        \"name\": \"b\",\n                        \"text\": \"bb\",\n                        \"marker\": {\n                            \"symbol\": \"cross-dot\",\n                            \"size\": 3,\n                            \"color\": \"black\"\n                        }\n                    }\n                },\n            }\n        }\n    }\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Divergence\n        dataframe = divergence(dataframe, \"rsi\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe[\"bullish_divergence\"] == True) &\n                (dataframe['rsi'] < 30) &\n                (dataframe[\"volume\"] > 0)\n            ), 'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        return dataframe\n\n\ndef divergence(dataframe: DataFrame, source='rsi'):\n    # Detect divergence between close price and source\n\n    # Detect HL or LL\n    dataframe['ohlc_bottom'] = np.NaN\n    dataframe['rsi_bottom'] = np.NaN\n    dataframe.loc[(dataframe['close'].shift() <= dataframe['close'].shift(2)) & (dataframe['close'] >= dataframe['close'].shift()), 'ohlc_bottom'] = dataframe['close'].shift()\n    dataframe.loc[(dataframe[source].shift() <= dataframe[source].shift(2)) & (dataframe[source] >= dataframe[source].shift()), 'rsi_bottom'] = dataframe[source].shift()\n    dataframe[\"ohlc_bottom\"].fillna(method='ffill', inplace=True)\n    dataframe[\"rsi_bottom\"].fillna(method='ffill', inplace=True)\n\n    # Detect divergence\n    dataframe['bullish_divergence'] = np.NaN\n    dataframe['hidden_bullish_divergence'] = np.NaN\n    for i in range(2, 15):\n        # Check there is nothing between the 2 diverging points\n        conditional_array = []\n        for ii in range(1, i):\n            conditional_array.append(dataframe[\"ohlc_bottom\"].shift(i).le(dataframe['ohlc_bottom'].shift(ii)))\n        res = reduce(lambda x, y: x & y, conditional_array)\n        dataframe.loc[(\n            (dataframe[\"ohlc_bottom\"].lt(dataframe['ohlc_bottom'].shift(i))) &\n            (dataframe[\"rsi_bottom\"].gt(dataframe['rsi_bottom'].shift(i))) &\n            (dataframe[\"ohlc_bottom\"].le(dataframe['ohlc_bottom'].shift())) &\n            (res)\n            ), \"bullish_divergence\"] = True\n\n    return dataframe\n"
  },
  {
    "path": "strategies/DevilStra/DevilStra.py",
    "content": "# DevilStra Strategy\n# 𝔇𝔢𝔳𝔦𝔩 𝔦𝔰 𝔞𝔩𝔴𝔞𝔶𝔰 𝔰𝔱𝔯𝔬𝔫𝔤𝔢𝔯 𝔱𝔥𝔞𝔫 𝔊𝔬𝔡.\n# 𝔅𝔲𝔱 𝔱𝔥𝔢 𝔬𝔫𝔩𝔶 𝔬𝔫𝔢 𝔴𝔥𝔬 𝔥𝔞𝔰 𝔱𝔥𝔢 𝔞𝔟𝔦𝔩𝔦𝔱𝔶\n# 𝔗𝔬 𝔠𝔯𝔢𝔞𝔱𝔢 𝔫𝔢𝔴 𝔠𝔯𝔢𝔞𝔱𝔲𝔯𝔢𝔰 𝔦𝔰 𝔊𝔬𝔡.\n# 𝔄𝔫𝔡 𝔱𝔥𝔢 𝔇𝔢𝔳𝔦𝔩 𝔪𝔞𝔨𝔢𝔰 𝔭𝔬𝔴𝔢𝔯𝔣𝔲𝔩 𝔰𝔭𝔢𝔩𝔩𝔰\n# 𝔉𝔯𝔬𝔪 𝔱𝔥𝔦𝔰 𝔰𝔪𝔞𝔩𝔩 𝔠𝔯𝔢𝔞𝔱𝔲𝔯𝔢𝔰 (𝔩𝔦𝔨𝔢 𝔣𝔯𝔬𝔤𝔰, 𝔢𝔱𝔠.)\n# 𝔚𝔦𝔱𝔥 𝔣𝔯𝔞𝔤𝔪𝔢𝔫𝔱𝔞𝔱𝔦𝔬𝔫 𝔞𝔫𝔡 𝔪𝔦𝔵𝔦𝔫𝔤 𝔱𝔥𝔢𝔪.\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# * IMPORTANT: You Need An \"STATIC\" Pairlist On Your Config.json !\n# * IMPORTANT: First set PAIR_LIST_LENGHT={pair_whitelist size}\n# * And re-hyperopt the Sell strategy And paste result in exact\n# * place(lines 535~564)\n\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces buy sell -s 𝕯𝖊𝖛𝖎𝖑𝕾𝖙𝖗𝖆\n\n# --- Do not remove these libs ---\nimport numpy as np\nfrom functools import reduce\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nimport random\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter, IntParameter\n\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# ########################## SETTINGS ##############################\n# pairlist lenght(use exact count of pairs you used in whitelist size+1):\nPAIR_LIST_LENGHT = 269\n# you can find exact value of this inside GodStraNew\nTREND_CHECK_CANDLES = 4\n# Set the pain range of devil(2~9999)\nPAIN_RANGE = 1000\n# Add \"GodStraNew\" Generated Results As spells inside SPELLS.\n# Set them unic phonemes like 'Zi' 'Gu' or 'Lu'!\n# * Use below replacement on GodStraNew results to\n# * Change God Generated Creatures to Spells:\n# +-----------------------------+----------------------+\n# | GodStraNew Hyperopt Results |   DevilStra Spells   |\n# +-----------------------------+----------------------+\n# |                             | \"phonem\" : {         |\n# |    buy_params =  {          |    \"buy_params\" : {  |\n# |      ...                    |      ...             |\n# |    }                        |    },                |\n# |    sell_params = {          |    \"sell_params\" : { |\n# |      ...                    |      ...             |\n# |    }                        |    }                 |\n# |                             | },                   |\n# +-----------------------------+----------------------+\nSPELLS = {\n    \"Zi\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"BOP-4\",\n            \"buy_crossed_indicator1\": \"MACD-0-50\",\n            \"buy_crossed_indicator2\": \"DEMA-52\",\n            \"buy_indicator0\": \"MINUS_DI-50\",\n            \"buy_indicator1\": \"HT_TRENDMODE-50\",\n            \"buy_indicator2\": \"CORREL-128\",\n            \"buy_operator0\": \"/>R\",\n            \"buy_operator1\": \"CA\",\n            \"buy_operator2\": \"CDT\",\n            \"buy_real_num0\": 0.1763,\n            \"buy_real_num1\": 0.6891,\n            \"buy_real_num2\": 0.0509,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"WCLPRICE-52\",\n            \"sell_crossed_indicator1\": \"AROONOSC-15\",\n            \"sell_crossed_indicator2\": \"CDLRISEFALL3METHODS-52\",\n            \"sell_indicator0\": \"COS-50\",\n            \"sell_indicator1\": \"CDLCLOSINGMARUBOZU-30\",\n            \"sell_indicator2\": \"CDL2CROWS-130\",\n            \"sell_operator0\": \"DT\",\n            \"sell_operator1\": \">R\",\n            \"sell_operator2\": \"/>R\",\n            \"sell_real_num0\": 0.0678,\n            \"sell_real_num1\": 0.8698,\n            \"sell_real_num2\": 0.3917,\n        }\n    },\n    \"Gu\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"SMA-20\",\n            \"buy_crossed_indicator1\": \"CDLLADDERBOTTOM-20\",\n            \"buy_crossed_indicator2\": \"OBV-50\",\n            \"buy_indicator0\": \"MAMA-1-50\",\n            \"buy_indicator1\": \"SUM-40\",\n            \"buy_indicator2\": \"VAR-30\",\n            \"buy_operator0\": \"<R\",\n            \"buy_operator1\": \"D\",\n            \"buy_operator2\": \"D\",\n            \"buy_real_num0\": 0.2644,\n            \"buy_real_num1\": 0.0736,\n            \"buy_real_num2\": 0.8954,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"CDLLADDERBOTTOM-50\",\n            \"sell_crossed_indicator1\": \"CDLHARAMICROSS-50\",\n            \"sell_crossed_indicator2\": \"CDLDARKCLOUDCOVER-30\",\n            \"sell_indicator0\": \"CDLLADDERBOTTOM-10\",\n            \"sell_indicator1\": \"MAMA-1-40\",\n            \"sell_indicator2\": \"OBV-30\",\n            \"sell_operator0\": \"UT\",\n            \"sell_operator1\": \">R\",\n            \"sell_operator2\": \"CUT\",\n            \"sell_real_num0\": 0.2707,\n            \"sell_real_num1\": 0.7987,\n            \"sell_real_num2\": 0.6891,\n        }\n    },\n    \"Lu\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"HT_SINE-0-28\",\n            \"buy_crossed_indicator1\": \"ADD-130\",\n            \"buy_crossed_indicator2\": \"ADD-12\",\n            \"buy_indicator0\": \"ADD-28\",\n            \"buy_indicator1\": \"AVGPRICE-15\",\n            \"buy_indicator2\": \"AVGPRICE-12\",\n            \"buy_operator0\": \"DT\",\n            \"buy_operator1\": \"D\",\n            \"buy_operator2\": \"C\",\n            \"buy_real_num0\": 0.3676,\n            \"buy_real_num1\": 0.4284,\n            \"buy_real_num2\": 0.372,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"HT_SINE-0-5\",\n            \"sell_crossed_indicator1\": \"HT_SINE-0-4\",\n            \"sell_crossed_indicator2\": \"HT_SINE-0-28\",\n            \"sell_indicator0\": \"ADD-30\",\n            \"sell_indicator1\": \"AVGPRICE-28\",\n            \"sell_indicator2\": \"ADD-50\",\n            \"sell_operator0\": \"CUT\",\n            \"sell_operator1\": \"DT\",\n            \"sell_operator2\": \"=R\",\n            \"sell_real_num0\": 0.3205,\n            \"sell_real_num1\": 0.2055,\n            \"sell_real_num2\": 0.8467,\n        }\n    },\n    \"La\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"WMA-14\",\n            \"buy_crossed_indicator1\": \"MAMA-1-14\",\n            \"buy_crossed_indicator2\": \"CDLHIKKAKE-14\",\n            \"buy_indicator0\": \"T3-14\",\n            \"buy_indicator1\": \"BETA-14\",\n            \"buy_indicator2\": \"HT_PHASOR-1-14\",\n            \"buy_operator0\": \"/>R\",\n            \"buy_operator1\": \">\",\n            \"buy_operator2\": \">R\",\n            \"buy_real_num0\": 0.0551,\n            \"buy_real_num1\": 0.3469,\n            \"buy_real_num2\": 0.3871,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"HT_TRENDLINE-14\",\n            \"sell_crossed_indicator1\": \"LINEARREG-14\",\n            \"sell_crossed_indicator2\": \"STOCHRSI-1-14\",\n            \"sell_indicator0\": \"CDLDARKCLOUDCOVER-14\",\n            \"sell_indicator1\": \"AD-14\",\n            \"sell_indicator2\": \"CDLSTALLEDPATTERN-14\",\n            \"sell_operator0\": \"/=R\",\n            \"sell_operator1\": \"COT\",\n            \"sell_operator2\": \"OT\",\n            \"sell_real_num0\": 0.3992,\n            \"sell_real_num1\": 0.7747,\n            \"sell_real_num2\": 0.7415,\n        }\n    },\n    \"Si\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"MACDEXT-2-14\",\n            \"buy_crossed_indicator1\": \"CORREL-14\",\n            \"buy_crossed_indicator2\": \"CMO-14\",\n            \"buy_indicator0\": \"MA-14\",\n            \"buy_indicator1\": \"ADXR-14\",\n            \"buy_indicator2\": \"CDLMARUBOZU-14\",\n            \"buy_operator0\": \"<\",\n            \"buy_operator1\": \"/<R\",\n            \"buy_operator2\": \"<R\",\n            \"buy_real_num0\": 0.7883,\n            \"buy_real_num1\": 0.8286,\n            \"buy_real_num2\": 0.6512,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"AROON-1-14\",\n            \"sell_crossed_indicator1\": \"STOCHRSI-0-14\",\n            \"sell_crossed_indicator2\": \"SMA-14\",\n            \"sell_indicator0\": \"T3-14\",\n            \"sell_indicator1\": \"AROONOSC-14\",\n            \"sell_indicator2\": \"MIDPOINT-14\",\n            \"sell_operator0\": \"C\",\n            \"sell_operator1\": \"CA\",\n            \"sell_operator2\": \"CB\",\n            \"sell_real_num0\": 0.372,\n            \"sell_real_num1\": 0.5948,\n            \"sell_real_num2\": 0.9872,\n        }\n    },\n    \"Pa\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"AROON-0-60\",\n            \"buy_crossed_indicator1\": \"APO-60\",\n            \"buy_crossed_indicator2\": \"BBANDS-0-60\",\n            \"buy_indicator0\": \"WILLR-12\",\n            \"buy_indicator1\": \"AD-15\",\n            \"buy_indicator2\": \"MINUS_DI-12\",\n            \"buy_operator0\": \"D\",\n            \"buy_operator1\": \">\",\n            \"buy_operator2\": \"CA\",\n            \"buy_real_num0\": 0.2208,\n            \"buy_real_num1\": 0.1371,\n            \"buy_real_num2\": 0.6389,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"MACDEXT-0-15\",\n            \"sell_crossed_indicator1\": \"BBANDS-2-15\",\n            \"sell_crossed_indicator2\": \"DEMA-15\",\n            \"sell_indicator0\": \"ULTOSC-15\",\n            \"sell_indicator1\": \"MIDPOINT-12\",\n            \"sell_indicator2\": \"PLUS_DI-12\",\n            \"sell_operator0\": \"<\",\n            \"sell_operator1\": \"DT\",\n            \"sell_operator2\": \"COT\",\n            \"sell_real_num0\": 0.278,\n            \"sell_real_num1\": 0.0643,\n            \"sell_real_num2\": 0.7065,\n        }\n    },\n    \"De\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"HT_DCPERIOD-12\",\n            \"buy_crossed_indicator1\": \"HT_PHASOR-0-12\",\n            \"buy_crossed_indicator2\": \"MACDFIX-1-15\",\n            \"buy_indicator0\": \"CMO-12\",\n            \"buy_indicator1\": \"TRIMA-12\",\n            \"buy_indicator2\": \"MACDEXT-0-15\",\n            \"buy_operator0\": \"<\",\n            \"buy_operator1\": \"D\",\n            \"buy_operator2\": \"<\",\n            \"buy_real_num0\": 0.3924,\n            \"buy_real_num1\": 0.5546,\n            \"buy_real_num2\": 0.7648,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"MACDFIX-1-15\",\n            \"sell_crossed_indicator1\": \"MACD-1-15\",\n            \"sell_crossed_indicator2\": \"WMA-15\",\n            \"sell_indicator0\": \"ROC-15\",\n            \"sell_indicator1\": \"MACD-2-15\",\n            \"sell_indicator2\": \"CCI-60\",\n            \"sell_operator0\": \"CA\",\n            \"sell_operator1\": \"<R\",\n            \"sell_operator2\": \"/<R\",\n            \"sell_real_num0\": 0.4989,\n            \"sell_real_num1\": 0.4131,\n            \"sell_real_num2\": 0.8904,\n        }\n    },\n    \"Ra\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"EMA-110\",\n            \"buy_crossed_indicator1\": \"SMA-5\",\n            \"buy_crossed_indicator2\": \"SMA-6\",\n            \"buy_indicator0\": \"SMA-6\",\n            \"buy_indicator1\": \"EMA-12\",\n            \"buy_indicator2\": \"EMA-5\",\n            \"buy_operator0\": \"D\",\n            \"buy_operator1\": \"<\",\n            \"buy_operator2\": \"/<R\",\n            \"buy_real_num0\": 0.9814,\n            \"buy_real_num1\": 0.5528,\n            \"buy_real_num2\": 0.0541,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"SMA-50\",\n            \"sell_crossed_indicator1\": \"EMA-12\",\n            \"sell_crossed_indicator2\": \"SMA-100\",\n            \"sell_indicator0\": \"EMA-110\",\n            \"sell_indicator1\": \"EMA-50\",\n            \"sell_indicator2\": \"EMA-15\",\n            \"sell_operator0\": \"<\",\n            \"sell_operator1\": \"COT\",\n            \"sell_operator2\": \"/=R\",\n            \"sell_real_num0\": 0.3506,\n            \"sell_real_num1\": 0.8767,\n            \"sell_real_num2\": 0.0614,\n        }\n    },\n    \"Cu\": {\n        \"buy_params\": {\n            \"buy_crossed_indicator0\": \"SMA-110\",\n            \"buy_crossed_indicator1\": \"SMA-110\",\n            \"buy_crossed_indicator2\": \"SMA-5\",\n            \"buy_indicator0\": \"SMA-110\",\n            \"buy_indicator1\": \"SMA-55\",\n            \"buy_indicator2\": \"SMA-15\",\n            \"buy_operator0\": \"<R\",\n            \"buy_operator1\": \"<\",\n            \"buy_operator2\": \"CA\",\n            \"buy_real_num0\": 0.5,\n            \"buy_real_num1\": 0.7,\n            \"buy_real_num2\": 0.9,\n        },\n        \"sell_params\": {\n            \"sell_crossed_indicator0\": \"SMA-55\",\n            \"sell_crossed_indicator1\": \"SMA-50\",\n            \"sell_crossed_indicator2\": \"SMA-100\",\n            \"sell_indicator0\": \"SMA-5\",\n            \"sell_indicator1\": \"SMA-50\",\n            \"sell_indicator2\": \"SMA-50\",\n            \"sell_operator0\": \"/=R\",\n            \"sell_operator1\": \"CUT\",\n            \"sell_operator2\": \"DT\",\n            \"sell_real_num0\": 0.4,\n            \"sell_real_num1\": 0.2,\n            \"sell_real_num2\": 0.7,\n        }\n    }\n}\n# ######################## END SETTINGS ############################\n\n\ndef spell_finder(index, space):\n    return SPELLS[index][space+\"_params\"]\n\n\ndef normalize(df):\n    df = (df-df.min())/(df.max()-df.min())\n    return df\n\n\ndef gene_calculator(dataframe, indicator):\n    # Cuz Timeperiods not effect calculating CDL patterns recognations\n    if 'CDL' in indicator:\n        splited_indicator = indicator.split('-')\n        splited_indicator[1] = \"0\"\n        new_indicator = \"-\".join(splited_indicator)\n        # print(indicator, new_indicator)\n        indicator = new_indicator\n\n    gene = indicator.split(\"-\")\n\n    gene_name = gene[0]\n    gene_len = len(gene)\n\n    if indicator in dataframe.keys():\n        # print(f\"{indicator}, calculated befoure\")\n        # print(len(dataframe.keys()))\n        return dataframe[indicator]\n    else:\n        result = None\n        # For Pattern Recognations\n        if gene_len == 1:\n            # print('gene_len == 1\\t', indicator)\n            result = getattr(ta, gene_name)(\n                dataframe\n            )\n            return normalize(result)\n        elif gene_len == 2:\n            # print('gene_len == 2\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(result)\n        # For\n        elif gene_len == 3:\n            # print('gene_len == 3\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(result)\n        # For trend operators(MA-5-SMA-4)\n        elif gene_len == 4:\n            # print('gene_len == 4\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n        # For trend operators(STOCH-0-4-SMA-4)\n        elif gene_len == 5:\n            # print('gene_len == 5\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_index}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n\n\ndef condition_generator(dataframe, operator, indicator, crossed_indicator, real_num):\n\n    condition = (dataframe['volume'] > 10)\n\n    # TODO : it ill callculated in populate indicators.\n\n    dataframe[indicator] = gene_calculator(dataframe, indicator)\n    dataframe[crossed_indicator] = gene_calculator(\n        dataframe, crossed_indicator)\n\n    indicator_trend_sma = f\"{indicator}-SMA-{TREND_CHECK_CANDLES}\"\n    if operator in [\"UT\", \"DT\", \"OT\", \"CUT\", \"CDT\", \"COT\"]:\n        dataframe[indicator_trend_sma] = gene_calculator(\n            dataframe, indicator_trend_sma)\n\n    if operator == \">\":\n        condition = (\n            dataframe[indicator] > dataframe[crossed_indicator]\n        )\n    elif operator == \"=\":\n        condition = (\n            np.isclose(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"<\":\n        condition = (\n            dataframe[indicator] < dataframe[crossed_indicator]\n        )\n    elif operator == \"C\":\n        condition = (\n            (qtpylib.crossed_below(dataframe[indicator], dataframe[crossed_indicator])) |\n            (qtpylib.crossed_above(\n                dataframe[indicator], dataframe[crossed_indicator]))\n        )\n    elif operator == \"CA\":\n        condition = (\n            qtpylib.crossed_above(\n                dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"CB\":\n        condition = (\n            qtpylib.crossed_below(\n                dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \">R\":\n        condition = (\n            dataframe[indicator] > real_num\n        )\n    elif operator == \"=R\":\n        condition = (\n            np.isclose(dataframe[indicator], real_num)\n        )\n    elif operator == \"<R\":\n        condition = (\n            dataframe[indicator] < real_num\n        )\n    elif operator == \"/>R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) > real_num\n        )\n    elif operator == \"/=R\":\n        condition = (\n            np.isclose(dataframe[indicator].div(\n                dataframe[crossed_indicator]), real_num)\n        )\n    elif operator == \"/<R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) < real_num\n        )\n    elif operator == \"UT\":\n        condition = (\n            dataframe[indicator] > dataframe[indicator_trend_sma]\n        )\n    elif operator == \"DT\":\n        condition = (\n            dataframe[indicator] < dataframe[indicator_trend_sma]\n        )\n    elif operator == \"OT\":\n        condition = (\n\n            np.isclose(dataframe[indicator], dataframe[indicator_trend_sma])\n        )\n    elif operator == \"CUT\":\n        condition = (\n            (\n                qtpylib.crossed_above(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] > dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"CDT\":\n        condition = (\n            (\n                qtpylib.crossed_below(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] < dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"COT\":\n        condition = (\n            (\n                (\n                    qtpylib.crossed_below(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                ) |\n                (\n                    qtpylib.crossed_above(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                )\n            ) &\n            (\n                np.isclose(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            )\n        )\n\n    return condition, dataframe\n\n\nclass DevilStra(IStrategy):\n    # #################### RESULT PASTE PLACE ####################\n    # 16/16:    108 trades. 75/18/15 Wins/Draws/Losses. Avg profit   7.77%. Median profit   8.89%. Total profit  0.08404983 BTC (  84.05Σ%). Avg duration 3 days, 6:49:00 min. Objective: -11.22849\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_spell\": \"Zi,Lu,Ra,Ra,La,Si,Pa,Si,Cu,La,De,Lu,De,La,Zi,Zi,Zi,Zi,Zi,Lu,Lu,Lu,Si,La,Ra,Pa,La,Zi,Zi,Gu,Ra,De,Gu,Zi,Ra,Ra,Ra,Cu,Pa,De,De,La,Lu,Lu,Lu,La,Zi,Cu,Ra,Gu,Pa,La,Zi,Zi,Si,Lu,Ra,Cu,Cu,Pa,Si,Gu,De,De,Lu,Gu,Zi,Pa,Lu,Pa,Ra,Gu,Cu,La,Pa,Lu,Zi,La,Zi,Gu,Zi,De,Cu,Ra,Lu,Ra,Gu,Si,Ra,La,La,Lu,Gu,Zi,Si,La,Pa,Pa,Cu,Cu,Zi,Gu,Pa,Zi,Pa,Cu,Lu,Pa,Si,De,Gu,Lu,Lu,Cu,Ra,Si,Pa,Gu,Si,Cu,Pa,Zi,Pa,Zi,Gu,Lu,Ra,Pa,Ra,De,Ra,Pa,Zi,La,Pa,De,Pa,Cu,Gu,De,Lu,La,Ra,Zi,Si,Zi,Zi,Cu,Cu,De,Pa,Pa,Zi,De,Ra,La,Lu,De,Lu,Gu,Cu,Cu,La,De,Gu,Lu,Ra,Pa,Lu,Cu,Pa,Pa,De,Si,Zi,Cu,De,De,De,Lu,Si,Zi,Gu,Si,Si,Ra,Pa,Si,La,La,Lu,Lu,De,Gu,Gu,Zi,Ra,La,Lu,Lu,La,Si,Zi,Si,Zi,Si,Lu,Cu,Zi,Lu,De,La,Ra,Ra,Lu,De,Pa,Zi,Gu,Cu,Zi,Pa,De,Si,Lu,De,Cu,De,Zi,Ra,Gu,De,Si,Lu,Lu,Ra,De,Gu,Cu,Gu,La,De,Lu,Lu,Si,Cu,Lu,Zi,Lu,Cu,Gu,Lu,Lu,Ra,Si,Ra,Pa,Lu,De,Ra,Zi,Gu,Gu,Zi,Lu,Cu,Cu,Cu,Lu\",\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_spell\": \"La,Pa,De,De,La,Si,Si,La,La,La,Si,Pa,Pa,Lu,De,Cu,Cu,Gu,Lu,Ra,Lu,Si,Ra,De,La,Cu,La,La,Gu,La,De,Ra,Ra,Ra,Gu,Lu,Si,Si,Zi,Zi,La,Pa,Pa,Zi,Cu,Gu,Gu,Pa,Gu,Cu,Si,Ra,Ra,La,Gu,De,Si,La,Ra,Pa,Si,Lu,Pa,De,Zi,De,Lu,Si,Gu,De,Lu,De,Ra,Ra,Zi,De,Cu,Zi,Gu,Pa,Ra,De,Pa,De,Pa,Ra,Si,Si,Zi,Cu,Lu,Zi,Ra,De,Ra,Zi,Zi,Pa,Lu,Zi,Cu,Pa,Gu,Pa,Cu,De,Zi,De,De,Pa,Pa,Zi,Lu,Ra,Pa,Ra,Lu,Zi,Gu,Zi,Si,Lu,Ra,Ra,Zi,Lu,Pa,Lu,Si,Pa,Pa,Pa,Si,Zi,La,La,Lu,De,Zi,Gu,Ra,Ra,Ra,Zi,Pa,Zi,Cu,Lu,Gu,Cu,De,Lu,Gu,Lu,Gu,Si,Pa,Pa,Si,La,Gu,Ra,Pa,Si,Si,Si,Cu,Cu,Cu,Si,De,Lu,Gu,Gu,Lu,De,Ra,Gu,Gu,Gu,Cu,La,De,Cu,Zi,Pa,Si,De,Pa,Pa,Pa,La,De,Gu,Zi,La,De,Cu,La,Pa,Ra,Si,Si,Zi,Cu,Ra,Pa,Gu,Pa,Ra,Zi,De,Zi,Gu,Gu,Pa,Cu,Lu,Gu,De,Si,Pa,La,Cu,Zi,Gu,De,Gu,La,Cu,Gu,De,Cu,Cu,Gu,Ra,Lu,Zi,De,La,Ra,Pa,Pa,Si,La,Lu,La,De,De,Ra,De,La,La,Pa,Cu,Lu,Pa,Ra,Pa,Pa,Cu,Zi,Gu,Cu,Gu,La,Si,Ra,Pa\",\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.574,\n        \"1757\": 0.158,\n        \"3804\": 0.089,\n        \"6585\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.28\n    # #################### END OF RESULT PLACE ####################\n\n    # 𝖂𝖔𝖗𝖘𝖙, 𝖀𝖓𝖎𝖉𝖊𝖆𝖑, 𝕾𝖚𝖇𝖔𝖕𝖙𝖎𝖒𝖆𝖑, 𝕸𝖆𝖑𝖆𝖕𝖗𝖔𝖕𝖔𝖘 𝕬𝖓𝖉 𝕯𝖎𝖘𝖒𝖆𝖑 𝖙𝖎𝖒𝖊𝖋𝖗𝖆𝖒𝖊 𝖋𝖔𝖗 𝖙𝖍𝖎𝖘 𝖘𝖙𝖗𝖆𝖙𝖊𝖌𝖞:\n    timeframe = '4h'\n\n    spell_pot = [\n        \",\".join(\n            tuple(\n                random.choices(\n                    list(SPELLS.keys()),\n                    # TODO: k will be change to len(pairlist)\n                    k=PAIR_LIST_LENGHT\n                )\n            )\n        )for i in range(PAIN_RANGE)\n    ]\n\n    buy_spell = CategoricalParameter(\n        spell_pot, default=spell_pot[0], space='buy')\n    sell_spell = CategoricalParameter(\n        spell_pot, default=spell_pot[0], space='sell')\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        pairs = self.dp.current_whitelist()\n        pairs_len = len(pairs)\n        pair_index = pairs.index(metadata['pair'])\n\n        buy_spells = self.buy_spell.value.split(\",\")\n        buy_spells_len = len(buy_spells)\n\n        if pairs_len > buy_spells_len:\n            print(\n                f\"First set PAIR_LIST_LENGHT={pairs_len + 1} And re-hyperopt the\")\n            print(\"Buy strategy And paste result in exact place(lines 535~564)\")\n            print(\"IMPORTANT: You Need An 'STATIC' Pairlist On Your Config.json !!!\")\n            exit()\n\n        buy_params_index = buy_spells[pair_index]\n\n        params = spell_finder(buy_params_index, 'buy')\n        conditions = list()\n        # TODO: Its not dry code!\n        buy_indicator = params['buy_indicator0']\n        buy_crossed_indicator = params['buy_crossed_indicator0']\n        buy_operator = params['buy_operator0']\n        buy_real_num = params['buy_real_num0']\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n        # backup\n        buy_indicator = params['buy_indicator1']\n        buy_crossed_indicator = params['buy_crossed_indicator1']\n        buy_operator = params['buy_operator1']\n        buy_real_num = params['buy_real_num1']\n\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        buy_indicator = params['buy_indicator2']\n        buy_crossed_indicator = params['buy_crossed_indicator2']\n        buy_operator = params['buy_operator2']\n        buy_real_num = params['buy_real_num2']\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        # print(len(dataframe.keys()))\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        pairs = self.dp.current_whitelist()\n        pairs_len = len(pairs)\n        pair_index = pairs.index(metadata['pair'])\n\n        sell_spells = self.sell_spell.value.split(\",\")\n        sell_spells_len = len(sell_spells)\n\n        if pairs_len > sell_spells_len:\n            print(\n                f\"First set PAIR_LIST_LENGHT={pairs_len + 1} And re-hyperopt the\")\n            print(\"Sell strategy And paste result in exact place(lines 535~564)\")\n            print(\"IMPORTANT: You Need An 'STATIC' Pairlist On Your Config.json !!!\")\n            exit()\n\n        sell_params_index = sell_spells[pair_index]\n\n        params = spell_finder(sell_params_index, 'sell')\n\n        conditions = list()\n        # TODO: Its not dry code!\n        sell_indicator = params['sell_indicator0']\n        sell_crossed_indicator = params['sell_crossed_indicator0']\n        sell_operator = params['sell_operator0']\n        sell_real_num = params['sell_real_num0']\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = params['sell_indicator1']\n        sell_crossed_indicator = params['sell_crossed_indicator1']\n        sell_operator = params['sell_operator1']\n        sell_real_num = params['sell_real_num1']\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = params['sell_indicator2']\n        sell_crossed_indicator = params['sell_crossed_indicator2']\n        sell_operator = params['sell_operator2']\n        sell_real_num = params['sell_real_num2']\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n        return dataframe\n"
  },
  {
    "path": "strategies/Diamond/Diamond.py",
    "content": "# 𝐼𝓉 𝒾𝓈 𝒟𝒾𝒶𝓂𝑜𝓃𝒹 𝒮𝓉𝓇𝒶𝓉𝑒𝑔𝓎.\n# 𝒯𝒽𝒶𝓉 𝓉𝒶𝓀𝑒𝓈 𝒽𝑒𝓇 𝑜𝓌𝓃 𝓇𝒾𝑔𝒽𝓉𝓈 𝓁𝒾𝓀𝑒 𝒜𝒻𝑔𝒽𝒶𝓃𝒾𝓈𝓉𝒶𝓃 𝓌𝑜𝓂𝑒𝓃\n# 𝒯𝒽𝑜𝓈𝑒 𝓌𝒽𝑜 𝓈𝓉𝒾𝓁𝓁 𝓅𝓇𝑜𝓊𝒹 𝒶𝓃𝒹 𝒽𝑜𝓅𝑒𝒻𝓊𝓁.\n# 𝒯𝒽𝑜𝓈𝑒 𝓌𝒽𝑜 𝓉𝒽𝑒 𝓂𝑜𝓈𝓉 𝒷𝑒𝒶𝓊𝓉𝒾𝒻𝓊𝓁 𝒸𝓇𝑒𝒶𝓉𝓊𝓇𝑒𝓈 𝒾𝓃 𝓉𝒽𝑒 𝒹𝑒𝓅𝓉𝒽𝓈 𝑜𝒻 𝓉𝒽𝑒 𝒹𝒶𝓇𝓀𝑒𝓈𝓉.\n# 𝒯𝒽𝑜𝓈𝑒 𝓌𝒽𝑜 𝓈𝒽𝒾𝓃𝑒 𝓁𝒾𝓀𝑒 𝒹𝒾𝒶𝓂𝑜𝓃𝒹𝓈 𝒷𝓊𝓇𝒾𝑒𝒹 𝒾𝓃 𝓉𝒽𝑒 𝒽𝑒𝒶𝓇𝓉 𝑜𝒻 𝓉𝒽𝑒 𝒹𝑒𝓈𝑒𝓇𝓉 ...\n# 𝒲𝒽𝓎 𝓃𝑜𝓉 𝒽𝑒𝓁𝓅 𝓌𝒽𝑒𝓃 𝓌𝑒 𝒸𝒶𝓃?\n# 𝐼𝒻 𝓌𝑒 𝒷𝑒𝓁𝒾𝑒𝓋𝑒 𝓉𝒽𝑒𝓇𝑒 𝒾𝓈 𝓃𝑜 𝓂𝒶𝓃 𝓁𝑒𝒻𝓉 𝓌𝒾𝓉𝒽 𝓉𝒽𝑒𝓂\n# (𝒲𝒽𝒾𝒸𝒽 𝒾𝓈 𝓅𝓇𝑜𝒷𝒶𝒷𝓁𝓎 𝓉𝒽𝑒 𝓅𝓇𝑜𝒹𝓊𝒸𝓉 𝑜𝒻 𝓉𝒽𝑒 𝓉𝒽𝑜𝓊𝑔𝒽𝓉 𝑜𝒻 𝓅𝒶𝒾𝓃𝓁𝑒𝓈𝓈 𝒸𝑜𝓇𝓅𝓈𝑒𝓈)\n# 𝒲𝒽𝑒𝓇𝑒 𝒽𝒶𝓈 𝑜𝓊𝓇 𝒽𝓊𝓂𝒶𝓃𝒾𝓉𝓎 𝑔𝑜𝓃𝑒?\n# 𝒲𝒽𝑒𝓇𝑒 𝒽𝒶𝓈 𝒽𝓊𝓂𝒶𝓃𝒾𝓉𝓎 𝑔𝑜𝓃𝑒?\n# 𝒲𝒽𝓎 𝓃𝑜𝓉 𝒽𝑒𝓁𝓅 𝓌𝒽𝑒𝓃 𝓌𝑒 𝒸𝒶𝓃?\n# 𝓁𝑒𝓉𝓈 𝓅𝒾𝓅 𝓊𝓃𝒾𝓃𝓈𝓉𝒶𝓁𝓁 𝓉𝒶-𝓁𝒾𝒷 𝑜𝓃 𝒜𝒻𝑔𝒽𝒶𝓃𝒾𝓈𝓉𝒶𝓃\n\n# IMPORTANT: Diamond strategy is designed to be pure and\n# cuz of that it have not any indicator population. idea is that\n# It is just use the pure dataframe ohlcv data for calculation\n# of buy/sell signals, But you can add your indicators and add\n# your key names inside catagorical hyperoptable params and\n# than you be able to hyperopt them as well.\n# thanks to: @Kroissan, @drakes00 And @xmatthias for his patience and helps\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# * freqtrade backtesting --strategy Diamond\n\n# freqtrade hyperopt --hyperopt-loss ShortTradeDurHyperOptLoss --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n# *    3/10:     76 trades. 51/18/7 Wins/Draws/Losses. Avg profit   1.92%. Median profit   2.40%. Total profit  0.04808472 BTC (  48.08%). Avg duration 5:06:00 min. Objective: 1.75299\n# freqtrade hyperopt --hyperopt-loss OnlyProfitHyperOptLoss --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n# *   10/10:     76 trades. 39/34/3 Wins/Draws/Losses. Avg profit   0.61%. Median profit   0.05%. Total profit  0.01528359 BTC (  15.28%). Avg duration 17:32:00 min. Objective: -0.01528\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n# *    4/10:     15 trades. 10/2/3 Wins/Draws/Losses. Avg profit   1.52%. Median profit   7.99%. Total profit  0.00754274 BTC (   7.54%). Avg duration 1 day, 0:04:00 min. Objective: -0.90653\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLossDaily --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n# *    7/10:    130 trades. 68/54/8 Wins/Draws/Losses. Avg profit   0.71%. Median profit   0.06%. Total profit  0.03050369 BTC (  30.50%). Avg duration 10:07:00 min. Objective: -11.08185\n# freqtrade hyperopt --hyperopt-loss SortinoHyperOptLoss --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n# *    2/10:     10 trades. 7/0/3 Wins/Draws/Losses. Avg profit   5.50%. Median profit   7.05%. Total profit  0.01817970 BTC (  18.18%). Avg duration 0:27:00 min. Objective: -11.72450\n# freqtrade hyperopt --hyperopt-loss SortinoHyperOptLossDaily --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n#   | * Best |    3/10 |      165 |     98   63    4 |        1.00% |    0.05453885 BTC   (54.54%) | 0 days 08:02:00 |    0.00442974 BTC   (13.41%) |     -41.371 |\n#   | * Best |    7/10 |      101 |     56   42    3 |        0.73% |    0.02444518 BTC   (24.45%) | 0 days 13:08:00 |    0.00107122 BTC    (3.24%) |    -66.7687 |\n# *    7/10:    101 trades. 56/42/3 Wins/Draws/Losses. Avg profit   0.73%. Median profit   0.13%. Total profit  0.02444518 BTC (  24.45%). Avg duration 13:08:00 min. Objective: -66.76866\n# freqtrade hyperopt --hyperopt-loss OnlyProfitHyperOptLoss --spaces buy sell roi trailing stoploss --strategy Diamond -j 2 -e 10\n# *    7/10:    117 trades. 74/41/2 Wins/Draws/Losses. Avg profit   1.91%. Median profit   1.50%. Total profit  0.07370921 BTC (  73.71%). Avg duration 9:26:00 min. Objective: -0.07371\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n# Add your lib to import here\nimport talib.abstract as ta\nfrom functools import reduce\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Diamond(IStrategy):\n    # ###################### RESULT PLACE ######################\n    #    Config: 5 x UNLIMITED STOCK costume pair list,\n    #    hyperopt : 5000 x SortinoHyperOptLossDaily,\n    #    34/5000: 297 trades. 136/156/5 Wins/Draws/Losses. Avg profit   0.49%. Median profit   0.00%. Total profit  45.84477237 USDT (  33.96Σ%). Avg duration 11:54:00 min. Objective: -46.50379\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fast_key\": \"high\",\n        \"buy_horizontal_push\": 7,\n        \"buy_slow_key\": \"volume\",\n        \"buy_vertical_push\": 0.942,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fast_key\": \"high\",\n        \"sell_horizontal_push\": 10,\n        \"sell_slow_key\": \"low\",\n        \"sell_vertical_push\": 1.184,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.242,\n        \"13\": 0.044,\n        \"51\": 0.02,\n        \"170\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.271\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.011\n    trailing_stop_positive_offset = 0.054\n    trailing_only_offset_is_reached = False\n    # timeframe\n    timeframe = '5m'\n    # #################### END OF RESULT PLACE ####################\n\n    buy_vertical_push = DecimalParameter(0.5, 1.5, decimals=3, default=1, space='buy')\n    buy_horizontal_push = IntParameter(0, 10, default=0, space='buy')\n    buy_fast_key = CategoricalParameter(['open', 'high', 'low', 'close', 'volume',\n                                         #  you can not enable this lines befour you\n                                         #  populate an indicator for them and set\n                                         #  the same key name for it\n                                         #  'ma_fast', 'ma_slow', {...}\n                                         ], default='ma_fast', space='buy')\n    buy_slow_key = CategoricalParameter(['open', 'high', 'low', 'close', 'volume',\n                                         #  'ma_fast', 'ma_slow', {...}\n                                         ], default='ma_slow', space='buy')\n\n    sell_vertical_push = DecimalParameter(0.5, 1.5, decimals=3,  default=1, space='sell')\n    sell_horizontal_push = IntParameter(0, 10, default=0, space='sell')\n    sell_fast_key = CategoricalParameter(['open', 'high', 'low', 'close', 'volume',\n                                          #  'ma_fast', 'ma_slow', {...}\n                                          ], default='ma_fast', space='sell')\n    sell_slow_key = CategoricalParameter(['open', 'high', 'low', 'close', 'volume',\n                                          #  'ma_fast', 'ma_slow', {...}\n                                          ], default='ma_slow', space='sell')\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # you can add new indicators and enable them inside\n        # hyperoptable categorical params on the top\n        # dataframe['ma_fast'] = ta.SMA(dataframe, timeperiod=9)\n        # dataframe['ma_slow'] = ta.SMA(dataframe, timeperiod=18)\n        # dataframe['{...}'] = ta.{...}(dataframe, timeperiod={...})\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n            qtpylib.crossed_above\n            (\n                dataframe[self.buy_fast_key.value].shift(self.buy_horizontal_push.value),\n                dataframe[self.buy_slow_key.value] * self.buy_vertical_push.value\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n            qtpylib.crossed_below\n            (\n                dataframe[self.sell_fast_key.value].shift(self.sell_horizontal_push.value),\n                dataframe[self.sell_slow_key.value] * self.sell_vertical_push.value\n            )\n        )\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n        return dataframe\n"
  },
  {
    "path": "strategies/Divergences/Divergences.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Divergences(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n        # ROI table:\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 1\n    }\n\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.1\n\n    # Trailing stoploss\n    trailing_stop = True\n    # trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.05\n    trailing_stop_positive_offset = 0.2\n    trailing_only_offset_is_reached = True\n\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n\n        #divergences\n        #     - -   - -\n        #         -\n        #     4 3 2 1 0\n\n        #src[4] > src[2] and src[3] > src[2] and src[2] < src[1] and src[2] < src[0]\n        dataframe['bullish_div'] = (\n                                        ( dataframe['close'].shift(4) > dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(3) > dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(2) < dataframe['close'].shift(1) ) &\n                                        ( dataframe['close'].shift(2) < dataframe['close'] )\n                                   )\n\n\n\n\n        #queremos el volumen medio de las ultimas 24 velas, si es mayor queremos comprar, si es que no es volumen a la baja, esto habria que compararlo tomando el precio unas horas antes\n        dataframe['mean24volume'] = dataframe.volume.rolling(24).mean()\n\n        dataframe['mean68close'] = dataframe.close.rolling(68).mean()\n\n        #         -\n        #     - -   - -\n        #     4 3 2 1 0\n        #src[4] < src[2] and src[3] < src[2] and src[2] > src[1] and src[2] > src[0]\n\n        dataframe['bearish_div'] = (\n                                        ( dataframe['close'].shift(4) < dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(3) < dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(2) > dataframe['close'].shift(1) ) &\n                                        ( dataframe['close'].shift(2) > dataframe['close'] )\n                                    )\n\n        dataframe['cci_one'] = ta.CCI(dataframe, timeperiod=170)\n        dataframe['cci_two'] = ta.CCI(dataframe, timeperiod=34)\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) /\n        #     dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        return dataframe\n\n    # longCond = MACD > signalMACD and k > 50 and xRSI > 50\n    # shortCond = MACD < signalMACD\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (\n                    (dataframe['rsi'] <= 40) &\n                    (dataframe['bullish_div'])\n                )\n\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['bearish_div'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Dracula/Dracula.py",
    "content": "\nfrom freqtrade.strategy import DecimalParameter, IntParameter\n\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\nfrom pandas import DataFrame, Series\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\nimport talib.abstract as taa\nimport ta\nfrom functools import reduce\nimport numpy as np\n\n\n###########################################################################################################\n##                Dracula by 6h057                                                                       ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 1  open trade, with unlimited stake.              ##\n##   A pairlist with  80 pairs. Volume pairlist works well.                                              ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (should be 5m).                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = taa.EMA(df, timeperiod=ema_length)\n    ema2 = taa.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\nclass SupResFinder():\n    def isSupport(self, df, i):\n        support = df['bb_bbl_i'][i] == 1 and (\n            df['bb_bbl_i'][i+1] == 0 or df['close'][i+1] > df['open'][i+1]) and df['close'][i] < df['open'][i]\n\n        return support\n\n    def isResistance(self, df, i):\n        resistance = df['bb_bbh_i'][i] == 1 and (\n            df['bb_bbh_i'][i+1] == 0 or df['close'][i+1] < df['open'][i+1]) and df['close'][i] > df['open'][i]\n\n        return resistance\n\n    def getSupport(self, df):\n        levels = [df['close'][0]]\n\n        for i in range(1, df.shape[0]-2):\n            if self.isSupport(df, i):\n                o = df['open'][i]\n                c = df['close'][i]\n                l = c if c < o else o\n                levels.append(l)\n            else:\n                levels.append(levels[-1])\n        levels.append(levels[-1])\n        levels.append(levels[-1])\n        return levels\n\n    def getResistance(self, df):\n        levels = [df['open'][0]]\n\n        for i in range(1, df.shape[0]-2):\n            if self.isResistance(df, i):\n                o = df['open'][i]\n                c = df['close'][i]\n                l = c if c > o else o\n                levels.append(l)\n            else:\n                levels.append(levels[-1])\n        levels.append(levels[-1])\n        levels.append(levels[-1])\n        return levels\n\n\nclass Dracula(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_bbt\": 0.035,\n        \"ewo_high\": 5.638,\n        \"ewo_low\": -19.993,\n        \"low_offset\": 0.978,\n        \"rsi_buy\": 61,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"high_offset\": 1.006\n    }\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    info_timeframe = \"5m\"\n    # Stoploss:\n    stoploss = -0.2\n    min_lost = -0.005\n\n    buy_bbt = DecimalParameter(\n        0, 100, decimals=4, default=0.023, space='buy')\n    # Buy hypers\n    timeframe = '1m'\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n    custom_info = {}\n    supResFinder = SupResFinder()\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['bb_bbh'] = ta.volatility.bollinger_hband(close=dataframe[\"close\"], window=20)\n        dataframe['bb_bbl'] = ta.volatility.bollinger_lband(close=dataframe[\"close\"], window=20)\n\n        dataframe['bb_bbh_i'] = dataframe['high'] >= dataframe['bb_bbh']\n        dataframe['bb_bbl_i'] = ta.volatility.bollinger_lband_indicator(\n            close=dataframe[\"low\"], window=20)\n        dataframe['bb_bbt'] = (dataframe['bb_bbh'] - dataframe['bb_bbl']) / dataframe['bb_bbh']\n\n        dataframe['ema'] = taa.EMA(dataframe, timeperiod=150)\n        dataframe['resistance'] = self.supResFinder.getResistance(dataframe)\n        dataframe['support'] = self.supResFinder.getSupport(dataframe)\n\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # RSI\n        dataframe['rsi'] = taa.RSI(dataframe, timeperiod=14)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        prev = dataframe.shift(1)\n        prev1 = dataframe.shift(2)\n        lost_protect = (dataframe['ema'] > (dataframe['close'] * 1.07)).rolling(10).sum() == 0\n\n        item_buy_logic = []\n        item_buy_logic.append(dataframe['volume'] > 0)\n        item_buy_logic.append(dataframe['cmf'] > 0)\n        item_buy_logic.append(prev['bb_bbl_i'] == 1)\n        item_buy_logic.append(prev['close'] >= prev1['support'])\n        item_buy_logic.append(prev['ema'] < prev['close'])\n        item_buy_logic.append((dataframe['open'] < dataframe['close']))\n        item_buy_logic.append(prev['open'] > prev['close'])\n        item_buy_logic.append((dataframe['bb_bbt'] > self.buy_bbt.value))\n        item_buy_logic.append(lost_protect)\n        dataframe.loc[\n            reduce(lambda x, y: x & y, item_buy_logic),\n            ['buy', 'buy_tag']] = (1, f'buy_1')\n\n        item_buy_logic = []\n        item_buy_logic.append(dataframe['volume'] > 0)\n        item_buy_logic.append(dataframe['cmf'] > 0)\n        item_buy_logic.append(dataframe['bb_bbl_i'] == 1)\n        item_buy_logic.append(dataframe['open'] >= prev1['support'])\n        item_buy_logic.append(prev['ema'] < prev['close'])\n        item_buy_logic.append((dataframe['open'] < dataframe['close']))\n        item_buy_logic.append((dataframe['bb_bbt'] > self.buy_bbt.value))\n        item_buy_logic.append(lost_protect)\n        dataframe.loc[\n            reduce(lambda x, y: x & y, item_buy_logic),\n            ['buy', 'buy_tag']] = (1, f'buy_2')\n\n        return dataframe\n\n    def custom_sell(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        prev_candle = dataframe.iloc[-2].squeeze()\n        prev1_candle = dataframe.iloc[-3].squeeze()\n        if prev_candle['bb_bbh_i'] == 1 \\\n                and last_candle['close'] < last_candle['open'] \\\n                and prev_candle['close'] > prev_candle['open'] \\\n                and prev_candle['close'] < prev1_candle['resistance'] \\\n                and last_candle['volume'] > 0:\n            return 'sell_signal_1_'+trade.buy_tag\n        elif last_candle['bb_bbh_i'] == 1 \\\n                and last_candle['close'] < last_candle['open'] \\\n                and last_candle['open'] < prev1_candle['resistance'] \\\n                and last_candle['volume'] > 0:\n            return 'sell_signal_2_'+trade.buy_tag\n        elif last_candle['close'] < last_candle['open'] \\\n            and last_candle['ema'] > (last_candle['close'] * 1.07) \\\n                and last_candle['volume'] > 0:\n            return 'stop_loss_'+trade.buy_tag\n        elif (last_candle['close'] < last_candle['open']) and (last_candle['close'] <= (last_candle['bb_bbl'] * 1.002)) and current_profit >= 0:\n            return 'take_profit_'+trade.buy_tag\n        elif 'sma' in trade.buy_tag and current_profit >= 0.01:\n            return 'sma'\n        elif 'sma' in trade.buy_tag  and (last_candle['close'] > (last_candle['ema_49'] * self.high_offset.value)):\n            return 'stop_loss_sma'\n        return None\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Dyna_opti/Dyna_opti.py",
    "content": "import numpy as np\r\nimport talib.abstract as ta\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport arrow\r\n\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom freqtrade.strategy import merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\r\nfrom typing import Dict, List, Optional, Tuple\r\nfrom pandas import DataFrame, Series\r\nfrom functools import reduce\r\nfrom datetime import datetime, timedelta\r\nfrom freqtrade.persistence import Trade\r\n\r\n# Get rid of pandas warnings during backtesting\r\nimport pandas as pd  \r\npd.options.mode.chained_assignment = None  # default='warn'\r\n\r\n# Strategy specific imports, files must reside in same folder as strategy\r\nimport sys\r\nfrom pathlib import Path\r\nsys.path.append(str(Path(__file__).parent))\r\n\r\nimport numpy as np\r\nimport talib.abstract as ta\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\n\r\nfrom pandas import DataFrame, Series\r\n\r\n\r\n\"\"\"\r\nMisc. Helper Functions\r\n\"\"\"\r\ndef same_length(bigger, shorter):\r\n    return np.concatenate((np.full((bigger.shape[0] - shorter.shape[0]), np.nan), shorter))\r\n\r\n\"\"\"\r\nMaths\r\n\"\"\"\r\ndef linear_growth(start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\r\n    \"\"\"\r\n    Simple linear growth function. Grows from start to end after end_time minutes (starts after start_time minutes)\r\n    \"\"\"\r\n    time = max(0, trade_time - start_time)\r\n    rate = (end - start) / (end_time - start_time)\r\n\r\n    return min(end, start + (rate * time))\r\n\r\ndef linear_decay(start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\r\n    \"\"\"\r\n    Simple linear decay function. Decays from start to end after end_time minutes (starts after start_time minutes)\r\n    \"\"\"\r\n    time = max(0, trade_time - start_time)\r\n    rate = (start - end) / (end_time - start_time)\r\n\r\n    return max(end, start - (rate * time))\r\n\r\n\"\"\"\r\nTA Indicators\r\n\"\"\"\r\n\r\ndef zema(dataframe, period, field='close'):\r\n    \"\"\"\r\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/overlap_studies.py#L79\r\n    Modified slightly to use ta.EMA instead of technical ema\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['ema1'] = ta.EMA(df[field], timeperiod=period)\r\n    df['ema2'] = ta.EMA(df['ema1'], timeperiod=period)\r\n    df['d'] = df['ema1'] - df['ema2']\r\n    df['zema'] = df['ema1'] + df['d']\r\n\r\n    return df['zema']\r\n\r\ndef RMI(dataframe, *, length=20, mom=5):\r\n    \"\"\"\r\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\r\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\r\n\r\n    df.fillna(0, inplace=True)\r\n\r\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\r\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\r\n\r\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\r\n\r\n    return df[\"RMI\"]\r\n\r\ndef mastreak(dataframe: DataFrame, period: int = 4, field='close') -> Series:\r\n    \"\"\"\r\n    MA Streak\r\n    Port of: https://www.tradingview.com/script/Yq1z7cIv-MA-Streak-Can-Show-When-a-Run-Is-Getting-Long-in-the-Tooth/\r\n    \"\"\"    \r\n    df = dataframe.copy()\r\n\r\n    avgval = zema(df, period, field)\r\n\r\n    arr = np.diff(avgval)\r\n    pos = np.clip(arr, 0, 1).astype(bool).cumsum()\r\n    neg = np.clip(arr, -1, 0).astype(bool).cumsum()\r\n    streak = np.where(arr >= 0, pos - np.maximum.accumulate(np.where(arr <= 0, pos, 0)),\r\n                    -neg + np.maximum.accumulate(np.where(arr >= 0, neg, 0)))\r\n\r\n    res = same_length(df['close'], streak)\r\n\r\n    return res\r\n\r\ndef pcc(dataframe: DataFrame, period: int = 20, mult: int = 2):\r\n    \"\"\"\r\n    Percent Change Channel\r\n    PCC is like KC unless it uses percentage changes in price to set channel distance.\r\n    https://www.tradingview.com/script/6wwAWXA1-MA-Streak-Change-Channel/\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['previous_close'] = df['close'].shift()\r\n\r\n    df['close_change'] = (df['close'] - df['previous_close']) / df['previous_close'] * 100\r\n    df['high_change'] = (df['high'] - df['close']) / df['close'] * 100\r\n    df['low_change'] = (df['low'] - df['close']) / df['close'] * 100\r\n\r\n    df['delta'] = df['high_change'] - df['low_change']\r\n\r\n    mid = zema(df, period, 'close_change')\r\n    rangema = zema(df, period, 'delta')\r\n\r\n    upper = mid + rangema * mult\r\n    lower = mid - rangema * mult\r\n\r\n    return upper, rangema, lower\r\n\r\ndef SSLChannels(dataframe, length=10, mode='sma'):\r\n    \"\"\"\r\n    Source: https://www.tradingview.com/script/xzIoaIJC-SSL-channel/\r\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L1025\r\n    Usage:\r\n        dataframe['sslDown'], dataframe['sslUp'] = SSLChannels(dataframe, 10)\r\n    \"\"\"\r\n    if mode not in ('sma'):\r\n        raise ValueError(f\"Mode {mode} not supported yet\")\r\n\r\n    df = dataframe.copy()\r\n\r\n    if mode == 'sma':\r\n        df['smaHigh'] = df['high'].rolling(length).mean()\r\n        df['smaLow'] = df['low'].rolling(length).mean()\r\n\r\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1,\r\n                         np.where(df['close'] < df['smaLow'], -1, np.NAN))\r\n    df['hlv'] = df['hlv'].ffill()\r\n\r\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\r\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\r\n\r\n    return df['sslDown'], df['sslUp']\r\n\r\ndef SSLChannels_ATR(dataframe, length=7):\r\n    \"\"\"\r\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\r\n    Credit to @JimmyNixx for python\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['ATR'] = ta.ATR(df, timeperiod=14)\r\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\r\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\r\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\r\n    df['hlv'] = df['hlv'].ffill()\r\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\r\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\r\n\r\n    return df['sslDown'], df['sslUp']\r\n\r\ndef WaveTrend(dataframe, chlen=10, avg=21, smalen=4):\r\n    \"\"\"\r\n    WaveTrend Ocillator by LazyBear\r\n    https://www.tradingview.com/script/2KE8wTuF-Indicator-WaveTrend-Oscillator-WT/\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['hlc3'] = (df['high'] + df['low'] + df['close']) / 3\r\n    df['esa'] = ta.EMA(df['hlc3'], timeperiod=chlen)\r\n    df['d'] = ta.EMA((df['hlc3'] - df['esa']).abs(), timeperiod=chlen)\r\n    df['ci'] = (df['hlc3'] - df['esa']) / (0.015 * df['d'])\r\n    df['tci'] = ta.EMA(df['ci'], timeperiod=avg)\r\n\r\n    df['wt1'] = df['tci']\r\n    df['wt2'] = ta.SMA(df['wt1'], timeperiod=smalen)\r\n    df['wt1-wt2'] = df['wt1'] - df['wt2']\r\n\r\n    return df['wt1'], df['wt2']\r\n\r\ndef T3(dataframe, length=5):\r\n    \"\"\"\r\n    T3 Average by HPotter on Tradingview\r\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\r\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\r\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\r\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\r\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\r\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\r\n    b = 0.7\r\n    c1 = -b*b*b\r\n    c2 = 3*b*b+3*b*b*b\r\n    c3 = -6*b*b-3*b-3*b*b*b\r\n    c4 = 1+3*b+b*b*b+3*b*b\r\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\r\n\r\n    return df['T3Average']\r\n\r\n\r\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\r\n    df = dataframe.copy()\r\n\r\n    roc = ta.ROC(df, timeperiod=roclen)\r\n    ema = ta.EMA(df, timeperiod=emalen)\r\n    sroc = ta.ROC(ema, timeperiod=smooth)\r\n\r\n    return sroc\r\n\"\"\"\r\nSolipsis - By @werkkrew\r\n\r\nCredits - \r\n@JimmyNixx for many of the ideas used throughout as well as helping me stay motivated throughout development! \r\n@JoeSchr for documenting and doing the legwork of getting indicators to be available in the custom_stoploss\r\n\r\nWe ask for nothing in return except that if you make changes which bring you greater success than what has been provided, you share those ideas back to us\r\nand the rest of the community. Also, please don't nag us with a million questions and especially don't blame us if you lose a ton of money using this.\r\n\r\nWe take no responsibility for any success or failure you have using this strategy.\r\n\"\"\"\r\n\r\nclass Dyna_opti(IStrategy):\r\n\r\n    ## Buy Space Hyperopt Variables\r\n\r\n    # Base Pair Params\r\n    bbdelta_close = DecimalParameter(0.0, 0.1, default=0.025, space='buy')\r\n    closedelta_close = DecimalParameter(0.0, 0.5, default=0.018, space='buy')\r\n    tail_bbdelta = DecimalParameter(0.0, 1, default=0.945, space='buy')\r\n    inf_guard = CategoricalParameter(['lower', 'upper', 'both', 'none'], default='lower', space='buy', optimize=True)\r\n    inf_pct_adr_top = DecimalParameter(0.70, 0.99, default=0.792, space='buy')\r\n    inf_pct_adr_bot = DecimalParameter(0.01, 0.20, default=0.172, space='buy')\r\n\r\n    ## Sell Space Params are being \"hijacked\" for custom_stoploss and dynamic_roi\r\n\r\n    # Dynamic ROI\r\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default='any', space='sell', optimize=True)\r\n    droi_pullback = CategoricalParameter([True, False], default=False, space='sell', optimize=True)\r\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=0.015, space='sell')\r\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=True, space='sell', optimize=True)\r\n\r\n    # Custom Stoploss\r\n    cstp_threshold = DecimalParameter(-0.15, 0, default=-0.05, space='sell')\r\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default='time', space='sell', optimize=True)\r\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=--0.018, space='sell')\r\n    cstp_bail_time = IntParameter(720, 1440, default=961, space='sell')\r\n    \r\n    timeframe = '5m'\r\n    inf_timeframe = '1h'\r\n    \r\n    # Custom buy/sell parameters per pair\r\n    custom_pair_params = []\r\n\r\n    # Buy hyperspace params:\r\n    buy_params = {\r\n        'bbdelta_close': 0.025,\r\n        'closedelta_close': 0.018,\r\n        'inf_guard': 'lower',\r\n        'inf_pct_adr': 0.856,\r\n        'inf_pct_adr_bot': 0.172,\r\n        'inf_pct_adr_top': 0.792,\r\n        'tail_bbdelta': 0.945\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n        'cstp_bail_how': 'time',\r\n        'cstp_bail_roc': -0.018,\r\n        'cstp_bail_time': 961,\r\n        'cstp_threshold': -0.05,\r\n        'droi_pullback': False,\r\n        'droi_pullback_amount': 0.015,\r\n        'droi_pullback_respect_table': True,\r\n        'droi_trend_type': 'any'\r\n    }\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.18724,\r\n        \"20\": 0.04751,\r\n        \"30\": 0.02393,\r\n        \"72\": 0\r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.28819\r\n\r\n    # Enable or disable these as desired\r\n    # Must be enabled when hyperopting the respective spaces\r\n    use_dynamic_roi = True\r\n    use_custom_stoploss = True\r\n\r\n    # If custom_stoploss disabled\r\n    #stoploss = -0.234\r\n\r\n    # Recommended\r\n    use_sell_signal = False\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = True\r\n\r\n    # Required\r\n    startup_candle_count: int = 233\r\n    process_only_new_candles = False\r\n\r\n    # Strategy Specific Variable Storage\r\n    custom_trade_info = {}\r\n#    custom_fiat = \"USDT\" # Only relevant if stake is BTC or ETH\r\n#    custom_btc_inf = False # Don't change this.\r\n    \r\n    \"\"\"\r\n    Informative Pair Definitions\r\n    \"\"\"\r\n    def informative_pairs(self):\r\n        # add all whitelisted pairs on informative timeframe\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\r\n               \r\n        return informative_pairs\r\n\r\n    \"\"\"\r\n    Indicator Definitions\r\n    \"\"\" \r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        if not metadata['pair'] in self.custom_trade_info:\r\n            self.custom_trade_info[metadata['pair']] = {}\r\n\r\n        ## Base Timeframe / Pair\r\n\r\n        # strategy BinHV45\r\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=12, stds=2)\r\n        dataframe['bb_lowerband'] = bollinger['lower']\r\n        dataframe['bb_middleband'] = bollinger['mid']\r\n        dataframe['bb_upperband'] = bollinger['upper']\r\n        dataframe['bbdelta'] = (dataframe['bb_middleband'] - dataframe['bb_lowerband']).abs()\r\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\r\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\r\n\r\n        # Indicators for ROI and Custom Stoploss\r\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=24)\r\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)\r\n    \r\n        # RMI: https://www.tradingview.com/script/kwIt9OgQ-Relative-Momentum-Index/\r\n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\r\n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\r\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\r\n        # Momentum Pinball: https://www.tradingview.com/script/fBpVB1ez-Momentum-Pinball-Indicator/\r\n        dataframe['roc-mp'] = ta.ROC(dataframe, timeperiod=1)\r\n        dataframe['mp']  = ta.RSI(dataframe['roc-mp'], timeperiod=3)\r\n\r\n        # MA Streak: https://www.tradingview.com/script/Yq1z7cIv-MA-Streak-Can-Show-When-a-Run-Is-Getting-Long-in-the-Tooth/\r\n        dataframe['mastreak'] = mastreak(dataframe, period=4)\r\n\r\n        # Percent Change Channel: https://www.tradingview.com/script/6wwAWXA1-MA-Streak-Change-Channel/\r\n        upper, mid, lower = pcc(dataframe, period=40, mult=3)\r\n        dataframe['pcc-lowerband'] = lower\r\n        dataframe['pcc-upperband'] = upper\r\n\r\n        lookup_idxs = dataframe.index.values - (abs(dataframe['mastreak'].values) + 1)\r\n        valid_lookups = lookup_idxs >= 0\r\n        dataframe['sbc'] = np.nan\r\n        dataframe.loc[valid_lookups, 'sbc'] = dataframe['close'].to_numpy()[lookup_idxs[valid_lookups].astype(int)]\r\n\r\n        dataframe['streak-roc'] = 100 * (dataframe['close'] - dataframe['sbc']) / dataframe['sbc']\r\n\r\n        # Trends, Peaks and Crosses\r\n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\r\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)\r\n\r\n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \r\n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0)      \r\n\r\n        dataframe['rmi-dn'] = np.where(dataframe['rmi'] <= dataframe['rmi'].shift(),1,0)\r\n        dataframe['rmi-dn-count'] = dataframe['rmi-dn'].rolling(8).sum()\r\n\r\n        dataframe['streak-bo'] = np.where(dataframe['streak-roc'] < dataframe['pcc-lowerband'],1,0)\r\n        dataframe['streak-bo-count'] = dataframe['streak-bo'].rolling(8).sum()\r\n\r\n        # Indicators used only for ROI and Custom Stoploss\r\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\r\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\r\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')\r\n\r\n        # Base pair informative timeframe indicators\r\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\r\n        \r\n        # Get the \"average day range\" between the 1d high and 1d low to set up guards\r\n        informative['1d-high'] = informative['close'].rolling(24).max()\r\n        informative['1d-low'] = informative['close'].rolling(24).min()\r\n        informative['3d_low'] = informative['close'].rolling(72).min()\r\n        informative['adr'] = informative['1d-high'] - informative['1d-low']\r\n\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\r\n\r\n\r\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\r\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\r\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['rmi-slow'] = dataframe[['date', 'rmi-slow']].copy().set_index('date')\r\n\r\n        return dataframe\r\n\r\n    \"\"\"\r\n    Buy Signal\r\n    \"\"\" \r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        if self.inf_guard.value == 'upper' or self.inf_guard.value == 'both':\r\n            conditions.append(\r\n                (dataframe['close'] <= dataframe[f\"3d_low_{self.inf_timeframe}\"] + \r\n                (self.inf_pct_adr_top.value * dataframe[f\"adr_{self.inf_timeframe}\"]))\r\n            )\r\n\r\n        if self.inf_guard.value == 'lower' or self.inf_guard.value == 'both':\r\n            conditions.append(\r\n                (dataframe['close'] >= dataframe[f\"3d_low_{self.inf_timeframe}\"] + \r\n                (self.inf_pct_adr_bot.value * dataframe[f\"adr_{self.inf_timeframe}\"]))\r\n            )\r\n\r\n        # strategy BinHV45\r\n        conditions.append(\r\n            dataframe['bb_lowerband'].shift().gt(0) &\r\n            dataframe['bbdelta'].gt(dataframe['close'] * self.bbdelta_close.value) &\r\n            dataframe['closedelta'].gt(dataframe['close'] * self.closedelta_close.value) &\r\n            dataframe['tail'].lt(dataframe['bbdelta'] * self.tail_bbdelta.value) &\r\n            dataframe['close'].lt(dataframe['bb_lowerband'].shift()) &\r\n            dataframe['close'].le(dataframe['close'].shift())\r\n        )\r\n\r\n        conditions.append(dataframe['volume'].gt(0))\r\n\r\n        if conditions:\r\n            dataframe.loc[\r\n                reduce(lambda x, y: x & y, conditions),\r\n                'buy'] = 1\r\n\r\n        return dataframe\r\n\r\n    \"\"\"\r\n    Sell Signal\r\n    \"\"\"\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n  \r\n        dataframe['sell'] = 0\r\n\r\n        return dataframe\r\n\r\n    \"\"\"\r\n    Custom Stoploss\r\n    \"\"\" \r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\r\n        params = self.sell_params\r\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\r\n\r\n        if self.config['runmode'].value in ('live', 'dry_run'):\r\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\r\n            sroc = dataframe['sroc'].iat[-1]\r\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\r\n        else:\r\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\r\n\r\n        if current_profit < self.cstp_threshold.value:\r\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\r\n                # Dynamic bailout based on rate of change\r\n                if (sroc/100) <= self.cstp_bail_roc.value:\r\n                    return 0.001\r\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\r\n                # Dynamic bailout based on time\r\n                if trade_dur > self.cstp_bail_time.value:\r\n                    return 0.001\r\n                   \r\n        return 1\r\n\r\n    \"\"\"\r\n    Freqtrade ROI Overload for dynamic ROI functionality\r\n    \"\"\"\r\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\r\n        \r\n        params = self.sell_params\r\n        minimal_roi = self.minimal_roi\r\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\r\n\r\n        # see if we have the data we need to do this, otherwise fall back to the standard table\r\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\r\n            if self.config['runmode'].value in ('live', 'dry_run'):\r\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\r\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\r\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\r\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\r\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\r\n            else:\r\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\r\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\r\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\r\n\r\n            min_roi = table_roi\r\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\r\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\r\n            in_trend = False\r\n\r\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\r\n                if rmi_trend == 1:\r\n                    in_trend = True\r\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\r\n                if ssl_dir == 'up':\r\n                    in_trend = True\r\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\r\n                if candle_trend == 1:\r\n                    in_trend = True\r\n\r\n            # Force the ROI value high if in trend\r\n            if (in_trend == True):\r\n                min_roi = 100\r\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\r\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\r\n                    if self.droi_pullback_respect_table.value == True:\r\n                        min_roi = table_roi\r\n                    else:\r\n                        min_roi = current_profit / 2\r\n\r\n        else:\r\n            min_roi = table_roi\r\n\r\n        return trade_dur, min_roi\r\n\r\n    # Change here to allow loading of the dynamic_roi settings\r\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \r\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\r\n\r\n        if self.use_dynamic_roi:\r\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\r\n        else:\r\n            _, roi = self.min_roi_reached_entry(trade_dur)\r\n        if roi is None:\r\n            return False\r\n        else:\r\n            return current_profit > roi\r\n\r\n#\r\n    \"\"\"\r\n    Trade Timeout Overloads\r\n    \"\"\"\r\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\r\n        bid_strategy = self.config.get('bid_strategy', {})\r\n        ob = self.dp.orderbook(pair, 1)\r\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\r\n        if current_price > order['price'] * 1.01:\r\n            return True\r\n        return False\r\n\r\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\r\n        ask_strategy = self.config.get('ask_strategy', {})\r\n        ob = self.dp.orderbook(pair, 1)\r\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\r\n        if current_price < order['price'] * 0.99:\r\n            return True\r\n        return False\r\n\r\n    \"\"\"\r\n    Custom Methods\r\n    \"\"\"\r\n    # Get parameters for various settings on a per pair or group of pairs basis\r\n    # This function can probably be simplified dramatically\r\n    def get_pair_params(self, pair: str, params: str) -> Dict:\r\n        buy_params, sell_params = self.buy_params, self.sell_params\r\n        minimal_roi, dynamic_roi = self.minimal_roi, self.sell_params\r\n        custom_stop = self.sell_params\r\n  \r\n        if self.custom_pair_params:\r\n            # custom_params = next(item for item in self.custom_pair_params if pair in item['pairs'])\r\n            for item in self.custom_pair_params:\r\n                if 'pairs' in item and pair in item['pairs']:\r\n                    custom_params = item \r\n                    if 'buy_params' in custom_params:\r\n                        buy_params = custom_params['buy_params']\r\n                    if 'sell_params' in custom_params:\r\n                        sell_params = custom_params['sell_params']\r\n                    if 'minimal_roi' in custom_params:\r\n                        minimal_roi = custom_params['minimal_roi']\r\n                    if 'custom_stop' in custom_params:\r\n                        custom_stop = custom_params['custom_stop']\r\n                    if 'dynamic_roi' in custom_params:\r\n                        dynamic_roi = custom_params['dynamic_roi']\r\n                    break\r\n            \r\n        if params == 'buy':\r\n            return buy_params\r\n        if params == 'sell':\r\n            return sell_params\r\n        if params == 'minimal_roi':\r\n            return minimal_roi\r\n        if params == 'custom_stop':\r\n            return custom_stop\r\n        if params == 'dynamic_roi':\r\n            return dynamic_roi\r\n\r\n        return False\r\n\r\n    # Get the current price from the exchange (or local cache)\r\n    def get_current_price(self, pair: str, refresh: bool) -> float:\r\n        if not refresh:\r\n            rate = self.custom_current_price_cache.get(pair)\r\n            # Check if cache has been invalidated\r\n            if rate:\r\n                return rate\r\n\r\n        ask_strategy = self.config.get('ask_strategy', {})\r\n        if ask_strategy.get('use_order_book', False):\r\n            ob = self.dp.orderbook(pair, 1)\r\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\r\n        else:\r\n            ticker = self.dp.ticker(pair)\r\n            rate = ticker['last']\r\n\r\n        self.custom_current_price_cache[pair] = rate\r\n        return rate\r\n\r\n    \"\"\"\r\n    Stripped down version from Schism, meant only to update the price data a bit\r\n    more frequently than the default instead of getting all sorts of trade information\r\n    \"\"\"\r\n    def populate_trades(self, pair: str) -> dict:\r\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\r\n        if not pair in self.custom_trade_info:\r\n            self.custom_trade_info[pair] = {}\r\n\r\n        # init the temp dicts and set the trade stuff to false\r\n        trade_data = {}\r\n        trade_data['active_trade'] = False\r\n\r\n        # active trade stuff only works in live and dry, not backtest\r\n        if self.config['runmode'].value in ('live', 'dry_run'):\r\n            \r\n            # find out if we have an open trade for this pair\r\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\r\n\r\n            # if so, get some information\r\n            if active_trade:\r\n                # get current price and update the min/max rate\r\n                current_rate = self.get_current_price(pair, True)\r\n                active_trade[0].adjust_min_max_rates(current_rate)\r\n\r\n        return trade_data"
  },
  {
    "path": "strategies/EI3v2_tag_cofi_green/EI3v2_tag_cofi_green.py",
    "content": "# --- Do not remove these libs ---\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom typing import Dict, List\r\nfrom functools import reduce\r\nfrom pandas import DataFrame\r\n# --------------------------------\r\nimport talib.abstract as ta\r\nimport numpy as np\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport datetime\r\nfrom technical.util import resample_to_interval, resampled_merge\r\nfrom datetime import datetime, timedelta\r\nfrom freqtrade.persistence import Trade\r\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\r\nimport technical.indicators as ftt\r\nimport math\r\nimport logging\r\n\r\nlogger = logging.getLogger(__name__)\r\n\r\n# @Rallipanos # changes by IcHiAT\r\n\r\n\r\ndef EWO(dataframe, ema_length=5, ema2_length=3):\r\n    df = dataframe.copy()\r\n    ema1 = ta.EMA(df, timeperiod=ema_length)\r\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\r\n    emadif = (ema1 - ema2) / df['close'] * 100\r\n    return emadif\r\n\r\n\r\n\r\nclass EI3v2_tag_cofi_green(IStrategy):\r\n    INTERFACE_VERSION = 2\r\n    \"\"\"\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.08,\r\n        \"20\": 0.04,\r\n        \"40\": 0.032,\r\n        \"87\": 0.016,\r\n        \"201\": 0,\r\n        \"202\": -1\r\n    }\r\n    \"\"\"\r\n    # Buy hyperspace params:\r\n    buy_params = {\r\n        \"base_nb_candles_buy\": 12,\r\n        \"rsi_buy\": 58,\r\n        \"ewo_high\": 3.001,\r\n        \"ewo_low\": -10.289,\r\n        \"low_offset\": 0.987,\r\n        \"lambo2_ema_14_factor\": 0.981,\r\n        \"lambo2_enabled\": True,\r\n        \"lambo2_rsi_14_limit\": 39,\r\n        \"lambo2_rsi_4_limit\": 44,\r\n        \"buy_adx\": 20,\r\n        \"buy_fastd\": 20,\r\n        \"buy_fastk\": 22,\r\n        \"buy_ema_cofi\": 0.98,\r\n        \"buy_ewo_high\": 4.179\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n        \"base_nb_candles_sell\": 22,\r\n        \"high_offset\": 1.014,\r\n        \"high_offset_2\": 1.01\r\n    }\r\n\r\n    @property\r\n    def protections(self):\r\n        return [\r\n            {\r\n                \"method\": \"CooldownPeriod\",\r\n                \"stop_duration_candles\": 5\r\n            },\r\n            {\r\n                \"method\": \"MaxDrawdown\",\r\n                \"lookback_period_candles\": 48,\r\n                \"trade_limit\": 20,\r\n                \"stop_duration_candles\": 4,\r\n                \"max_allowed_drawdown\": 0.2\r\n            },\r\n            {\r\n                \"method\": \"StoplossGuard\",\r\n                \"lookback_period_candles\": 24,\r\n                \"trade_limit\": 4,\r\n                \"stop_duration_candles\": 2,\r\n                \"only_per_pair\": False\r\n            },\r\n            {\r\n                \"method\": \"LowProfitPairs\",\r\n                \"lookback_period_candles\": 6,\r\n                \"trade_limit\": 2,\r\n                \"stop_duration_candles\": 60,\r\n                \"required_profit\": 0.02\r\n            },\r\n            {\r\n                \"method\": \"LowProfitPairs\",\r\n                \"lookback_period_candles\": 24,\r\n                \"trade_limit\": 4,\r\n                \"stop_duration_candles\": 2,\r\n                \"required_profit\": 0.01\r\n            }\r\n        ]\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.99,\r\n        \r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.99\r\n\r\n    # SMAOffset\r\n    base_nb_candles_buy = IntParameter(8, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=False)\r\n    base_nb_candles_sell = IntParameter(8, 20, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False)\r\n    low_offset = DecimalParameter(0.985, 0.995, default=buy_params['low_offset'], space='buy', optimize=True)\r\n    high_offset = DecimalParameter(1.005, 1.015, default=sell_params['high_offset'], space='sell', optimize=True)\r\n    high_offset_2 = DecimalParameter(1.010, 1.020, default=sell_params['high_offset_2'], space='sell', optimize=True)\r\n\r\n    # lambo2\r\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3,  default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=True)\r\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=True)\r\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=True)\r\n\r\n    # Protection\r\n    fast_ewo = 50\r\n    slow_ewo = 200\r\n\r\n    ewo_low = DecimalParameter(-20.0, -8.0,default=buy_params['ewo_low'], space='buy', optimize=True)\r\n    ewo_high = DecimalParameter(3.0, 3.4, default=buy_params['ewo_high'], space='buy', optimize=True)\r\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=False)\r\n\r\n    # Trailing stop:\r\n    trailing_stop = True\r\n    trailing_stop_positive = 0.001\r\n    trailing_stop_positive_offset = 0.012\r\n    trailing_only_offset_is_reached = True\r\n\r\n    #cofi\r\n    is_optimize_cofi = False\r\n    buy_ema_cofi = DecimalParameter(0.96, 0.98, default=0.97 , optimize = is_optimize_cofi)\r\n    buy_fastk = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\r\n    buy_fastd = IntParameter(20, 30, default=20, optimize = is_optimize_cofi)\r\n    buy_adx = IntParameter(20, 30, default=30, optimize = is_optimize_cofi)\r\n    buy_ewo_high = DecimalParameter(2, 12, default=3.553, optimize = is_optimize_cofi)\r\n    \r\n\r\n    # Sell signal\r\n    use_sell_signal = True\r\n    sell_profit_only = True\r\n    sell_profit_offset = 0.01\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    ## Optional order time in force.\r\n    order_time_in_force = {\r\n        'buy': 'gtc',\r\n        'sell': 'gtc'\r\n    }\r\n\r\n    # Optimal timeframe for the strategy\r\n    timeframe = '5m'\r\n    inf_1h = '1h'\r\n\r\n    process_only_new_candles = True\r\n    startup_candle_count = 400\r\n\r\n    plot_config = {\r\n        'main_plot': {\r\n            'ma_buy': {'color': 'orange'},\r\n            'ma_sell': {'color': 'orange'},\r\n        },\r\n    }\r\n\r\n\r\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):\r\n        # Sell any positions at a loss if they are held for more than 7 days.\r\n        if current_profit < -0.04 and (current_time - trade.open_date_utc).days >= 4:\r\n            return 'unclog'\r\n\r\n\r\n    def informative_pairs(self):\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, '1h') for pair in pairs]\r\n\r\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\r\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\r\n        else:\r\n            btc_info_pair = \"BTC/USDT\"\r\n\r\n        informative_pairs.append((btc_info_pair, self.timeframe))\r\n        informative_pairs.append((btc_info_pair, self.inf_1h))\r\n\r\n        return informative_pairs\r\n\r\n    def pump_dump_protection(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        df36h = dataframe.copy().shift( 432 ) # TODO FIXME: This assumes 5m timeframe\r\n        df24h = dataframe.copy().shift( 288 ) # TODO FIXME: This assumes 5m timeframe\r\n\r\n        dataframe['volume_mean_short'] = dataframe['volume'].rolling(4).mean()\r\n        dataframe['volume_mean_long'] = df24h['volume'].rolling(48).mean()\r\n        dataframe['volume_mean_base'] = df36h['volume'].rolling(288).mean()\r\n\r\n        dataframe['volume_change_percentage'] = (dataframe['volume_mean_long'] / dataframe['volume_mean_base'])\r\n\r\n        dataframe['rsi_mean'] = dataframe['rsi'].rolling(48).mean()\r\n\r\n        dataframe['pnd_volume_warn'] = np.where((dataframe['volume_mean_short'] / dataframe['volume_mean_long'] > 5.0), -1, 0)\r\n\r\n        return dataframe\r\n\r\n\r\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # Indicators\r\n        # -----------------------------------------------------------------------------------------\r\n        dataframe['price_trend_long'] = (dataframe['close'].rolling(8).mean() / dataframe['close'].shift(8).rolling(144).mean())\r\n\r\n        # Add prefix\r\n        # -----------------------------------------------------------------------------------------\r\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\r\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\r\n\r\n        return dataframe\r\n\r\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # Indicators\r\n        # -----------------------------------------------------------------------------------------\r\n        dataframe['rsi_8'] = ta.RSI(dataframe, timeperiod=8)\r\n\r\n        # Add prefix\r\n        # -----------------------------------------------------------------------------------------\r\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\r\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\r\n\r\n        return dataframe\r\n\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        if self.config['stake_currency'] in ['USDT','BUSD']:\r\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\r\n        else:\r\n            btc_info_pair = \"BTC/USDT\"\r\n\r\n        btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.inf_1h)\r\n        btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\r\n        dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.inf_1h, ffill=True)\r\n        drop_columns = [f\"{s}_{self.inf_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\r\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\r\n\r\n        btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\r\n        btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\r\n        dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\r\n        drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\r\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\r\n\r\n\r\n        # Calculate all ma_buy values\r\n        for val in self.base_nb_candles_buy.range:\r\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        # Calculate all ma_sell values\r\n        for val in self.base_nb_candles_sell.range:\r\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\r\n\r\n\r\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\r\n        # Elliot\r\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\r\n\r\n        # RSI\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\r\n\r\n        #lambo2\r\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\r\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\r\n\r\n\r\n        # Pump strength\r\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\r\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\r\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\r\n\r\n        # Cofi\r\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\r\n        dataframe['fastd'] = stoch_fast['fastd']\r\n        dataframe['fastk'] = stoch_fast['fastk']\r\n        dataframe['adx'] = ta.ADX(dataframe)\r\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\r\n\r\n\r\n\r\n        dataframe = self.pump_dump_protection(dataframe, metadata)\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        dataframe.loc[:, 'buy_tag'] = ''\r\n\r\n        lambo2 = (\r\n            #bool(self.lambo2_enabled.value) &\r\n            #(dataframe['pump_warning'] == 0) &\r\n            (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value)) &\r\n            (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value)) &\r\n            (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value))\r\n        )\r\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2_'\r\n        conditions.append(lambo2)\r\n\r\n        buy1ewo = (\r\n                (dataframe['rsi_fast'] <35)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\r\n                (dataframe['EWO'] > self.ewo_high.value) &\r\n                (dataframe['rsi'] < self.rsi_buy.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\r\n        )\r\n        dataframe.loc[buy1ewo, 'buy_tag'] += 'buy1eworsi_'\r\n        conditions.append(buy1ewo)\r\n\r\n        buy2ewo = (\r\n                (dataframe['rsi_fast'] < 35)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\r\n                (dataframe['EWO'] < self.ewo_low.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\r\n        )\r\n        dataframe.loc[buy2ewo, 'buy_tag'] += 'buy2ewo_'\r\n        conditions.append(buy2ewo)\r\n\r\n        is_cofi = (\r\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\r\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\r\n                (dataframe['fastk'] < self.buy_fastk.value) &\r\n                (dataframe['fastd'] < self.buy_fastd.value) &\r\n                (dataframe['adx'] > self.buy_adx.value) &\r\n                (dataframe['EWO'] > self.buy_ewo_high.value)\r\n            )\r\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi_'\r\n        conditions.append(is_cofi)\r\n\r\n        if conditions:\r\n            dataframe.loc[\r\n                reduce(lambda x, y: x | y, conditions),\r\n                'buy'\r\n            ]=1\r\n\r\n\r\n        dont_buy_conditions = []\r\n\r\n        # don't buy if there seems to be a Pump and Dump event.\r\n        dont_buy_conditions.append((dataframe['pnd_volume_warn'] < 0.0))\r\n\r\n        # BTC price protection\r\n        dont_buy_conditions.append((dataframe['btc_rsi_8_1h'] < 35.0))\r\n\r\n        if dont_buy_conditions:\r\n            for condition in dont_buy_conditions:\r\n                dataframe.loc[condition, 'buy'] = 0\r\n\r\n        return dataframe\r\n\r\n\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n\r\n        conditions.append(\r\n            (   (dataframe['close']>dataframe['hma_50'])&\r\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\r\n                (dataframe['rsi']>50)&\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\r\n\r\n            )\r\n            |\r\n            (\r\n                (dataframe['close']<dataframe['hma_50'])&\r\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\r\n            )\r\n\r\n        )\r\n\r\n        if conditions:\r\n            dataframe.loc[\r\n                reduce(lambda x, y: x | y, conditions),\r\n                'sell'\r\n            ]=1\r\n\r\n\r\n        return dataframe\r\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\r\n                           rate: float, time_in_force: str, sell_reason: str,\r\n                           current_time: datetime, **kwargs) -> bool:\r\n\r\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\r\n\r\n        return True\r\n\r\ndef pct_change(a, b):\r\n    return (b - a) / a\r\n\r\nclass EI3v2_tag_cofi_dca_green(EI3v2_tag_cofi_green):\r\n   \r\n\r\n    initial_safety_order_trigger = -0.018\r\n    max_safety_orders = 8\r\n    safety_order_step_scale = 1.2\r\n    safety_order_volume_scale = 1.4\r\n\r\n    buy_params = {\r\n        \"dca_min_rsi\": 35,\r\n    }\r\n\r\n    # append buy_params of parent class\r\n    buy_params.update(EI3v2_tag_cofi_green.buy_params)\r\n\r\n    dca_min_rsi = IntParameter(35, 75, default=buy_params['dca_min_rsi'], space='buy', optimize=True)\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = super().populate_indicators(dataframe, metadata)\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n        return dataframe\r\n\r\n    def adjust_trade_position(self, trade: Trade, current_time: datetime,\r\n                              current_rate: float, current_profit: float, min_stake: float,\r\n                              max_stake: float, **kwargs):\r\n        if current_profit > self.initial_safety_order_trigger:\r\n            return None\r\n\r\n        # credits to reinuvader for not blindly executing safety orders\r\n        # Obtain pair dataframe.\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe)\r\n        # Only buy when it seems it's climbing back up\r\n        last_candle = dataframe.iloc[-1].squeeze()\r\n        previous_candle = dataframe.iloc[-2].squeeze()\r\n        if last_candle['close'] < previous_candle['close']:\r\n            return None\r\n\r\n        count_of_buys = 0\r\n        for order in trade.orders:\r\n            if order.ft_is_open or order.ft_order_side != 'buy':\r\n                continue\r\n            if order.status == \"closed\":\r\n                count_of_buys += 1\r\n\r\n        if 1 <= count_of_buys <= self.max_safety_orders:\r\n            \r\n            safety_order_trigger = abs(self.initial_safety_order_trigger) + (abs(self.initial_safety_order_trigger) * self.safety_order_step_scale * (math.pow(self.safety_order_step_scale,(count_of_buys - 1)) - 1) / (self.safety_order_step_scale - 1))\r\n\r\n            if current_profit <= (-1 * abs(safety_order_trigger)):\r\n                try:\r\n                    stake_amount = self.wallets.get_trade_stake_amount(trade.pair, None)\r\n                    stake_amount = stake_amount * math.pow(self.safety_order_volume_scale,(count_of_buys - 1))\r\n                    amount = stake_amount / current_rate\r\n                    logger.info(f\"Initiating safety order buy #{count_of_buys} for {trade.pair} with stake amount of {stake_amount} which equals {amount}\")\r\n                    return stake_amount\r\n                except Exception as exception:\r\n                    logger.info(f'Error occured while trying to get stake amount for {trade.pair}: {str(exception)}') \r\n                    return None\r\n\r\n        return None\r\n\r\n"
  },
  {
    "path": "strategies/EMA50/EMA50.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter, IntParameter\n\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n# --------------------------------\n# Add your lib to import here\n\n\nclass EMA50(IStrategy):\n    \"\"\"\n    Simple strategy that trades based on Prices breaking above/below the EMA\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n\n    buy_period = IntParameter(3, 20, default=5, space=\"buy\")\n    buy_adx = DecimalParameter(1, 99, decimals=0, default=25, space=\"buy\")\n    buy_sqz_band = DecimalParameter(0.003, 0.02, decimals=4, default=0.05, space=\"buy\")\n\n    buy_sqz_enabled = CategoricalParameter([True, False], default=True, space=\"buy\")\n    buy_macd_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_adx_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_mfi_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_sar_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_dc_enabled = CategoricalParameter([True, False], default=False, space=\"buy\")\n    buy_predict_enabled = CategoricalParameter([True, False], default=True, space=\"buy\")\n\n    sell_sar_enabled = CategoricalParameter([True, False], default=False, space=\"sell\")\n    sell_dc_enabled = CategoricalParameter([True, False], default=False, space=\"sell\")\n    sell_fisher = DecimalParameter(-1, 1, decimals=2, default=-0.30, space=\"sell\")\n    sell_standard_triggers = CategoricalParameter([True, False], default=False, space=\"sell\")\n    sell_hold = CategoricalParameter([True, False], default=True, space=\"sell\")\n    sell_hold = CategoricalParameter([True, False], default=True, space=\"sell\")\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.278,\n        \"39\": 0.087,\n        \"124\": 0.038,\n        \"135\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.172\n    trailing_stop_positive_offset = 0.212\n    trailing_only_offset_is_reached = False\n\n    # Stoploss:\n    stoploss = -0.333\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'ema50': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            },\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        # dataframe['adx'] = ta.ADX(dataframe)\n\n        # Plus Directional Indicator / Movement\n        # dataframe['dm_plus'] = ta.PLUS_DM(dataframe)\n        # dataframe['di_plus'] = ta.PLUS_DI(dataframe)\n\n        # Minus Directional Indicator / Movement\n        # dataframe['dm_minus'] = ta.MINUS_DM(dataframe)\n        # dataframe['di_minus'] = ta.MINUS_DI(dataframe)\n        # dataframe['dm_delta'] = dataframe['dm_plus'] - dataframe['dm_minus']\n        # dataframe['di_delta'] = dataframe['di_plus'] - dataframe['di_minus']\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n\n        # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        # stoch_fast = ta.STOCHF(dataframe)\n        # dataframe['fastd'] = stoch_fast['fastd']\n        # dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        # dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        #dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # dataframe['ema7'] = ta.EMA(dataframe, timeperiod=7)\n        # dataframe['ema25'] = ta.EMA(dataframe, timeperiod=25)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        # dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        # dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # # Hilbert Transform Indicator - SineWave\n        # hilbert = ta.HT_SINE(dataframe)\n        # dataframe['htsine'] = hilbert['sine']\n        # dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        conditions = []\n\n        # GUARDS AND TRENDS\n\n\n        # check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        # TRIGGERS\n\n        # buy if close crosses above EMA50\n        conditions.append(qtpylib.crossed_above(dataframe['close'], dataframe['ema50']))\n\n        # build the dataframe using the conditions\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), 'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        conditions = []\n        # if hold, then don't set a sell signal\n        if self.sell_hold.value:\n            dataframe.loc[(dataframe['close'].notnull() ), 'sell'] = 0\n\n        else:\n\n            # buy if close crosses below EMA50\n            conditions.append(qtpylib.crossed_below(dataframe['close'], dataframe['ema50']))\n\n            if conditions:\n                dataframe.loc[reduce(lambda x, y: x & y, conditions), 'sell'] = 1\n\n        return dataframe\n    "
  },
  {
    "path": "strategies/EMA520015_V17/EMA520015_V17.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass EMA520015_V17(IStrategy):\n\n\n    minimal_roi = {\n        \"0\": 0.15\n    }\n    \n   # Buy and sell at market price\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n\n    stoploss = -0.1\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.08\n    trailing_only_offset_is_reached = True\n    \n    # Optimal timeframe for the strategy\n    timeframe = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        macd = ta.MACD(dataframe,fastperiod=300, slowperiod=650, signalperiod=10)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdhist'] = macd['macdhist']\n        \n        \n        #Exp Moving Average (200 periods)\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema350'] = ta.EMA(dataframe, timeperiod=350)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n\n\n\n        return dataframe\n        \n        \n        \n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            \n                           (dataframe['close'].shift(1) < dataframe['ema20'])\n                           & (dataframe['close'] > dataframe['ema20'])\n\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                           (dataframe['close'].shift(1) > dataframe['ema20'])\n                           & (dataframe['close'] < dataframe['ema20'])\n                        \n                          \n            ),\n            'sell'] = 1\n        return dataframe\n        \n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):\n    \n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        \n        if (current_profit > 0.02) and (last_candle['ema20'] < last_candle['ema200']):\n  \n            return 'sell2'\n"
  },
  {
    "path": "strategies/EMABBRSI/EMABBRSI.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\nimport talib.abstract as ta\nfrom pandas import DataFrame\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\n\n\nclass EMABBRSI(IStrategy):\n    \"\"\"\n    Default Strategy provided by freqtrade bot.\n    You can override it with your own strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy\n    minimal_roi = {\n        \"0\": 0.14142349227153977,\n        \"25\": 0.04585271106137356,\n        \"41\": 0.020732379189664467,\n        \"67\": 0\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.20\n    # Optimal ticker interval for the strategy\n    ticker_interval = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional time in force for orders\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # Ideas for MA crosse over strategies\n        # 5 and 10 crossover\n        # buys at 200 EMA re-testing or 100EMA\n        # when 7 closes above 25 or sell when 7 crosses below 25\n        dataframe['ema7'] = ta.EMA(dataframe, timeperiod=7)\n        dataframe['ema25'] = ta.EMA(dataframe, timeperiod=25)\n\n        dataframe['ema50']=ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema200']=ta.EMA(dataframe, timeperiod=200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 33) &\n                # (dataframe['close'] < dataframe['bb_lowerband3'])\n                # (dataframe['close'] < dataframe['bb_lowerband3'])\n                qtpylib.crossed_above(dataframe['close'], dataframe['bb_lowerband3'])\n               \n            )\n            |\n            (\n                (dataframe['close'].shift(1) > dataframe['ema200']) &\n                (dataframe['low'] < dataframe['ema200']) &\n                (dataframe['close'] > dataframe['ema200']) \n            )\n            |\n            (\n                qtpylib.crossed_above(dataframe['ema50'], dataframe['ema200'])\n               \n            )\n           ,\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n                (\n                    (dataframe['close'] > dataframe['bb_lowerband']) &\n                     (dataframe['rsi'] > 91)      \n                )\n                |\n                (\n                    qtpylib.crossed_below(dataframe['ema50'], dataframe['ema200'])\n                \n                )\n                ,\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/EMABreakout/EMABreakout.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter, IntParameter\n\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n# --------------------------------\n# Add your lib to import here\n\n\nclass EMABreakout(IStrategy):\n    \"\"\"\n    Simple strategy that trades based on Prices breaking above/below the EMA\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n\n    buy_period = CategoricalParameter([20, 30, 30, 50, 60, 70, 80, 90, 100], default=90, space=\"buy\")\n    buy_macd_enabled = CategoricalParameter([True, False], default=True, space=\"buy\")\n    sell_hold = CategoricalParameter([True, False], default=False, space=\"sell\")\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.278,\n        \"39\": 0.087,\n        \"124\": 0.038,\n        \"135\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.172\n    trailing_stop_positive_offset = 0.212\n    trailing_only_offset_is_reached = False\n\n    # Stoploss:\n    stoploss = -0.333\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'ema': {},\n            'sma': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macdhist': {'color': 'blue'}\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        # dataframe['adx'] = ta.ADX(dataframe)\n\n        # Plus Directional Indicator / Movement\n        # dataframe['dm_plus'] = ta.PLUS_DM(dataframe)\n        # dataframe['di_plus'] = ta.PLUS_DI(dataframe)\n\n        # Minus Directional Indicator / Movement\n        # dataframe['dm_minus'] = ta.MINUS_DM(dataframe)\n        # dataframe['di_minus'] = ta.MINUS_DI(dataframe)\n        # dataframe['dm_delta'] = dataframe['dm_plus'] - dataframe['dm_minus']\n        # dataframe['di_delta'] = dataframe['di_plus'] - dataframe['di_minus']\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n\n        # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        # stoch_fast = ta.STOCHF(dataframe)\n        # dataframe['fastd'] = stoch_fast['fastd']\n        # dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        # dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        #dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # dataframe['ema7'] = ta.EMA(dataframe, timeperiod=7)\n        # dataframe['ema25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema'] = ta.EMA(dataframe, timeperiod=self.buy_period.value)\n\n        # # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=self.buy_period.value)\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        # dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # # Hilbert Transform Indicator - SineWave\n        # hilbert = ta.HT_SINE(dataframe)\n        # dataframe['htsine'] = hilbert['sine']\n        # dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        conditions = []\n\n        # GUARDS AND TRENDS\n\n\n        # check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        # MACD OK?\n        if self.buy_macd_enabled.value:\n            conditions.append(dataframe['macdhist'] >= 0)\n\n        # TRIGGERS\n\n        # buy if close crosses above EMABreakout\n        conditions.append(qtpylib.crossed_above(dataframe['close'], dataframe['ema']))\n\n        # build the dataframe using the conditions\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), 'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        conditions = []\n        # if hold, then don't set a sell signal\n        if self.sell_hold.value:\n            dataframe.loc[(dataframe['close'].notnull() ), 'sell'] = 0\n\n        else:\n\n            # buy if close crosses below EMABreakout\n            conditions.append(qtpylib.crossed_below(dataframe['close'], dataframe['ema']))\n\n            if conditions:\n                dataframe.loc[reduce(lambda x, y: x & y, conditions), 'sell'] = 1\n\n        return dataframe\n    "
  },
  {
    "path": "strategies/EMASkipPump/EMASkipPump.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\n\nclass EMASkipPump(IStrategy):\n\n    \"\"\"\n        basic strategy, which trys to avoid pump and dump market conditions. Shared from the tradingview\n        slack\n    \"\"\"\n    EMA_SHORT_TERM = 5\n    EMA_MEDIUM_TERM = 12\n    EMA_LONG_TERM = 21\n\n    # Minimal ROI designed for the strategy.\n    # we only sell after 100%, unless our sell points are found before\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # should be converted to a trailing stop loss\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\" Adds several different TA indicators to the given DataFrame\n        \"\"\"\n\n        dataframe['ema_{}'.format(self.EMA_SHORT_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_SHORT_TERM\n        )\n        dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_MEDIUM_TERM\n        )\n        dataframe['ema_{}'.format(self.EMA_LONG_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_LONG_TERM\n        )\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['min'] = ta.MIN(dataframe, timeperiod=self.EMA_MEDIUM_TERM)\n        dataframe['max'] = ta.MAX(dataframe, timeperiod=self.EMA_MEDIUM_TERM)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (dataframe['volume'] < (dataframe['volume'].rolling(window=30).mean().shift(1) * 20)) &\n            (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_SHORT_TERM)]) &\n            (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)]) &\n            (dataframe['close'] == dataframe['min']) &\n            (dataframe['close'] <= dataframe['bb_lowerband']),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (dataframe['close'] > dataframe['ema_{}'.format(self.EMA_SHORT_TERM)]) &\n            (dataframe['close'] > dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)]) &\n            (dataframe['close'] >= dataframe['max']) &\n            (dataframe['close'] >= dataframe['bb_upperband']),\n            'sell'\n        ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/EMAVolume/EMAVolume.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass EMAVolume(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n        buys and sells on crossovers - doesn't really perfom that well and its just a proof of concept\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.5\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.2\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '15m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema13']=ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema34']=ta.EMA(dataframe, timeperiod=34)\n        dataframe['ema7']=ta.EMA(dataframe, timeperiod=7)\n        dataframe['ema21']=ta.EMA(dataframe, timeperiod=21)\n        dataframe['volume_mean'] = dataframe['volume'].rolling(window=10).mean()\n        dataframe['ema50']=ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema200']=ta.EMA(dataframe, timeperiod=200)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['ema13'], dataframe['ema34'])) &\n                (dataframe['volume'] > dataframe['volume'].rolling(window=10).mean())\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['ema13'], dataframe['ema34']))\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/EMA_CROSSOVER_STRATEGY/EMA_CROSSOVER_STRATEGY.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass EMA_CROSSOVER_STRATEGY(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'ema10': {'color': 'red'},\n            'ema100': {'color': 'green'},\n            'ema1000': {'color': 'blue'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # EMA - Exponential Moving Average\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema1000'] = ta.EMA(dataframe, timeperiod=1000)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30\n                # (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                # (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                # (dataframe['volume'] > 0)  # Make sure Volume is not 0\n                dataframe['ema10'].crossed_above(dataframe['ema100'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70\n                # (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                # (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                # (dataframe['volume'] > 0)  # Make sure Volume is not 0\n                dataframe['ema100'].crossed_above(dataframe['ema10'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/EXPERIMENTAL_STRATEGY/EXPERIMENTAL_STRATEGY.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass EXPERIMENTAL_STRATEGY(IStrategy):\n    \"\"\"\n    Default Strategy provided by freqtrade bot.\n    Please do not modify this strategy, it's  intended for internal use only.\n    Please look at the SampleStrategy in the user_data/strategy directory\n    or strategy repository https://github.com/freqtrade/freqtrade-strategies\n    for samples and inspiration.\n    \"\"\"\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy\n    minimal_roi = {\n        \"40\": 0.0,\n        \"30\": 0.01,\n        \"20\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.10\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '5m'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional time in force for orders\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicator\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # Minus Directional Indicator / Movement\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # Plus Directional Indicator / Movement\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA - Exponential Moving Average\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n\n        # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 35) &\n                (dataframe['fastd'] < 35) &\n                (dataframe['adx'] > 30) &\n                (dataframe['plus_di'] > 0.5)\n            ) |\n            (\n                (dataframe['adx'] > 65) &\n                (dataframe['plus_di'] > 0.5)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (\n                    (qtpylib.crossed_above(dataframe['rsi'], 70)) |\n                    (qtpylib.crossed_above(dataframe['fastd'], 70))\n                ) &\n                (dataframe['adx'] > 10) &\n                (dataframe['minus_di'] > 0)\n            ) |\n            (\n                (dataframe['adx'] > 70) &\n                (dataframe['minus_di'] > 0.5)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV2/ElliotV2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 31,\n      \"ewo_high\": 4.471,\n      \"ewo_low\": -13.043,\n      \"low_offset\": 0.978,\n      \"rsi_buy\": 63\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 99,\n      \"high_offset\": 1.054\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\ndef populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Plus Directional Indicator / Movement\n        dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # Minus Directional Indicator / Movement\n        dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # Aroon, Aroon Oscillator\n        aroon = ta.AROON(dataframe)\n        dataframe['aroonup'] = aroon['aroonup']\n        dataframe['aroondown'] = aroon['aroondown']\n        dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # Awesome Oscillator\n        dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # Keltner Channel\n        keltner = qtpylib.keltner_channel(dataframe)\n        dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        dataframe[\"kc_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n            (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        )\n        dataframe[\"kc_width\"] = (\n            (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        )\n\n        # Ultimate Oscillator\n        dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        stoch = ta.STOCH(dataframe)\n        dataframe['slowd'] = stoch['slowd']\n        dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        stoch_rsi = ta.STOCHRSI(dataframe)\n        dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) /\n        #     dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # Hammer: values [0, 100]\n        dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # Inverted Hammer: values [0, 100]\n        dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # Dragonfly Doji: values [0, 100]\n        dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # Piercing Line: values [0, 100]\n        dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # Morningstar: values [0, 100]\n        dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # Three White Soldiers: values [0, 100]\n        dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # Hanging Man: values [0, 100]\n        dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # Shooting Star: values [0, 100]\n        dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # Gravestone Doji: values [0, 100]\n        dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # Dark Cloud Cover: values [0, 100]\n        dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # Evening Doji Star: values [0, 100]\n        dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # Evening Star: values [0, 100]\n        dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # Three Line Strike: values [0, -100, 100]\n        dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # Spinning Top: values [0, -100, 100]\n        dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # Engulfing: values [0, -100, 100]\n        dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # Harami: values [0, -100, 100]\n        dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # Three Outside Up/Down: values [0, -100, 100]\n        dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # Three Inside Up/Down: values [0, -100, 100]\n        dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\nclass ElliotV2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.154,\n        \"18\": 0.074,\n        \"50\": 0.039,\n        \"165\": 0.02\n    }\n\n    # Stoploss:\n    stoploss = -0.179\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.049\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 139\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV4/ElliotV4.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\ndef populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n    # Momentum Indicators\n    # ------------------------------------\n\n    # ADX\n    dataframe['adx'] = ta.ADX(dataframe)\n\n    # Plus Directional Indicator / Movement\n    dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n    dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n    # Minus Directional Indicator / Movement\n    dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n    dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n    # Aroon, Aroon Oscillator\n    aroon = ta.AROON(dataframe)\n    dataframe['aroonup'] = aroon['aroonup']\n    dataframe['aroondown'] = aroon['aroondown']\n    dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n    # Awesome Oscillator\n    dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n    # Keltner Channel\n    keltner = qtpylib.keltner_channel(dataframe)\n    dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n    dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n    dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n    dataframe[\"kc_percent\"] = (\n        (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n    )\n    dataframe[\"kc_width\"] = (\n        (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) /\n        dataframe[\"kc_middleband\"]\n    )\n\n    # Ultimate Oscillator\n    dataframe['uo'] = ta.ULTOSC(dataframe)\n\n    # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n    dataframe['cci'] = ta.CCI(dataframe)\n\n    # RSI\n    dataframe['rsi'] = ta.RSI(dataframe)\n\n    # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n    rsi = 0.1 * (dataframe['rsi'] - 50)\n    dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n    # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n    dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n    # # Stochastic Slow\n    stoch = ta.STOCH(dataframe)\n    dataframe['slowd'] = stoch['slowd']\n    dataframe['slowk'] = stoch['slowk']\n\n    # Stochastic Fast\n    stoch_fast = ta.STOCHF(dataframe)\n    dataframe['fastd'] = stoch_fast['fastd']\n    dataframe['fastk'] = stoch_fast['fastk']\n\n    # # Stochastic RSI\n    # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n    # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n    stoch_rsi = ta.STOCHRSI(dataframe)\n    dataframe['fastd_rsi'] = stoch_rsi['fastd']\n    dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n    # MACD\n    macd = ta.MACD(dataframe)\n    dataframe['macd'] = macd['macd']\n    dataframe['macdsignal'] = macd['macdsignal']\n    dataframe['macdhist'] = macd['macdhist']\n\n    # MFI\n    dataframe['mfi'] = ta.MFI(dataframe)\n\n    # # ROC\n    dataframe['roc'] = ta.ROC(dataframe)\n\n    # Overlap Studies\n    # ------------------------------------\n\n    # Bollinger Bands\n    bollinger = qtpylib.bollinger_bands(\n        qtpylib.typical_price(dataframe), window=20, stds=2)\n    dataframe['bb_lowerband'] = bollinger['lower']\n    dataframe['bb_middleband'] = bollinger['mid']\n    dataframe['bb_upperband'] = bollinger['upper']\n    dataframe[\"bb_percent\"] = (\n        (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n        (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n    )\n    dataframe[\"bb_width\"] = (\n        (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) /\n        dataframe[\"bb_middleband\"]\n    )\n\n    # Parabolic SAR\n    dataframe['sar'] = ta.SAR(dataframe)\n\n    # TEMA - Triple Exponential Moving Average\n    dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n    # Cycle Indicator\n    # ------------------------------------\n    # Hilbert Transform Indicator - SineWave\n    hilbert = ta.HT_SINE(dataframe)\n    dataframe['htsine'] = hilbert['sine']\n    dataframe['htleadsine'] = hilbert['leadsine']\n\n    # Pattern Recognition - Bullish candlestick patterns\n    # ------------------------------------\n    # Hammer: values [0, 100]\n    dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n    # Inverted Hammer: values [0, 100]\n    dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n    # Dragonfly Doji: values [0, 100]\n    dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n    # Piercing Line: values [0, 100]\n    dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe)  # values [0, 100]\n    # Morningstar: values [0, 100]\n    dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(\n        dataframe)  # values [0, 100]\n    # Three White Soldiers: values [0, 100]\n    dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(\n        dataframe)  # values [0, 100]\n\n    # Pattern Recognition - Bearish candlestick patterns\n    # ------------------------------------\n    # Hanging Man: values [0, 100]\n    dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n    # Shooting Star: values [0, 100]\n    dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n    # Gravestone Doji: values [0, 100]\n    dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n    # Dark Cloud Cover: values [0, 100]\n    dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n    # Evening Doji Star: values [0, 100]\n    dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n    # Evening Star: values [0, 100]\n    dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n    # Pattern Recognition - Bullish/Bearish candlestick patterns\n    # ------------------------------------\n    # Three Line Strike: values [0, -100, 100]\n    dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n    # Spinning Top: values [0, -100, 100]\n    dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(\n        dataframe)  # values [0, -100, 100]\n    # Engulfing: values [0, -100, 100]\n    dataframe['CDLENGULFING'] = ta.CDLENGULFING(\n        dataframe)  # values [0, -100, 100]\n    # Harami: values [0, -100, 100]\n    dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe)  # values [0, -100, 100]\n    # Three Outside Up/Down: values [0, -100, 100]\n    dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(\n        dataframe)  # values [0, -100, 100]\n    # Three Inside Up/Down: values [0, -100, 100]\n    dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe)  # values [0, -100, 100]\n\n    # # Chart type\n    # # ------------------------------------\n    # # Heikin Ashi Strategy\n    heikinashi = qtpylib.heikinashi(dataframe)\n    dataframe['ha_open'] = heikinashi['open']\n    dataframe['ha_close'] = heikinashi['close']\n    dataframe['ha_high'] = heikinashi['high']\n    dataframe['ha_low'] = heikinashi['low']\n\n    return dataframe\n\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 14,\n    \"ewo_high\": 2.34,\n    \"ewo_low\": -17.457,\n    \"low_offset\": 0.983,\n    \"rsi_buy\": 61\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 24,\n    \"high_offset\": 0.992\n}\n\n\nclass ElliotV4(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.97\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(\n        30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.049\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = False\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 39\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe)\n                             for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV531/ElliotV531.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\nfrom freqtrade.exchange import timeframe_to_prev_date, timeframe_to_seconds\nimport pandas_ta as pta\n\n# Buy hyperspace params:\nbuy_params = {\n     \"base_nb_candles_buy\": 11,\n     \"ewo_high\": 2.337,\n     \"ewo_low\": -15.87,\n     \"low_offset\": 0.979,\n     \"rsi_buy\": 55,\n }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 26,\n#     \"high_offset\": 0.994,\n# }\n\n# Buy hyperspace params:\n#buy_params = {\n#    \"base_nb_candles_buy\": 11,\n#    \"ewo_high\": 2.337,\n#    \"ewo_low\": -15.87,\n#    \"low_offset\": 0.979,\n#    \"rsi_buy\": 55,\n#}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 17,\n    \"high_offset\": 0.997,\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\ndef populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n    # Momentum Indicators\n    # ------------------------------------\n\n    # ADX\n    dataframe['adx'] = ta.ADX(dataframe)\n\n    # Plus Directional Indicator / Movement\n    dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n    dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n    # Minus Directional Indicator / Movement\n    dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n    dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n    # Aroon, Aroon Oscillator\n    aroon = ta.AROON(dataframe)\n    dataframe['aroonup'] = aroon['aroonup']\n    dataframe['aroondown'] = aroon['aroondown']\n    dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n    # Awesome Oscillator\n    dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n    # Keltner Channel\n    keltner = qtpylib.keltner_channel(dataframe)\n    dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n    dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n    dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n    dataframe[\"kc_percent\"] = (\n        (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n    )\n    dataframe[\"kc_width\"] = (\n        (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n    )\n\n    # Ultimate Oscillator\n    dataframe['uo'] = ta.ULTOSC(dataframe)\n\n    # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n    dataframe['cci'] = ta.CCI(dataframe)\n\n    # RSI\n    dataframe['rsi'] = ta.RSI(dataframe)\n\n    # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n    rsi = 0.1 * (dataframe['rsi'] - 50)\n    dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n    # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n    dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n    # # Stochastic Slow\n    stoch = ta.STOCH(dataframe)\n    dataframe['slowd'] = stoch['slowd']\n    dataframe['slowk'] = stoch['slowk']\n\n    # Stochastic Fast\n    stoch_fast = ta.STOCHF(dataframe)\n    dataframe['fastd'] = stoch_fast['fastd']\n    dataframe['fastk'] = stoch_fast['fastk']\n\n    # # Stochastic RSI\n    # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n    # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n    stoch_rsi = ta.STOCHRSI(dataframe)\n    dataframe['fastd_rsi'] = stoch_rsi['fastd']\n    dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n    # MACD\n    macd = ta.MACD(dataframe)\n    dataframe['macd'] = macd['macd']\n    dataframe['macdsignal'] = macd['macdsignal']\n    dataframe['macdhist'] = macd['macdhist']\n\n    # MFI\n    dataframe['mfi'] = ta.MFI(dataframe)\n\n    # # ROC\n    dataframe['roc'] = ta.ROC(dataframe)\n\n    # Overlap Studies\n    # ------------------------------------\n\n    # Bollinger Bands\n    bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n    dataframe['bb_lowerband'] = bollinger['lower']\n    dataframe['bb_middleband'] = bollinger['mid']\n    dataframe['bb_upperband'] = bollinger['upper']\n    dataframe[\"bb_percent\"] = (\n        (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n        (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n    )\n    dataframe[\"bb_width\"] = (\n        (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n    )\n\n    # Parabolic SAR\n    dataframe['sar'] = ta.SAR(dataframe)\n\n    # TEMA - Triple Exponential Moving Average\n    dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n    # Cycle Indicator\n    # ------------------------------------\n    # Hilbert Transform Indicator - SineWave\n    hilbert = ta.HT_SINE(dataframe)\n    dataframe['htsine'] = hilbert['sine']\n    dataframe['htleadsine'] = hilbert['leadsine']\n\n    # Pattern Recognition - Bullish candlestick patterns\n    # ------------------------------------\n    # Hammer: values [0, 100]\n    dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n    # Inverted Hammer: values [0, 100]\n    dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n    # Dragonfly Doji: values [0, 100]\n    dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n    # Piercing Line: values [0, 100]\n    dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe)  # values [0, 100]\n    # Morningstar: values [0, 100]\n    dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe)  # values [0, 100]\n    # Three White Soldiers: values [0, 100]\n    dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe)  # values [0, 100]\n\n    # Pattern Recognition - Bearish candlestick patterns\n    # ------------------------------------\n    # Hanging Man: values [0, 100]\n    dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n    # Shooting Star: values [0, 100]\n    dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n    # Gravestone Doji: values [0, 100]\n    dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n    # Dark Cloud Cover: values [0, 100]\n    dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n    # Evening Doji Star: values [0, 100]\n    dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n    # Evening Star: values [0, 100]\n    dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n    # Pattern Recognition - Bullish/Bearish candlestick patterns\n    # ------------------------------------\n    # Three Line Strike: values [0, -100, 100]\n    dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n    # Spinning Top: values [0, -100, 100]\n    dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe)  # values [0, -100, 100]\n    # Engulfing: values [0, -100, 100]\n    dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe)  # values [0, -100, 100]\n    # Harami: values [0, -100, 100]\n    dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe)  # values [0, -100, 100]\n    # Three Outside Up/Down: values [0, -100, 100]\n    dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe)  # values [0, -100, 100]\n    # Three Inside Up/Down: values [0, -100, 100]\n    dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe)  # values [0, -100, 100]\n\n    # # Chart type\n    # # ------------------------------------\n    # # Heikin Ashi Strategy\n    heikinashi = qtpylib.heikinashi(dataframe)\n    dataframe['ha_open'] = heikinashi['open']\n    dataframe['ha_close'] = heikinashi['close']\n    dataframe['ha_high'] = heikinashi['high']\n    dataframe['ha_low'] = heikinashi['low']\n\n    return dataframe\n\n\nclass ElliotV531(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    # minimal_roi = {\n    #     \"0\": 0.215,\n    #     \"40\": 0.132,\n    #     \"87\": 0.086,\n    #     \"201\": 0.03\n    # }\n\n    # # Stoploss:\n    # stoploss = -0.189\n    # # ROI table:\n    # minimal_roi = {\n    #     \"0\": 0.178,\n    #     \"11\": 0.085,\n    #     \"31\": 0.029,\n    #     \"126\": 0\n    # }\n\n    # # Stoploss:\n    # stoploss = -0.339\n\n    # # Trailing stop:\n    # trailing_stop = True\n    # trailing_stop_positive = 0.177\n    # trailing_stop_positive_offset = 0.243\n    # trailing_only_offset_is_reached = False\n    # # ROI table:\n    # minimal_roi = {\n    #     \"0\": 0.207,\n    #     \"17\": 0.049,\n    #     \"28\": 0.026,\n    #     \"109\": 0\n    # }\n    # ROI table:\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.132,\n        \"87\": 0.086,\n        \"201\": 0.03\n    }\n\n    # Stoploss:\n    stoploss = -0.189\n\n    # # Trailing stop:\n    # trailing_stop = True\n    # trailing_stop_positive = 0.05\n    # trailing_stop_positive_offset = 0.1\n    # trailing_only_offset_is_reached = False\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.007\n    trailing_stop_positive_offset = 0.0157\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = False\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '30m'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'blue'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = True\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.05\n    }\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=241)\n\n            # Trade open more then 241 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # Are we still sinking?\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 5%\n                    return 0.01\n       \n        return 1\n\n#        stoploss = self.stoploss\n#        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n#        last_candle = dataframe.iloc[-1].squeeze()\n#        if last_candle is None:\n#            return stoploss\n#\n#        trade_date = timeframe_to_prev_date(\n#            self.timeframe, trade.open_date_utc - timedelta(seconds=timeframe_to_seconds(self.timeframe)))\n#        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n#        if trade_candle.empty:\n#            return stoploss\n#\n#        trade_candle = trade_candle.squeeze()\n#\n#        dur_minutes = (current_time - trade.open_date_utc).seconds // 60\n#\n#        slippage_ratio = trade.open_rate / trade_candle['close'] - 1\n#        slippage_ratio = slippage_ratio if slippage_ratio > 0 else 0\n#        current_profit_comp = current_profit + slippage_ratio\n\n#        if current_profit_comp >= self.trailing_stop_positive_offset:\n#            return self.trailing_stop_positive\n#\n#        for x in self.minimal_roi:\n#            dur = int(x)\n#            roi = self.minimal_roi[x]\n#            if dur_minutes >= dur and current_profit_comp >= roi:\n#                return 0.001\n\n#        return stoploss\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        dataframe['hma_50'] = pta.hma(dataframe['close'], 50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV5HO/ElliotV5HO.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 9,\n#     \"ewo_high\": 3.439,\n#     \"ewo_low\": -9.168,\n#     \"low_offset\": 0.977,\n#     \"rsi_buy\": 70,\n# }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 26,\n#     \"high_offset\": 0.994,\n# }\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 11,\n    \"ewo_high\": 2.337,\n    \"ewo_low\": -15.87,\n    \"low_offset\": 0.979,\n    \"rsi_buy\": 55,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 17,\n    \"high_offset\": 0.997,\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\ndef populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n    # Momentum Indicators\n    # ------------------------------------\n\n    # ADX\n    dataframe['adx'] = ta.ADX(dataframe)\n\n    # Plus Directional Indicator / Movement\n    dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n    dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n    # Minus Directional Indicator / Movement\n    dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n    dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n    # Aroon, Aroon Oscillator\n    aroon = ta.AROON(dataframe)\n    dataframe['aroonup'] = aroon['aroonup']\n    dataframe['aroondown'] = aroon['aroondown']\n    dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n    # Awesome Oscillator\n    dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n    # Keltner Channel\n    keltner = qtpylib.keltner_channel(dataframe)\n    dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n    dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n    dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n    dataframe[\"kc_percent\"] = (\n        (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n    )\n    dataframe[\"kc_width\"] = (\n        (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n    )\n\n    # Ultimate Oscillator\n    dataframe['uo'] = ta.ULTOSC(dataframe)\n\n    # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n    dataframe['cci'] = ta.CCI(dataframe)\n\n    # RSI\n    dataframe['rsi'] = ta.RSI(dataframe)\n\n    # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n    rsi = 0.1 * (dataframe['rsi'] - 50)\n    dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n    # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n    dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n    # # Stochastic Slow\n    stoch = ta.STOCH(dataframe)\n    dataframe['slowd'] = stoch['slowd']\n    dataframe['slowk'] = stoch['slowk']\n\n    # Stochastic Fast\n    stoch_fast = ta.STOCHF(dataframe)\n    dataframe['fastd'] = stoch_fast['fastd']\n    dataframe['fastk'] = stoch_fast['fastk']\n\n    # # Stochastic RSI\n    # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n    # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n    stoch_rsi = ta.STOCHRSI(dataframe)\n    dataframe['fastd_rsi'] = stoch_rsi['fastd']\n    dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n    # MACD\n    macd = ta.MACD(dataframe)\n    dataframe['macd'] = macd['macd']\n    dataframe['macdsignal'] = macd['macdsignal']\n    dataframe['macdhist'] = macd['macdhist']\n\n    # MFI\n    dataframe['mfi'] = ta.MFI(dataframe)\n\n    # # ROC\n    dataframe['roc'] = ta.ROC(dataframe)\n\n    # Overlap Studies\n    # ------------------------------------\n\n    # Bollinger Bands\n    bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n    dataframe['bb_lowerband'] = bollinger['lower']\n    dataframe['bb_middleband'] = bollinger['mid']\n    dataframe['bb_upperband'] = bollinger['upper']\n    dataframe[\"bb_percent\"] = (\n        (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n        (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n    )\n    dataframe[\"bb_width\"] = (\n        (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n    )\n\n    # Parabolic SAR\n    dataframe['sar'] = ta.SAR(dataframe)\n\n    # TEMA - Triple Exponential Moving Average\n    dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n    # Cycle Indicator\n    # ------------------------------------\n    # Hilbert Transform Indicator - SineWave\n    hilbert = ta.HT_SINE(dataframe)\n    dataframe['htsine'] = hilbert['sine']\n    dataframe['htleadsine'] = hilbert['leadsine']\n\n    # Pattern Recognition - Bullish candlestick patterns\n    # ------------------------------------\n    # Hammer: values [0, 100]\n    dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n    # Inverted Hammer: values [0, 100]\n    dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n    # Dragonfly Doji: values [0, 100]\n    dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n    # Piercing Line: values [0, 100]\n    dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe)  # values [0, 100]\n    # Morningstar: values [0, 100]\n    dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe)  # values [0, 100]\n    # Three White Soldiers: values [0, 100]\n    dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe)  # values [0, 100]\n\n    # Pattern Recognition - Bearish candlestick patterns\n    # ------------------------------------\n    # Hanging Man: values [0, 100]\n    dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n    # Shooting Star: values [0, 100]\n    dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n    # Gravestone Doji: values [0, 100]\n    dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n    # Dark Cloud Cover: values [0, 100]\n    dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n    # Evening Doji Star: values [0, 100]\n    dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n    # Evening Star: values [0, 100]\n    dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n    # Pattern Recognition - Bullish/Bearish candlestick patterns\n    # ------------------------------------\n    # Three Line Strike: values [0, -100, 100]\n    dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n    # Spinning Top: values [0, -100, 100]\n    dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe)  # values [0, -100, 100]\n    # Engulfing: values [0, -100, 100]\n    dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe)  # values [0, -100, 100]\n    # Harami: values [0, -100, 100]\n    dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe)  # values [0, -100, 100]\n    # Three Outside Up/Down: values [0, -100, 100]\n    dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe)  # values [0, -100, 100]\n    # Three Inside Up/Down: values [0, -100, 100]\n    dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe)  # values [0, -100, 100]\n\n    # # Chart type\n    # # ------------------------------------\n    # # Heikin Ashi Strategy\n    heikinashi = qtpylib.heikinashi(dataframe)\n    dataframe['ha_open'] = heikinashi['open']\n    dataframe['ha_close'] = heikinashi['close']\n    dataframe['ha_high'] = heikinashi['high']\n    dataframe['ha_low'] = heikinashi['low']\n\n    return dataframe\n\n\nclass ElliotV5HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    # minimal_roi = {\n    #     \"0\": 0.215,\n    #     \"40\": 0.132,\n    #     \"87\": 0.086,\n    #     \"201\": 0.03\n    # }\n\n    # # Stoploss:\n    # stoploss = -0.189\n    # # ROI table:\n    # minimal_roi = {\n    #     \"0\": 0.178,\n    #     \"11\": 0.085,\n    #     \"31\": 0.029,\n    #     \"126\": 0\n    # }\n\n    # # Stoploss:\n    # stoploss = -0.339\n\n    # # Trailing stop:\n    # trailing_stop = True\n    # trailing_stop_positive = 0.177\n    # trailing_stop_positive_offset = 0.243\n    # trailing_only_offset_is_reached = False\n    # # ROI table:\n    # minimal_roi = {\n    #     \"0\": 0.207,\n    #     \"17\": 0.049,\n    #     \"28\": 0.026,\n    #     \"109\": 0\n    # }\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.051,\n        \"20\": 0.032,\n        \"45\": 0.016,\n        \"70\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.302\n\n    # # Trailing stop:\n    # trailing_stop = True\n    # trailing_stop_positive = 0.05\n    # trailing_stop_positive_offset = 0.1\n    # trailing_only_offset_is_reached = False\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 79\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def custom_stoploss(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                        current_profit: float, **kwargs) -> float:\n        df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        candle = df.iloc[-1].squeeze()\n\n        # Positive market, big trailing, we are catching a big fish.\n        if current_profit > 0.30:\n            return -0.15\n\n        if current_profit > 0.2:\n            return stoploss_from_open(+0.10, current_profit)\n\n        # 5% profit guaranteed.\n        if current_profit > 0.1:\n            return stoploss_from_open(+0.05, current_profit)\n\n        return 1\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV5HOMod2/ElliotV5HOMod2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass ElliotV5HOMod2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 17,\n        \"ewo_high\": 3.34,\n        \"ewo_low\": -17.457,\n        \"low_offset\": 0.978,\n        \"rsi_buy\": 60\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 39,\n        \"high_offset\": 1.011,\n        \"high_offset_2\": 0.997\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.05,\n        \"40\": 0.04,\n        \"201\": 0.03\n    }\n\n    # Stoploss:\n    stoploss = -0.99\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space=\"sell\", optimize=True\n    )\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(\n        30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 79\n\n    plot_config = {\n        'main_plot': {\n            f'ma_buy_{base_nb_candles_buy.value}': {'color': 'orange'},\n            f'ma_sell_{base_nb_candles_sell.value}': {'color': 'green'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe)\n                             for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if self.config['runmode'].value == 'hyperopt':\n            # Calculate all ma_buy values\n            for val in self.base_nb_candles_buy.range:\n                dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n            # Calculate all ma_sell values\n            for val in self.base_nb_candles_sell.range:\n                dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        else:\n            dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] = ta.EMA(\n                dataframe, timeperiod=self.base_nb_candles_buy.value)\n\n            dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] = ta.EMA(\n                dataframe, timeperiod=self.base_nb_candles_sell.value)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(\n            dataframe['close'], window=50)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(\n            dataframe['close'], window=50)\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                        current_profit: float, **kwargs) -> float:\n        df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        candle = df.iloc[-1].squeeze()\n\n        if current_profit < 0.001 and current_time - timedelta(minutes=140) > trade.open_date_utc:\n            return -0.005\n\n        return 1\n"
  },
  {
    "path": "strategies/ElliotV5HOMod3/ElliotV5HOMod3.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass ElliotV5HOMod3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 17,\n        \"ewo_high\": 3.34,\n        \"ewo_low\": -17.457,\n        \"low_offset\": 0.978,\n        \"rsi_buy\": 60\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 39,\n        \"high_offset\": 1.011\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.07,\n    }\n\n    # Stoploss:\n    stoploss = -0.06\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(\n        30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = False\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 79\n\n    plot_config = {\n        'main_plot': {\n            f'ma_buy_{base_nb_candles_buy.value}': {'color': 'orange'},\n            f'ma_sell_{base_nb_candles_sell.value}': {'color': 'green'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe)\n                             for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if self.config['runmode'].value == 'hyperopt':\n            # Calculate all ma_buy values\n            for val in self.base_nb_candles_buy.range:\n                dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n            # Calculate all ma_sell values\n            for val in self.base_nb_candles_sell.range:\n                dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        else:\n            dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] = ta.EMA(\n                dataframe, timeperiod=self.base_nb_candles_buy.value)\n\n            dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] = ta.EMA(\n                dataframe, timeperiod=self.base_nb_candles_sell.value)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0.03):\n            return 0.01\n        elif (current_profit > 0.018):\n            return 0.005\n        return -0.99\n"
  },
  {
    "path": "strategies/ElliotV7/ElliotV7.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_low\": -19.988,\n      \"low_offset\": 0.975,\n      \"rsi_buy\": 69\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\ndef populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        return dataframe\n\nclass ElliotV7(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.051,\n        \"10\": 0.031,\n        \"22\": 0.018,\n        \"66\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.32\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 39\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n    \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if current_profit < -0.1 and current_time - timedelta(minutes=720) > trade.open_date_utc:\n            return -0.01\n\n        return -0.99\n\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        \n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        informative_1h['rsi_100'] = ta.RSI(informative_1h, timeperiod=100)\n        return informative_1h\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_lowerband'] = bollinger['lower']       \n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        \n        #dataframe['hma_50']=hmao\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']       \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_100'] = ta.RSI(dataframe, timeperiod=100)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   \n                (dataframe['uptrend_1h'] > 0)&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n\n            )\n        )\n\n        conditions.append(\n            (   \n                \n                (dataframe['uptrend_1h'] > 0)&\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['sma_9']>dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe"
  },
  {
    "path": "strategies/ElliotV8HO/ElliotV8HO.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nfrom freqtrade.strategy import DecimalParameter, IntParameter\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass ElliotV8HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Sell hyperspace params: v1\n    # sell_params = {\n    #     \"base_nb_candles_sell\": 24,\n    #     \"high_offset\": 0.991,\n    #     \"high_offset_2\": 0.997\n    # }\n\n    # Sell hyperspace params: v5\n    # sell_params = {\n    #     \"base_nb_candles_sell\": 30,\n    #     \"high_offset\": 0.973,\n    #     \"high_offset_2\": 1.121,\n    # }\n\n    # Sell hyperspace params: v6\n    sell_params = {\n        \"base_nb_candles_sell\": 24,\n        \"high_offset\": 1.011,\n        \"high_offset_2\": 0.997,\n    }\n\n    # Buy hyperspace params: v1\n    buy_params = {\n        \"base_nb_candles_buy\": 19,\n        \"ewo_high\": 5.417,\n        \"ewo_low\": -17.251,\n        \"low_offset\": 0.983,\n        \"rsi_buy\": 61,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.08,\n        \"40\": 0.032,\n        \"87\": 0.016\n    }\n\n    # Stoploss:\n    stoploss = -0.189\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        15, 60, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        15, 60, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.9, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.2, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -15.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        1.0, 8.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(\n        25, 75, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        # 'sell': 'ioc'\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe)\n                             for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if self.config['runmode'].value == 'hyperopt':\n            # Calculate all ma_buy values\n            for val in self.base_nb_candles_buy.range:\n                dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n            # Calculate all ma_sell values\n            for val in self.base_nb_candles_sell.range:\n                dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        else:\n            dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] = ta.EMA(\n                dataframe, timeperiod=self.base_nb_candles_buy.value)\n\n            dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] = ta.EMA(\n                dataframe, timeperiod=self.base_nb_candles_sell.value)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(\n            dataframe['close'], window=50)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n\n\n            )\n        )\n\n        conditions.append(\n            (\n\n\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV8_original/ElliotV8_original.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_low\": -19.988,\n      \"low_offset\": 0.975,\n      \"rsi_buy\": 69\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\n\nclass ElliotV8_original(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.08,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.32\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   \n\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n\n            )\n        )\n\n        conditions.append(\n            (   \n                \n\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['close']>dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe"
  },
  {
    "path": "strategies/ElliotV8_original_ichiv2/ElliotV8_original_ichiv2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos # changes by IcHiAT\n\n# Buy hyperspace params:\nbuy_params = {\n        \"base_nb_candles_buy\": 12,\n        \"ewo_high\": 3.147,\n        \"ewo_low\": -17.145,\n        \"low_offset\": 0.987,\n        \"rsi_buy\": 57,\n    }\n\n# Sell hyperspace params:\nsell_params = {\n        \"base_nb_candles_sell\": 22,\n        \"high_offset\": 1.008,\n        \"high_offset_2\": 1.016,\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=3):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\n\nclass ElliotV8_original_ichiv2(IStrategy):\n    INTERFACE_VERSION = 2\n    \"\"\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.08,\n        \"20\": 0.04,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n    \"\"\"\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration_candles\": 5\n            },\n            {\n                \"method\": \"MaxDrawdown\",\n                \"lookback_period_candles\": 48,\n                \"trade_limit\": 20,\n                \"stop_duration_candles\": 4,\n                \"max_allowed_drawdown\": 0.2\n            },\n            {\n                \"method\": \"StoplossGuard\",\n                \"lookback_period_candles\": 24,\n                \"trade_limit\": 4,\n                \"stop_duration_candles\": 2,\n                \"only_per_pair\": False\n            },\n            {\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period_candles\": 6,\n                \"trade_limit\": 2,\n                \"stop_duration_candles\": 60,\n                \"required_profit\": 0.02\n            },\n            {\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period_candles\": 24,\n                \"trade_limit\": 4,\n                \"stop_duration_candles\": 2,\n                \"required_profit\": 0.01\n            }\n        ]\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.99,\n    }\n\n    # Stoploss:\n    stoploss = -0.20\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   \n\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n\n            )\n        )\n\n        conditions.append(\n            (   \n                \n\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['close']>dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ElliotV8_original_ichiv3/ElliotV8_original_ichiv3.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos # changes by IcHiAT\n\n# Buy hyperspace params:\nbuy_params = {\n        \"base_nb_candles_buy\": 12,\n        \"ewo_high\": 3.147,\n        \"ewo_low\": -17.145,\n        \"low_offset\": 0.987,\n        \"rsi_buy\": 57,\n    }\n\n# Sell hyperspace params:\nsell_params = {\n        \"base_nb_candles_sell\": 22,\n        \"high_offset\": 1.008,\n        \"high_offset_2\": 1.016,\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=3):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\n\nclass ElliotV8_original_ichiv3(IStrategy):\n    INTERFACE_VERSION = 2\n    \"\"\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.08,\n        \"20\": 0.04,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0,\n        \"202\": -1\n    }\n    \"\"\"\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration_candles\": 5\n            },\n            {\n                \"method\": \"MaxDrawdown\",\n                \"lookback_period_candles\": 48,\n                \"trade_limit\": 20,\n                \"stop_duration_candles\": 4,\n                \"max_allowed_drawdown\": 0.2\n            },\n            {\n                \"method\": \"StoplossGuard\",\n                \"lookback_period_candles\": 24,\n                \"trade_limit\": 4,\n                \"stop_duration_candles\": 2,\n                \"only_per_pair\": False\n            },\n            {\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period_candles\": 6,\n                \"trade_limit\": 2,\n                \"stop_duration_candles\": 60,\n                \"required_profit\": 0.02\n            },\n            {\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period_candles\": 24,\n                \"trade_limit\": 4,\n                \"stop_duration_candles\": 2,\n                \"required_profit\": 0.01\n            }\n        ]\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.99,\n        \"200\": -1\n    }\n\n    # Stoploss:\n    stoploss = -0.20\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   \n\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n\n            )\n        )\n\n        conditions.append(\n            (   \n                \n\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['close']>dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Elliotv8/Elliotv8.py",
    "content": "# for live trailing_stop = False and use_custom_stoploss = True\n# for backtest trailing_stop = True and use_custom_stoploss = False\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_low\": -19.988,\n      \"low_offset\": 0.975,\n      \"rsi_buy\": 69\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\n\nclass Elliotv8(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.32\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   \n\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n\n            )\n        )\n\n        conditions.append(\n            (   \n                \n\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['close']>dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/FRAYSTRAT/FRAYSTRAT.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass FRAYSTRAT(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    @property\n    def protections(self):\n            return [\n                {\n                    \"method\": \"CooldownPeriod\",\n                    \"stop_duration_candles\": 5\n                },\n                {\n                    \"method\": \"MaxDrawdown\",\n                    \"lookback_period_candles\": 48,\n                    \"trade_limit\": 5,\n                    \"stop_duration_candles\": 4,\n                    \"max_allowed_drawdown\": 0.5\n                },\n                {\n                    \"method\": \"StoplossGuard\",\n                    \"lookback_period_candles\": 24,\n                    \"trade_limit\": 3,\n                    \"stop_duration_candles\": 3,\n                    \"only_per_pair\": False\n                },\n                {\n                    \"method\": \"LowProfitPairs\",\n                    \"lookback_period_candles\": 24,\n                    \"trade_limit\": 2,\n                    \"stop_duration_candles\": 60,\n                    \"required_profit\": 0.02\n                },\n                {\n                    \"method\": \"LowProfitPairs\",\n                    \"lookback_period_candles\": 24,\n                    \"trade_limit\": 4,\n                    \"stop_duration_candles\": 2,\n                    \"required_profit\": 0.03\n                }\n            ]\n    \n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.12,\n        \"30\": 0.08,\n        \"0\": 0.06\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.1\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03  # Disabled / not configured\n\n    # Hyperoptable parameters\n    buy_rsi = IntParameter(low=30, high=50, default=46, space='buy', optimize=True, load=True)\n    sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True)\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'blue'},\n            'ema7':{'color': 'red'},\n            'ema12':{'color': 'yellow'}\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=16, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) /\n        #     dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema7'] = ta.EMA(dataframe, timeperiod=7)\n        dataframe['ema30'] = ta.EMA(dataframe, timeperiod=30)\n        dataframe['ema12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=7)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n             (\n                # Signal: RSI crosses above 30\n                (qtpylib.crossed_above(dataframe['rsi'], self.buy_rsi.value)) &\n                (dataframe['tema'] < dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                (dataframe['tema'] < dataframe['ema7']) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n             )|\n            \n            (\n                (dataframe['ema7'] < dataframe['ema12']) &\n                (dataframe['rsi'] > 40 ) &\n                (dataframe['rsi'] > dataframe['rsi'].shift(1)) &\n                (dataframe['macdsignal'] > dataframe['macd']) &\n                (dataframe['volume'] > 0)\n                \n            )|\n\n            (\n                (dataframe['macdsignal'] < dataframe['macd']) &\n                (dataframe['ema12'] < dataframe['ema7']) &\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 70\n                (qtpylib.crossed_above(dataframe['rsi'], self.sell_rsi.value)) &\n                (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                (dataframe['tema'] < dataframe['tema'].shift(1)) & # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            )|\n            (\n                (dataframe['ema7'] > dataframe['ema12']) &\n                (dataframe['tema'] > dataframe['ema7']) &\n                (dataframe['rsi'] < dataframe['rsi'].shift(1)) &\n                (dataframe['macdsignal'] > dataframe['macd']) &\n                (dataframe['volume'] > 0)\n                \n            )|\n            (\n                  \n                (dataframe['macdsignal'] > dataframe['macd']) &\n                (dataframe['macd'] > dataframe['macdsignal'].shift(1)) &\n                (dataframe['tema'] > dataframe['ema7']) &\n                (dataframe['tema'] < dataframe['tema'].shift(1)) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Fakebuy/Fakebuy.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\n\n\"\"\"\nTODO: \n    - Better buy signal.\n    - Potentially leverage an external data source?\n\"\"\"\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\nclass Fakebuy(IStrategy):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'bbdelta-close': 0.01697,\n        'bbdelta-tail': 0.85522,\n        'close-bblower': 0.01167,\n        'closedelta-close': 0.00513,\n        'rocr-1h': 0.54614,\n        'volume': 32\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.15,\n        \"5\": 0.025,\n        \"10\": 0.015,\n        \"30\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.085\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 168\n\n    custom_trade_info = {}\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        return informative_pairs\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Misc. calculations regarding existing open positions (reset on every loop iteration)\n        self.custom_trade_info[metadata['pair']] = trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n            other_trades = Trade.get_trades([Trade.pair != metadata['pair'], Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(metadata['pair'])\n                active_trade[0].adjust_min_max_rates(current_rate)\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = active_trade[0].calc_profit_ratio(active_trade[0].max_rate)\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                total_other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(total_other_profit) \n\n        self.custom_trade_info[metadata['pair']] = trade_data\n\n        # Set up Bollinger Bands\n        mid, lower = bollinger_bands(dataframe['close'], window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb-lowerband'] = bollinger['lower']\n        dataframe['bb-middleband'] = bollinger['mid']\n    \n        # Set up other indicators\n        dataframe['volume-mean-slow'] = dataframe['volume'].rolling(window=24).mean()\n        dataframe['rmi-slow'] = RMI(dataframe, length=20, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=9, mom=3)\n        dataframe['rocr'] = ta.ROCR(dataframe, timeperiod=28)\n        dataframe['ema-slow'] = ta.EMA(dataframe, timeperiod=50)\n\n        # Trend Calculations\n        dataframe['max'] = dataframe['high'].rolling(12).max()      \n        dataframe['min'] = dataframe['low'].rolling(12).min()       \n        dataframe['upper'] = np.where(dataframe['max'] > dataframe['max'].shift(),1,0)      \n        dataframe['lower'] = np.where(dataframe['min'] < dataframe['min'].shift(),1,0)      \n        dataframe['up_trend'] = np.where(dataframe['upper'].rolling(3, min_periods=1).sum() != 0,1,0)      \n        dataframe['dn_trend'] = np.where(dataframe['lower'].rolling(3, min_periods=1).sum() != 0,1,0)\n\n        # Informative Pair Indicators\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rocr'] = ta.ROCR(informative, timeperiod=168) \n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # Persist a buy signal for existing trades to make use of ignore_roi_if_buy_signal = True\n        # when this buy signal is not present a sell can happen according to ROI table\n        if trade_data['active_trade']:\n            if (trade_data['peak_profit'] > 0):\n                conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * 0.8))\n            conditions.append(dataframe['rmi-slow'] >= 60)\n\n        # Normal buy triggers that apply to new trades we want to enter\n        else:\n            dataframe.loc[\n                (\n                    (dataframe['rocr_1h'] > params['rocr-1h'])\n                ) &\n                ((      \n                        (dataframe['lower'].shift() > 0) &\n                        (dataframe['bbdelta'] > (dataframe['close'] * params['bbdelta-close'])) &\n                        (dataframe['closedelta'] > (dataframe['close'] * params['closedelta-close'])) &\n                        (dataframe['tail'] < (dataframe['bbdelta'] * params['bbdelta-tail'])) &\n                        (dataframe['close'] < dataframe['lower'].shift()) &\n                        (dataframe['close'] <= dataframe['close'].shift())\n                ) |\n                (       \n                        (dataframe['close'] < dataframe['ema-slow']) &\n                        (dataframe['close'] < params['close-bblower'] * dataframe['bb-lowerband']) &\n                        (dataframe['volume'] < (dataframe['volume-mean-slow'].shift(1) * params['volume']))\n                )),\n                'fake_buy'\n            ] = 1\n\n            conditions.append(dataframe['fake_buy'].shift(1).eq(1))        \n            conditions.append(dataframe['fake_buy'].eq(1))\n\n        # applies to both new buys and persisting buy signal\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n        \n        # if we are in an active trade for this pair\n        if trade_data['active_trade']:\n            # if we are at a loss, consider what the trend looks and preempt the stoploss\n            conditions.append(\n                (trade_data['current_profit'] < 0) &\n                (trade_data['current_profit'] > self.stoploss) &  \n                (dataframe['dn_trend'] == 1) &\n                (dataframe['rmi-fast'] < 50) &\n                (dataframe['volume'].gt(0))\n            )\n\n            # if there are other open trades in addition to this one, consider the average profit \n            # across them all (not including this one), don't sell if entire market is down big and wait for recovery\n            if trade_data['other_trades']:\n                conditions.append(trade_data['avg_other_profit'] >= -0.005)\n\n        # the bot comes through this loop even when there isn't an open trade to sell\n        # so we pass an impossible condiiton here because we don't want a sell signal \n        # clogging up the charts and not having one leads the bot to crash\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    \"\"\"\n    Custom methods\n    \"\"\"\n    def get_current_price(self, pair: str) -> float:\n        \"\"\"\n        # Using ticker seems significantly faster than orderbook.\n        side = \"asks\"\n        if (self.config['ask_strategy']['price_side'] == \"bid\"):\n            side = \"bids\"\n        \n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[side][0][0]\n        \"\"\"\n\n        ticker = self.dp.ticker(pair)\n        current_price = ticker['last']\n\n        return current_price\n\n    \"\"\"\n    Price protection on trade entry and timeouts, built-in Freqtrade functionality\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n\n"
  },
  {
    "path": "strategies/FastSupertrend/FastSupertrend.py",
    "content": "\"\"\"\nSupertrend strategy:\n* Description: Generate a 3 supertrend indicators for 'buy' strategies & 3 supertrend indicators for 'sell' strategies\n               Buys if the 3 'buy' indicators are 'up'\n               Sells if the 3 'sell' indicators are 'down'\n* Author: @juankysoriano (Juan Carlos Soriano)\n* github: https://github.com/juankysoriano/\n\n*** NOTE: This Supertrend strategy is just one of many possible strategies using `Supertrend` as indicator. It should on any case used at your own risk. \n          It comes with at least a couple of caveats:\n            1. The implementation for the `supertrend` indicator is based on the following discussion: https://github.com/freqtrade/freqtrade-strategies/issues/30 . Concretelly https://github.com/freqtrade/freqtrade-strategies/issues/30#issuecomment-853042401\n            2. The implementation for `supertrend` on this strategy is not validated; meaning this that is not proven to match the results by the paper where it was originally introduced or any other trusted academic resources\n\"\"\"\n\nimport logging\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy.hyper import IntParameter\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport numpy as np\nimport time\nimport pandas as pd\n\nclass FastSupertrend(IStrategy):\n    # Buy params, Sell params, ROI, Stoploss and Trailing Stop are values generated by 'freqtrade hyperopt --strategy Supertrend --hyperopt-loss ShortTradeDurHyperOptLoss --timerange=20210101- --timeframe=1h --spaces all'\n    # It's encourage you find the values that better suites your needs and risk management strategies\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_m1\": 4,\n        \"buy_m2\": 7,\n        \"buy_m3\": 1,\n        \"buy_p1\": 8,\n        \"buy_p2\": 9,\n        \"buy_p3\": 8,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_m1\": 1,\n        \"sell_m2\": 3,\n        \"sell_m3\": 6,\n        \"sell_p1\": 16,\n        \"sell_p2\": 18,\n        \"sell_p3\": 18,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.087,\n        \"372\": 0.058,\n        \"861\": 0.029,\n        \"2221\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.265\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.05\n    trailing_stop_positive_offset = 0.144\n    trailing_only_offset_is_reached = False\n\n    timeframe = '1h'\n\n    startup_candle_count = 18\n\n    buy_m1 = IntParameter(1, 7, default=4)\n    buy_m2 = IntParameter(1, 7, default=4)\n    buy_m3 = IntParameter(1, 7, default=4)\n    buy_p1 = IntParameter(7, 21, default=14)\n    buy_p2 = IntParameter(7, 21, default=14)\n    buy_p3 = IntParameter(7, 21, default=14)\n\n    sell_m1 = IntParameter(1, 7, default=4)\n    sell_m2 = IntParameter(1, 7, default=4)\n    sell_m3 = IntParameter(1, 7, default=4)\n    sell_p1 = IntParameter(7, 21, default=14)\n    sell_p2 = IntParameter(7, 21, default=14)\n    sell_p3 = IntParameter(7, 21, default=14)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        for multiplier in self.buy_m1.range:\n            for period in self.buy_p1.range:\n                dataframe[f'supertrend_1_buy_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.buy_m2.range:\n            for period in self.buy_p2.range:\n                dataframe[f'supertrend_2_buy_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.buy_m3.range:\n            for period in self.buy_p3.range:\n                dataframe[f'supertrend_3_buy_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.sell_m1.range:\n            for period in self.sell_p1.range:\n                dataframe[f'supertrend_1_sell_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.sell_m2.range:\n            for period in self.sell_p2.range:\n                dataframe[f'supertrend_2_sell_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.sell_m3.range:\n            for period in self.sell_p3.range:\n                dataframe[f'supertrend_3_sell_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n               (dataframe[f'supertrend_1_buy_{self.buy_m1.value}_{self.buy_p1.value}'] == 'up') &\n               (dataframe[f'supertrend_2_buy_{self.buy_m2.value}_{self.buy_p2.value}'] == 'up') &\n               (dataframe[f'supertrend_3_buy_{self.buy_m3.value}_{self.buy_p3.value}'] == 'up') & # The three indicators are 'up' for the current candle\n               (dataframe['volume'] > 0) # There is at least some trading volume\n        ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n               (dataframe[f'supertrend_1_sell_{self.sell_m1.value}_{self.sell_p1.value}'] == 'down') &\n               (dataframe[f'supertrend_2_sell_{self.sell_m2.value}_{self.sell_p2.value}'] == 'down') &\n               (dataframe[f'supertrend_3_sell_{self.sell_m3.value}_{self.sell_p3.value}'] == 'down') & # The three indicators are 'down' for the current candle\n               (dataframe['volume'] > 0) # There is at least some trading volume\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n    \"\"\"\n        Supertrend Indicator; adapted for freqtrade\n        from: https://github.com/freqtrade/freqtrade-strategies/issues/30\n    \"\"\"\n    def supertrend(self, dataframe: DataFrame, multiplier, period):\n        start_time = time.time()\n\n        df = dataframe.copy()\n        last_row = dataframe.tail(1).index.item()\n\n        df['TR'] = ta.TRANGE(df)\n        df['ATR'] = ta.SMA(df['TR'], period)\n\n        st = 'ST_' + str(period) + '_' + str(multiplier)\n        stx = 'STX_' + str(period) + '_' + str(multiplier)\n\n        # Compute basic upper and lower bands\n        BASIC_UB = ((df['high'] + df['low']) / 2 + multiplier * df['ATR']).values\n        BASIC_LB = ((df['high'] + df['low']) / 2 - multiplier * df['ATR']).values\n        FINAL_UB = np.zeros(last_row + 1)\n        FINAL_LB = np.zeros(last_row + 1)\n        ST = np.zeros(last_row + 1)\n        CLOSE = df['close'].values\n\n        # Compute final upper and lower bands\n        for i in range(period, last_row):\n            FINAL_UB[i] = BASIC_UB[i] if BASIC_UB[i] < FINAL_UB[i - 1] or CLOSE[i - 1] > FINAL_UB[i - 1] else FINAL_UB[i - 1]\n            FINAL_LB[i] = BASIC_LB[i] if BASIC_LB[i] > FINAL_LB[i - 1] or CLOSE[i - 1] < FINAL_LB[i - 1] else FINAL_LB[i - 1]\n\n        # Set the Supertrend value\n        for i in range(period, last_row):\n            ST[i] = FINAL_UB[i] if ST[i - 1] == FINAL_UB[i - 1] and CLOSE[i] <= FINAL_UB[i] else \\\n                    FINAL_LB[i] if ST[i - 1] == FINAL_UB[i - 1] and CLOSE[i] >  FINAL_UB[i] else \\\n                    FINAL_LB[i] if ST[i - 1] == FINAL_LB[i - 1] and CLOSE[i] >= FINAL_LB[i] else \\\n                    FINAL_UB[i] if ST[i - 1] == FINAL_LB[i - 1] and CLOSE[i] <  FINAL_LB[i] else 0.00\n        df_ST = pd.DataFrame(ST, columns=[st])\n        df = pd.concat([df, df_ST],axis=1)\n\n        # Mark the trend direction up/down\n        df[stx] = np.where((df[st] > 0.00), np.where((df['close'] < df[st]), 'down',  'up'), np.NaN)\n\n        df.fillna(0, inplace=True)\n\n        end_time = time.time()\n        # print(\"total time taken this loop: \", end_time - start_time)\n\n        return DataFrame(index=df.index, data={\n            'ST' : df[st],\n            'STX' : df[stx]\n        })\n"
  },
  {
    "path": "strategies/FastSupertrendOpt/FastSupertrendOpt.py",
    "content": "\"\"\"\nSupertrend strategy:\n* Description: Generate a 3 supertrend indicators for 'buy' strategies & 3 supertrend indicators for 'sell' strategies\n               Buys if the 3 'buy' indicators are 'up'\n               Sells if the 3 'sell' indicators are 'down'\n* Author: @juankysoriano (Juan Carlos Soriano)\n* github: https://github.com/juankysoriano/\n\n*** NOTE: This Supertrend strategy is just one of many possible strategies using `Supertrend` as indicator. It should on any case used at your own risk. \n          It comes with at least a couple of caveats:\n            1. The implementation for the `supertrend` indicator is based on the following discussion: https://github.com/freqtrade/freqtrade-strategies/issues/30 . Concretelly https://github.com/freqtrade/freqtrade-strategies/issues/30#issuecomment-853042401\n            2. The implementation for `supertrend` on this strategy is not validated; meaning this that is not proven to match the results by the paper where it was originally introduced or any other trusted academic resources\n\"\"\"\n\nimport logging\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy.hyper import IntParameter\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport numpy as np\nimport time\nimport pandas as pd\n\nclass FastSupertrendOpt(IStrategy):\n    # Buy params, Sell params, ROI, Stoploss and Trailing Stop are values generated by 'freqtrade hyperopt --strategy Supertrend --hyperopt-loss ShortTradeDurHyperOptLoss --timerange=20210101- --timeframe=1h --spaces all'\n    # It's encourage you find the values that better suites your needs and risk management strategies\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_m1\": 4,\n        \"buy_m2\": 7,\n        \"buy_m3\": 1,\n        \"buy_p1\": 8,\n        \"buy_p2\": 9,\n        \"buy_p3\": 8,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_m1\": 1,\n        \"sell_m2\": 3,\n        \"sell_m3\": 6,\n        \"sell_p1\": 16,\n        \"sell_p2\": 18,\n        \"sell_p3\": 18,\n    }\n    \n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.087,\n        \"372\": 0.058,\n        \"861\": 0.029,\n        \"2221\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.265\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.05\n    trailing_stop_positive_offset = 0.144\n    trailing_only_offset_is_reached = False\n\n    timeframe = '1h'\n\n    startup_candle_count = 18\n\n    buy_m1 = IntParameter(1, 7, default=4, space='buy', load=True, optimize=True)\n    buy_m2 = IntParameter(1, 7, default=4, space='buy', load=True, optimize=True)\n    buy_m3 = IntParameter(1, 7, default=4, space='buy', load=True, optimize=True)\n    buy_p1 = IntParameter(7, 21, default=14, space='buy', load=True, optimize=True)\n    buy_p2 = IntParameter(7, 21, default=14, space='buy', load=True, optimize=True)\n    buy_p3 = IntParameter(7, 21, default=14, space='buy', load=True, optimize=True)\n\n    sell_m1 = IntParameter(1, 7, default=4, space='sell', load=True, optimize=True)\n    sell_m2 = IntParameter(1, 7, default=4, space='sell', load=True, optimize=True)\n    sell_m3 = IntParameter(1, 7, default=4, space='sell', load=True, optimize=True)\n    sell_p1 = IntParameter(7, 21, default=14, space='sell', load=True, optimize=True)\n    sell_p2 = IntParameter(7, 21, default=14, space='sell', load=True, optimize=True)\n    sell_p3 = IntParameter(7, 21, default=14, space='sell', load=True, optimize=True)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['supertrend_1_buy'] = self.supertrend(dataframe, self.buy_m1.value, int(self.buy_p1.value))['STX'] \n        dataframe['supertrend_2_buy'] = self.supertrend(dataframe, self.buy_m2.value, int(self.buy_p2.value))['STX'] \n        dataframe['supertrend_3_buy'] = self.supertrend(dataframe, self.buy_m3.value, int(self.buy_p3.value))['STX'] \n        dataframe['supertrend_1_sell'] = self.supertrend(dataframe, self.sell_m1.value, int(self.sell_p1.value))['STX'] \n        dataframe['supertrend_2_sell'] = self.supertrend(dataframe, self.sell_m2.value, int(self.sell_p2.value))['STX'] \n        dataframe['supertrend_3_sell'] = self.supertrend(dataframe, self.sell_m3.value, int(self.sell_p3.value))['STX'] \n\n        dataframe.loc[\n            (\n               (dataframe[f'supertrend_1_buy'] == 'up') &\n               (dataframe[f'supertrend_2_buy'] == 'up') &\n               (dataframe[f'supertrend_3_buy'] == 'up') & # The three indicators are 'up' for the current candle\n               (dataframe['volume'] > 0) # There is at least some trading volume\n        ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n               (dataframe[f'supertrend_1_sell'] == 'down') &\n               (dataframe[f'supertrend_2_sell'] == 'down') &\n               (dataframe[f'supertrend_3_sell'] == 'down') & # The three indicators are 'down' for the current candle\n               (dataframe['volume'] > 0) # There is at least some trading volume\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n    \"\"\"\n        Supertrend Indicator; adapted for freqtrade\n        from: https://github.com/freqtrade/freqtrade-strategies/issues/30\n    \"\"\"\n    def supertrend(self, dataframe: DataFrame, multiplier, period):\n        start_time = time.time()\n\n        df = dataframe.copy()\n        last_row = dataframe.tail(1).index.item()\n\n        df['TR'] = ta.TRANGE(df)\n        df['ATR'] = ta.SMA(df['TR'], period)\n\n        st = 'ST_' + str(period) + '_' + str(multiplier)\n        stx = 'STX_' + str(period) + '_' + str(multiplier)\n\n        # Compute basic upper and lower bands\n        BASIC_UB = ((df['high'] + df['low']) / 2 + multiplier * df['ATR']).values\n        BASIC_LB = ((df['high'] + df['low']) / 2 - multiplier * df['ATR']).values\n\n        FINAL_UB = np.zeros(last_row + 1)\n        FINAL_LB = np.zeros(last_row + 1)\n        ST = np.zeros(last_row + 1)\n        CLOSE = df['close'].values\n\n        # Compute final upper and lower bands\n        for i in range(period, last_row + 1):\n            FINAL_UB[i] = BASIC_UB[i] if BASIC_UB[i] < FINAL_UB[i - 1] or CLOSE[i - 1] > FINAL_UB[i - 1] else FINAL_UB[i - 1]\n            FINAL_LB[i] = BASIC_LB[i] if BASIC_LB[i] > FINAL_LB[i - 1] or CLOSE[i - 1] < FINAL_LB[i - 1] else FINAL_LB[i - 1]\n\n        # Set the Supertrend value\n        for i in range(period, last_row + 1):\n            ST[i] = FINAL_UB[i] if ST[i - 1] == FINAL_UB[i - 1] and CLOSE[i] <= FINAL_UB[i] else \\\n                    FINAL_LB[i] if ST[i - 1] == FINAL_UB[i - 1] and CLOSE[i] >  FINAL_UB[i] else \\\n                    FINAL_LB[i] if ST[i - 1] == FINAL_LB[i - 1] and CLOSE[i] >= FINAL_LB[i] else \\\n                    FINAL_UB[i] if ST[i - 1] == FINAL_LB[i - 1] and CLOSE[i] <  FINAL_LB[i] else 0.00\n        df_ST = pd.DataFrame(ST, columns=[st])\n        df = pd.concat([df, df_ST],axis=1)\n\n        # Mark the trend direction up/down\n        df[stx] = np.where((df[st] > 0.00), np.where((df['close'] < df[st]), 'down',  'up'), np.NaN)\n\n        df.fillna(0, inplace=True)\n\n        end_time = time.time()\n        # print(\"total time taken this loop: \", end_time - start_time)\n\n        return DataFrame(index=df.index, data={\n            'ST' : df[st],\n            'STX' : df[stx]\n        })\n"
  },
  {
    "path": "strategies/FiveMinCrossAbove/FiveMinCrossAbove.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\n\nclass FiveMinCrossAbove(IStrategy):\n    \"\"\"\n    Strategy 005\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy005\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.015,\n\t\t\"25\": 0.01,\n\t\t\"100\": 0.005\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.99\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    # trailing_stop = True\n    # trailing_stop_positive = 0.005\n    # trailing_stop_positive_offset = 0.02\n    # trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = False\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n        # bollinger dataframe\n        #bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        #dataframe['bb_lowerband'] = bollinger['lower']\n\n        # RSI for last 8 candle\n        dataframe['rsi8'] = ta.RSI(dataframe, timeperiod=8)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param metadata:\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            # Prod\n            (\n                    (qtpylib.crossed_above(dataframe['rsi8'], 30)) &\n\t\t\t\t\t(dataframe['rsi8'] < 41)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param metadata:\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            # Prod\n            (\n                    (dataframe['close'] > 9999999999)\n            ),\n\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/FixedRiskRewardLoss/FixedRiskRewardLoss.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nclass FixedRiskRewardLoss(IStrategy):\n    \"\"\"\n    This strategy uses custom_stoploss() to enforce a fixed risk/reward ratio\n    by first calculating a dynamic initial stoploss via ATR - last negative peak\n\n    After that, we caculate that initial risk and multiply it with an risk_reward_ratio\n    Once this is reached, stoploss is set to it and sell signal is enabled\n\n    Also there is a break even ratio. Once this is reached, the stoploss is adjusted to minimize\n    losses by setting it to the buy rate + fees.\n    \"\"\"\n\n    custom_info = {\n        'risk_reward_ratio': 3.5,\n        'set_to_break_even_at_profit': 1,\n    }\n    use_custom_stoploss = True\n    stoploss = -0.9\n    timeframe = '5m'\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        \"\"\"\n            custom_stoploss using a risk/reward ratio\n        \"\"\"\n        result = break_even_sl = takeprofit_sl = -1\n        custom_info_pair = self.custom_info.get(pair)\n        if custom_info_pair is not None:\n            # using current_time/open_date directly via custom_info_pair[trade.open_daten]\n            # would only work in backtesting/hyperopt.\n            # in live/dry-run, we have to search for nearest row before it\n            open_date_mask = custom_info_pair.index.unique().get_loc(trade.open_date_utc, method='ffill')\n            open_df = custom_info_pair.iloc[open_date_mask]\n\n            # trade might be open too long for us to find opening candle\n            if(len(open_df) != 1):\n                return -1 # won't update current stoploss\n\n            initial_sl_abs = open_df['stoploss_rate']\n\n            # calculate initial stoploss at open_date\n            initial_sl = initial_sl_abs/current_rate-1\n\n            # calculate take profit treshold\n            # by using the initial risk and multiplying it\n            risk_distance = trade.open_rate-initial_sl_abs\n            reward_distance = risk_distance*self.custom_info['risk_reward_ratio']\n            # take_profit tries to lock in profit once price gets over\n            # risk/reward ratio treshold\n            take_profit_price_abs = trade.open_rate+reward_distance\n            # take_profit gets triggerd at this profit\n            take_profit_pct = take_profit_price_abs/trade.open_rate-1\n\n            # break_even tries to set sl at open_rate+fees (0 loss)\n            break_even_profit_distance = risk_distance*self.custom_info['set_to_break_even_at_profit']\n            # break_even gets triggerd at this profit\n            break_even_profit_pct = (break_even_profit_distance+current_rate)/current_rate-1\n\n            result = initial_sl\n            if(current_profit >= break_even_profit_pct):\n                break_even_sl = (trade.open_rate*(1+trade.fee_open+trade.fee_close) / current_rate)-1\n                result = break_even_sl\n\n            if(current_profit >= take_profit_pct):\n                takeprofit_sl = take_profit_price_abs/current_rate-1\n                result = takeprofit_sl\n\n        return result\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['atr'] = ta.ATR(dataframe)\n        dataframe['stoploss_rate'] = dataframe['close']-(dataframe['atr']*2)\n        self.custom_info[metadata['pair']] = dataframe[['date', 'stoploss_rate']].copy().set_index('date')\n\n        # all \"normal\" indicators:\n        # e.g.\n        # dataframe['rsi'] = ta.RSI(dataframe)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Placeholder Strategy: buys when SAR is smaller then candle before\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        # Allways buys\n        dataframe.loc[:, 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Placeholder Strategy: does nothing\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n\n        # Never sells\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/ForexSignal/ForexSignal.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass ForexSignal(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.03,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.03\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        # Optionally Add additional \"static\" pairs\n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        if not self.dp:\n            # Don't do anything if DataProvider is not available.\n            return dataframe\n\n        inf_tf = '1h'\n        # Get the informative pair\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        \n        informative['ema8'] = ta.EMA(informative, timeperiod=8)\n        informative['ema21'] = ta.EMA(informative, timeperiod=21)\n        \n        # Use the helper function merge_informative_pair to safely merge the pair\n        # Automatically renames the columns and merges a shorter timeframe dataframe and a longer timeframe informative pair\n        # use ffill to have the 1d value available in every row throughout the day.\n        # Without this, comparisons between columns of the original and the informative pair would only work once per day.\n        # Full documentation of this method, see below\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        \n       \n        # # EMA - Exponential Moving Average for 5m timeframe\n        dataframe['ema8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema8_1h'] > dataframe['ema21_1h']) &  # Onko nousutrendi\n                (dataframe['ema8'] > dataframe['ema13']) &  \n                (dataframe['ema13'] > dataframe['ema21']) &\n                (dataframe['low'] < dataframe['ema8']) \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe.loc[\n            (\n                (dataframe['ema8'] < dataframe['ema8'].shift(1))\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/FrostAuraM115mStrategy/FrostAuraM115mStrategy.py",
    "content": "import numpy as np\nimport pandas as pd\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass FrostAuraM115mStrategy(IStrategy):\n    \"\"\"\n    This is FrostAura's mark 1 strategy which aims to make purchase decisions\n    based on the BB and RSI.\n\n    Last Optimization:\n        Sharpe Ratio    : 5.11912 (prev 4.9885)\n        Profit %        : 1880.60% (prev 1962.82%)\n        Avg             : 209.6m (prev 437.6m)\n        Optimized for   : Last 100+ days, 15min\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n        \"0\": 0.25023,\n        \"89\": 0.09497,\n        \"248\": 0.02596,\n        \"350\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    stoploss = -0.34316\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals.\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        minimum_coin_price = 0.0000015\n\n        dataframe.loc[\n            (\n                #(dataframe['rsi'] > 45) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband2']) &\n                (dataframe[\"close\"] > minimum_coin_price)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 53) &\n                (dataframe[\"close\"] > dataframe['bb_lowerband1'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/FrostAuraM11hStrategy/FrostAuraM11hStrategy.py",
    "content": "import numpy as np\nimport pandas as pd\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass FrostAuraM11hStrategy(IStrategy):\n    \"\"\"\n    This is FrostAura's mark 1 strategy which aims to make purchase decisions\n    based on the BB and RSI.\n    \n    Last Optimization:\n        Sharpe Ratio    : 7.9319 (prev 6.99006)\n        Profit %        : 1303.42% (prev 1162.01%)\n        Optimized for   : Last 115+ days, 1h\n        Avg             : 3465.8m (prev 4231.6m)\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n        \"0\": 0.31637,\n        \"467\": 0.10191,\n        \"1143\": 0.0253,\n        \"2368\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    stoploss = -0.40618\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals.\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n        \n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n        \n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        minimum_coin_price = 0.0000015\n        \n        dataframe.loc[\n            (\n                #(dataframe['rsi'] > 28) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband2']) &\n                (dataframe[\"close\"] > minimum_coin_price)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 97) &\n                (dataframe[\"close\"] > dataframe['bb_upperband1'])\n            ),\n            'sell'] = 1\n        \n        return dataframe"
  },
  {
    "path": "strategies/FrostAuraM21hStrategy/FrostAuraM21hStrategy.py",
    "content": "import numpy as np\nimport pandas as pd\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass FrostAuraM21hStrategy(IStrategy):\n    \"\"\"\n    This is FrostAura's mark 2 strategy which aims to make purchase decisions\n    based on the Stochastic and RSI.\n    \n    Last Optimization:\n        Sharpe Ratio    : 6.24747% (prev 6.41952)\n        Profit %        : 1537.94% (1432.33%)\n        Optimized for   : Last 109 days, 1h\n        ATT             : 719.4m (prev 4321.0m)\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n        \"0\": 0.32365,\n        \"359\": 0.12673,\n        \"934\": 0.08834,\n        \"2090\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    stoploss = -0.44897\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Stochastic Slow\n        stoch = ta.STOCH(dataframe)\n        dataframe['slowd'] = stoch['slowd']\n        dataframe['slowk'] = stoch['slowk']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        minimum_coin_price = 0.0000015\n        \n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 48) &\n                (dataframe[\"slowd\"] > 79) &\n                (dataframe[\"slowk\"] > 77) &\n                (dataframe[\"close\"] > minimum_coin_price)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 48) &\n                (dataframe[\"slowd\"] < 79) &\n                (dataframe[\"slowk\"] < 77)\n            ),\n            'sell'] = 1\n        \n        return dataframe"
  },
  {
    "path": "strategies/FrostAuraM315mStrategy/FrostAuraM315mStrategy.py",
    "content": "import numpy as np\nimport pandas as pd\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass FrostAuraM315mStrategy(IStrategy):\n    \"\"\"\n    This is FrostAura's mark 3 strategy which aims to make purchase decisions\n    based on the BB, RSI and Stochastic.\n    \n    Last Optimization:\n        Sharpe Ratio    : 6.23754\n        Profit %        : 1311.96%\n        Optimized for   : Last 115+ days, 15m\n        Avg             : 986.6m\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n        \"0\": 0.18418,\n        \"36\": 0.10736,\n        \"91\": 0.02998,\n        \"438\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    stoploss = -0.41114\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals.\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        \n        # Stochastic Slow\n        stoch = ta.STOCH(dataframe)\n        dataframe['slowd'] = stoch['slowd']\n        dataframe['slowk'] = stoch['slowk']\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n        \n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n        \n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n        \n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        dataframe['bb_middleband4'] = bollinger4['mid']\n        dataframe['bb_upperband4'] = bollinger4['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        minimum_coin_price = 0.0000015\n        \n        dataframe.loc[\n            (\n                #(dataframe['slowd'] > 30) &\n                #(dataframe['slowk'] > 30) &\n                (dataframe['rsi'] > 22) &\n                (dataframe['slowk'] < dataframe['slowd']) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband3']) &\n                (dataframe[\"close\"] > minimum_coin_price)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['slowk'] < dataframe['slowd']) &\n                (dataframe['rsi'] > 72) &\n                (dataframe[\"close\"] > dataframe['bb_middleband1'])\n            ),\n            'sell'] = 1\n        \n        return dataframe"
  },
  {
    "path": "strategies/FrostAuraM31hStrategy/FrostAuraM31hStrategy.py",
    "content": "import numpy as np\nimport pandas as pd\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass FrostAuraM31hStrategy(IStrategy):\n    \"\"\"\n    This is FrostAura's mark 3 strategy which aims to make purchase decisions\n    based on the BB, RSI and Stochastic.\n    \n    Last Optimization:\n        Sharpe Ratio    : 8.39422 (prev 6.75469)\n        Profit %        : 1285.74% (prev 1196.4%)\n        Optimized for   : Last 115+ days, 1h\n        Avg             : 3618.4m (prev 3863.1m)\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n        \"0\": 0.23044,\n        \"312\": 0.16026,\n        \"870\": 0.06786,\n        \"2273\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    stoploss = -0.44439\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals.\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        \n        # Stochastic Slow\n        stoch = ta.STOCH(dataframe)\n        dataframe['slowd'] = stoch['slowd']\n        dataframe['slowk'] = stoch['slowk']\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n        \n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n        \n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n        \n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        dataframe['bb_middleband4'] = bollinger4['mid']\n        dataframe['bb_upperband4'] = bollinger4['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        minimum_coin_price = 0.0000015\n        \n        dataframe.loc[\n            (\n                #(dataframe['slowd'] > 30) &\n                #(dataframe['slowk'] > 30) &\n                (dataframe['rsi'] > 10) &\n                (dataframe['slowk'] < dataframe['slowd']) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband3']) &\n                (dataframe[\"close\"] > minimum_coin_price)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['slowk'] < dataframe['slowd']) &\n                (dataframe['rsi'] > 70) &\n                (dataframe[\"close\"] > dataframe['bb_middleband1'])\n            ),\n            'sell'] = 1\n        \n        return dataframe"
  },
  {
    "path": "strategies/FrostAuraRandomStrategy/FrostAuraRandomStrategy.py",
    "content": "from pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (IntParameter, IStrategy, CategoricalParameter)\nfrom random import random\nimport numpy as np\n\nclass FrostAuraRandomStrategy(IStrategy):\n    \"\"\"\n    This is FrostAura's random strategy powered by nature.\n\n    Last Optimization:\n        Profit %        : 10-30%\n        Optimized for   : Last 45 days, 1h\n        Avg             : 2d - 5d\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    minimal_roi = {\n        \"0\": 0.347,\n        \"450\": 0.106,\n        \"1169\": 0.032,\n        \"1624\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    stoploss = -0.231\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals.\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['random_number'] = np.random.randint(0, 100, dataframe.shape[0])\n\n        return dataframe\n\n    buy_prediction_delta_direction = CategoricalParameter(['<', '>'], default='>', space='buy')\n    buy_probability = IntParameter([0, 100], default=76, space='buy')\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        random_number = dataframe['random_number']\n\n        dataframe.loc[\n            (\n                (random_number < self.buy_probability.value if self.buy_prediction_delta_direction.value == '<' else random_number > self.buy_probability.value)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    sell_prediction_delta_direction = CategoricalParameter(['<', '>'], default='<', space='sell')\n    sell_probability = IntParameter([0, 100], default=0, space='sell')\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        random_number = dataframe['random_number']\n\n        dataframe.loc[\n            (\n                (random_number < self.sell_probability.value if self.sell_prediction_delta_direction.value == '<' else random_number > self.sell_probability.value)\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/GodCard/GodCard.py",
    "content": "from freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n\nclass GodCard(IStrategy):\n\n    INTERFACE_VERSION = 2\n\n    timeframe = '5m'\n    # Define the parameter spaces\n    cooldown_lookback = IntParameter(2, 48, default=5, space=\"protection\", optimize=True)\n    stop_duration = IntParameter(12, 200, default=5, space=\"protection\", optimize=True)\n    use_stop_protection = BooleanParameter(default=True, space=\"protection\", optimize=True)\n\n    @property\n    def protections(self):\n        prot = []\n\n        prot.append({\n            \"method\": \"CooldownPeriod\",\n            \"stop_duration_candles\": self.cooldown_lookback.value\n        })\n        if self.use_stop_protection.value:\n            prot.append({\n                \"method\": \"StoplossGuard\",\n                \"lookback_period_candles\": 24,\n                \"trade_limit\": 4,\n                \"stop_duration_candles\": self.stop_duration.value,\n                \"only_per_pair\": False\n            })\n\n        return prot\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Hyperopt parameters\n    buy_rsi = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n    buy_rsi_enabled = CategoricalParameter([True, False], default=False, space=\"buy\", optimize=True)\n    buy_trigger = CategoricalParameter([\"bb_one\", \"bb_two\", \"bb_three\"], default=\"bb_one\", space=\"buy\", optimize=True)\n\n    sell_rsi = IntParameter(low=1, high=100, default=70, space='sell', optimize=True)\n    sell_rsi_enabled = CategoricalParameter([True, False], default=False, space=\"sell\", optimize=True)\n    sell_trigger = CategoricalParameter([\"bb_low_sell\", \"bb_mid_sell\", \"bb_up_sell\", \"sarBoi\"], default=\"bb_two_sell\",  space=\"sell\", optimize=True)\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_rsi\": 56,\n        \"buy_rsi_enabled\": False,\n        \"buy_trigger\": \"bb_two\",\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_rsi\": 9,\n        \"sell_rsi_enabled\": True,\n        \"sell_trigger\": \"bb_mid_sell\",\n    }\n\n    # Protection hyperspace params:\n    protection_params = {\n        \"cooldown_lookback\": 0,\n        \"stop_duration\": 39,\n        \"use_stop_protection\": False,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.344,\n        \"32\": 0.09,\n        \"120\": 0.041,\n        \"447\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.087\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.043\n    trailing_only_offset_is_reached = True\n\n    def informative_pairs(self):\n\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # SAR Parabol\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # GUARDS AND TRENDS\n        if self.buy_rsi_enabled.value:\n            conditions.append(dataframe['rsi'] > self.buy_rsi.value)\n\n        # TRIGGERS\n        if self.buy_trigger.value == 'bb_one':\n            conditions.append(dataframe['close'] < dataframe['bb_lowerband'])\n\n        if self.buy_trigger.value == 'bb_two':\n            conditions.append(dataframe['close'] < dataframe['bb_lowerband2'])\n\n        if self.buy_trigger.value == 'bb_three':\n            conditions.append(dataframe['close'] < dataframe['bb_lowerband3'])\n\n        # Check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # GUARDS AND TRENDS\n        if self.sell_rsi_enabled.value:\n            conditions.append(dataframe['rsi'] > self.sell_rsi.value)\n\n        # TRIGGERS\n\n        if self.sell_trigger.value == 'sarBoi':\n            conditions.append(dataframe['sar'] > dataframe['close'])\n\n\n        if self.buy_trigger.value == 'bb_low_sell':\n            conditions.append(dataframe['close'] > dataframe['bb_lowerband'])\n\n        if self.buy_trigger.value == 'bb_mid_sell':\n            conditions.append(dataframe['close'] > dataframe['bb_middleband'])\n\n        if self.buy_trigger.value == 'bb_up_sell':\n            conditions.append(dataframe['close'] > dataframe['bb_upperband'])\n\n        # Check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/GodStraNew/GodStraNew.py",
    "content": "# GodStraNew Strategy\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces buy roi trailing sell --strategy GodStraNew\n# --- Do not remove these libs ---\nfrom freqtrade import data\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter\n\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# --------------------------------\n\n# Add your lib to import here\n# TODO: talib is fast but have not more indicators\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\nimport numpy as np\nfrom random import shuffle\n#  TODO: this gene is removed 'MAVP' cuz or error on periods\nall_god_genes = {\n    'Overlap Studies': {\n        'BBANDS-0',             # Bollinger Bands\n        'BBANDS-1',             # Bollinger Bands\n        'BBANDS-2',             # Bollinger Bands\n        'DEMA',                 # Double Exponential Moving Average\n        'EMA',                  # Exponential Moving Average\n        'HT_TRENDLINE',         # Hilbert Transform - Instantaneous Trendline\n        'KAMA',                 # Kaufman Adaptive Moving Average\n        'MA',                   # Moving average\n        'MAMA-0',               # MESA Adaptive Moving Average\n        'MAMA-1',               # MESA Adaptive Moving Average\n        # TODO: Fix this\n        # 'MAVP',               # Moving average with variable period\n        'MIDPOINT',             # MidPoint over period\n        'MIDPRICE',             # Midpoint Price over period\n        'SAR',                  # Parabolic SAR\n        'SAREXT',               # Parabolic SAR - Extended\n        'SMA',                  # Simple Moving Average\n        'T3',                   # Triple Exponential Moving Average (T3)\n        'TEMA',                 # Triple Exponential Moving Average\n        'TRIMA',                # Triangular Moving Average\n        'WMA',                  # Weighted Moving Average\n    },\n    'Momentum Indicators': {\n        'ADX',                  # Average Directional Movement Index\n        'ADXR',                 # Average Directional Movement Index Rating\n        'APO',                  # Absolute Price Oscillator\n        'AROON-0',              # Aroon\n        'AROON-1',              # Aroon\n        'AROONOSC',             # Aroon Oscillator\n        'BOP',                  # Balance Of Power\n        'CCI',                  # Commodity Channel Index\n        'CMO',                  # Chande Momentum Oscillator\n        'DX',                   # Directional Movement Index\n        'MACD-0',               # Moving Average Convergence/Divergence\n        'MACD-1',               # Moving Average Convergence/Divergence\n        'MACD-2',               # Moving Average Convergence/Divergence\n        'MACDEXT-0',            # MACD with controllable MA type\n        'MACDEXT-1',            # MACD with controllable MA type\n        'MACDEXT-2',            # MACD with controllable MA type\n        'MACDFIX-0',            # Moving Average Convergence/Divergence Fix 12/26\n        'MACDFIX-1',            # Moving Average Convergence/Divergence Fix 12/26\n        'MACDFIX-2',            # Moving Average Convergence/Divergence Fix 12/26\n        'MFI',                  # Money Flow Index\n        'MINUS_DI',             # Minus Directional Indicator\n        'MINUS_DM',             # Minus Directional Movement\n        'MOM',                  # Momentum\n        'PLUS_DI',              # Plus Directional Indicator\n        'PLUS_DM',              # Plus Directional Movement\n        'PPO',                  # Percentage Price Oscillator\n        'ROC',                  # Rate of change : ((price/prevPrice)-1)*100\n        'ROCP',                 # Rate of change Percentage: (price-prevPrice)/prevPrice\n        'ROCR',                 # Rate of change ratio: (price/prevPrice)\n        'ROCR100',              # Rate of change ratio 100 scale: (price/prevPrice)*100\n        'RSI',                  # Relative Strength Index\n        'STOCH-0',              # Stochastic\n        'STOCH-1',              # Stochastic\n        'STOCHF-0',             # Stochastic Fast\n        'STOCHF-1',             # Stochastic Fast\n        'STOCHRSI-0',           # Stochastic Relative Strength Index\n        'STOCHRSI-1',           # Stochastic Relative Strength Index\n        'TRIX',                 # 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA\n        'ULTOSC',               # Ultimate Oscillator\n        'WILLR',                # Williams' %R\n    },\n    'Volume Indicators': {\n        'AD',                   # Chaikin A/D Line\n        'ADOSC',                # Chaikin A/D Oscillator\n        'OBV',                  # On Balance Volume\n    },\n    'Volatility Indicators': {\n        'ATR',                  # Average True Range\n        'NATR',                 # Normalized Average True Range\n        'TRANGE',               # True Range\n    },\n    'Price Transform': {\n        'AVGPRICE',             # Average Price\n        'MEDPRICE',             # Median Price\n        'TYPPRICE',             # Typical Price\n        'WCLPRICE',             # Weighted Close Price\n    },\n    'Cycle Indicators': {\n        'HT_DCPERIOD',          # Hilbert Transform - Dominant Cycle Period\n        'HT_DCPHASE',           # Hilbert Transform - Dominant Cycle Phase\n        'HT_PHASOR-0',          # Hilbert Transform - Phasor Components\n        'HT_PHASOR-1',          # Hilbert Transform - Phasor Components\n        'HT_SINE-0',            # Hilbert Transform - SineWave\n        'HT_SINE-1',            # Hilbert Transform - SineWave\n        'HT_TRENDMODE',         # Hilbert Transform - Trend vs Cycle Mode\n    },\n    'Pattern Recognition': {\n        'CDL2CROWS',            # Two Crows\n        'CDL3BLACKCROWS',       # Three Black Crows\n        'CDL3INSIDE',           # Three Inside Up/Down\n        'CDL3LINESTRIKE',       # Three-Line Strike\n        'CDL3OUTSIDE',          # Three Outside Up/Down\n        'CDL3STARSINSOUTH',     # Three Stars In The South\n        'CDL3WHITESOLDIERS',    # Three Advancing White Soldiers\n        'CDLABANDONEDBABY',     # Abandoned Baby\n        'CDLADVANCEBLOCK',      # Advance Block\n        'CDLBELTHOLD',          # Belt-hold\n        'CDLBREAKAWAY',         # Breakaway\n        'CDLCLOSINGMARUBOZU',   # Closing Marubozu\n        'CDLCONCEALBABYSWALL',  # Concealing Baby Swallow\n        'CDLCOUNTERATTACK',     # Counterattack\n        'CDLDARKCLOUDCOVER',    # Dark Cloud Cover\n        'CDLDOJI',              # Doji\n        'CDLDOJISTAR',          # Doji Star\n        'CDLDRAGONFLYDOJI',     # Dragonfly Doji\n        'CDLENGULFING',         # Engulfing Pattern\n        'CDLEVENINGDOJISTAR',   # Evening Doji Star\n        'CDLEVENINGSTAR',       # Evening Star\n        'CDLGAPSIDESIDEWHITE',  # Up/Down-gap side-by-side white lines\n        'CDLGRAVESTONEDOJI',    # Gravestone Doji\n        'CDLHAMMER',            # Hammer\n        'CDLHANGINGMAN',        # Hanging Man\n        'CDLHARAMI',            # Harami Pattern\n        'CDLHARAMICROSS',       # Harami Cross Pattern\n        'CDLHIGHWAVE',          # High-Wave Candle\n        'CDLHIKKAKE',           # Hikkake Pattern\n        'CDLHIKKAKEMOD',        # Modified Hikkake Pattern\n        'CDLHOMINGPIGEON',      # Homing Pigeon\n        'CDLIDENTICAL3CROWS',   # Identical Three Crows\n        'CDLINNECK',            # In-Neck Pattern\n        'CDLINVERTEDHAMMER',    # Inverted Hammer\n        'CDLKICKING',           # Kicking\n        'CDLKICKINGBYLENGTH',   # Kicking - bull/bear determined by the longer marubozu\n        'CDLLADDERBOTTOM',      # Ladder Bottom\n        'CDLLONGLEGGEDDOJI',    # Long Legged Doji\n        'CDLLONGLINE',          # Long Line Candle\n        'CDLMARUBOZU',          # Marubozu\n        'CDLMATCHINGLOW',       # Matching Low\n        'CDLMATHOLD',           # Mat Hold\n        'CDLMORNINGDOJISTAR',   # Morning Doji Star\n        'CDLMORNINGSTAR',       # Morning Star\n        'CDLONNECK',            # On-Neck Pattern\n        'CDLPIERCING',          # Piercing Pattern\n        'CDLRICKSHAWMAN',       # Rickshaw Man\n        'CDLRISEFALL3METHODS',  # Rising/Falling Three Methods\n        'CDLSEPARATINGLINES',   # Separating Lines\n        'CDLSHOOTINGSTAR',      # Shooting Star\n        'CDLSHORTLINE',         # Short Line Candle\n        'CDLSPINNINGTOP',       # Spinning Top\n        'CDLSTALLEDPATTERN',    # Stalled Pattern\n        'CDLSTICKSANDWICH',     # Stick Sandwich\n        'CDLTAKURI',            # Takuri (Dragonfly Doji with very long lower shadow)\n        'CDLTASUKIGAP',         # Tasuki Gap\n        'CDLTHRUSTING',         # Thrusting Pattern\n        'CDLTRISTAR',           # Tristar Pattern\n        'CDLUNIQUE3RIVER',      # Unique 3 River\n        'CDLUPSIDEGAP2CROWS',   # Upside Gap Two Crows\n        'CDLXSIDEGAP3METHODS',  # Upside/Downside Gap Three Methods\n\n    },\n    'Statistic Functions': {\n        'BETA',                 # Beta\n        'CORREL',               # Pearson's Correlation Coefficient (r)\n        'LINEARREG',            # Linear Regression\n        'LINEARREG_ANGLE',      # Linear Regression Angle\n        'LINEARREG_INTERCEPT',  # Linear Regression Intercept\n        'LINEARREG_SLOPE',      # Linear Regression Slope\n        'STDDEV',               # Standard Deviation\n        'TSF',                  # Time Series Forecast\n        'VAR',                  # Variance\n    }\n\n}\ngod_genes = set()\n########################### SETTINGS ##############################\n\ngod_genes = {'SMA'}\n# god_genes |= all_god_genes['Overlap Studies']\n# god_genes |= all_god_genes['Momentum Indicators']\n# god_genes |= all_god_genes['Volume Indicators']\n# god_genes |= all_god_genes['Volatility Indicators']\n# god_genes |= all_god_genes['Price Transform']\n# god_genes |= all_god_genes['Cycle Indicators']\n# god_genes |= all_god_genes['Pattern Recognition']\n# god_genes |= all_god_genes['Statistic Functions']\n\ntimeperiods = [5, 6, 12, 15, 50, 55, 100, 110]\noperators = [\n    \"D\",  # Disabled gene\n    \">\",  # Indicator, bigger than cross indicator\n    \"<\",  # Indicator, smaller than cross indicator\n    \"=\",  # Indicator, equal with cross indicator\n    \"C\",  # Indicator, crossed the cross indicator\n    \"CA\",  # Indicator, crossed above the cross indicator\n    \"CB\",  # Indicator, crossed below the cross indicator\n    \">R\",  # Normalized indicator, bigger than real number\n    \"=R\",  # Normalized indicator, equal with real number\n    \"<R\",  # Normalized indicator, smaller than real number\n    \"/>R\",  # Normalized indicator devided to cross indicator, bigger than real number\n    \"/=R\",  # Normalized indicator devided to cross indicator, equal with real number\n    \"/<R\",  # Normalized indicator devided to cross indicator, smaller than real number\n    \"UT\",  # Indicator, is in UpTrend status\n    \"DT\",  # Indicator, is in DownTrend status\n    \"OT\",  # Indicator, is in Off trend status(RANGE)\n    \"CUT\",  # Indicator, Entered to UpTrend status\n    \"CDT\",  # Indicator, Entered to DownTrend status\n    \"COT\"  # Indicator, Entered to Off trend status(RANGE)\n]\n# number of candles to check up,don,off trend.\nTREND_CHECK_CANDLES = 4\nDECIMALS = 1\n########################### END SETTINGS ##########################\n# DATAFRAME = DataFrame()\n\ngod_genes = list(god_genes)\n# print('selected indicators for optimzatin: \\n', god_genes)\n\ngod_genes_with_timeperiod = list()\nfor god_gene in god_genes:\n    for timeperiod in timeperiods:\n        god_genes_with_timeperiod.append(f'{god_gene}-{timeperiod}')\n\n# Let give somethings to CatagoricalParam to Play with them\n# When just one thing is inside catagorical lists\n# TODO: its Not True Way :)\nif len(god_genes) == 1:\n    god_genes = god_genes*2\nif len(timeperiods) == 1:\n    timeperiods = timeperiods*2\nif len(operators) == 1:\n    operators = operators*2\n\n\ndef normalize(df):\n    df = (df-df.min())/(df.max()-df.min())\n    return df\n\n\ndef gene_calculator(dataframe, indicator):\n    # Cuz Timeperiods not effect calculating CDL patterns recognations\n    if 'CDL' in indicator:\n        splited_indicator = indicator.split('-')\n        splited_indicator[1] = \"0\"\n        new_indicator = \"-\".join(splited_indicator)\n        # print(indicator, new_indicator)\n        indicator = new_indicator\n\n    gene = indicator.split(\"-\")\n\n    gene_name = gene[0]\n    gene_len = len(gene)\n\n    if indicator in dataframe.keys():\n        # print(f\"{indicator}, calculated befoure\")\n        # print(len(dataframe.keys()))\n        return dataframe[indicator]\n    else:\n        result = None\n        # For Pattern Recognations\n        if gene_len == 1:\n            # print('gene_len == 1\\t', indicator)\n            result = getattr(ta, gene_name)(\n                dataframe\n            )\n            return normalize(result)\n        elif gene_len == 2:\n            # print('gene_len == 2\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(result)\n        # For\n        elif gene_len == 3:\n            # print('gene_len == 3\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(result)\n        # For trend operators(MA-5-SMA-4)\n        elif gene_len == 4:\n            # print('gene_len == 4\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n        # For trend operators(STOCH-0-4-SMA-4)\n        elif gene_len == 5:\n            # print('gene_len == 5\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_index}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n\n\ndef condition_generator(dataframe, operator, indicator, crossed_indicator, real_num):\n\n    condition = (dataframe['volume'] > 10)\n\n    # TODO : it ill callculated in populate indicators.\n\n    dataframe[indicator] = gene_calculator(dataframe, indicator)\n    dataframe[crossed_indicator] = gene_calculator(dataframe, crossed_indicator)\n\n    indicator_trend_sma = f\"{indicator}-SMA-{TREND_CHECK_CANDLES}\"\n    if operator in [\"UT\", \"DT\", \"OT\", \"CUT\", \"CDT\", \"COT\"]:\n        dataframe[indicator_trend_sma] = gene_calculator(dataframe, indicator_trend_sma)\n\n    if operator == \">\":\n        condition = (\n            dataframe[indicator] > dataframe[crossed_indicator]\n        )\n    elif operator == \"=\":\n        condition = (\n            np.isclose(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"<\":\n        condition = (\n            dataframe[indicator] < dataframe[crossed_indicator]\n        )\n    elif operator == \"C\":\n        condition = (\n            (qtpylib.crossed_below(dataframe[indicator], dataframe[crossed_indicator])) |\n            (qtpylib.crossed_above(dataframe[indicator], dataframe[crossed_indicator]))\n        )\n    elif operator == \"CA\":\n        condition = (\n            qtpylib.crossed_above(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"CB\":\n        condition = (\n            qtpylib.crossed_below(\n                dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \">R\":\n        condition = (\n            dataframe[indicator] > real_num\n        )\n    elif operator == \"=R\":\n        condition = (\n            np.isclose(dataframe[indicator], real_num)\n        )\n    elif operator == \"<R\":\n        condition = (\n            dataframe[indicator] < real_num\n        )\n    elif operator == \"/>R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) > real_num\n        )\n    elif operator == \"/=R\":\n        condition = (\n            np.isclose(dataframe[indicator].div(dataframe[crossed_indicator]), real_num)\n        )\n    elif operator == \"/<R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) < real_num\n        )\n    elif operator == \"UT\":\n        condition = (\n            dataframe[indicator] > dataframe[indicator_trend_sma]\n        )\n    elif operator == \"DT\":\n        condition = (\n            dataframe[indicator] < dataframe[indicator_trend_sma]\n        )\n    elif operator == \"OT\":\n        condition = (\n\n            np.isclose(dataframe[indicator], dataframe[indicator_trend_sma])\n        )\n    elif operator == \"CUT\":\n        condition = (\n            (\n                qtpylib.crossed_above(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] > dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"CDT\":\n        condition = (\n            (\n                qtpylib.crossed_below(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] < dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"COT\":\n        condition = (\n            (\n                (\n                    qtpylib.crossed_below(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                ) |\n                (\n                    qtpylib.crossed_above(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                )\n            ) &\n            (\n                np.isclose(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            )\n        )\n\n    return condition, dataframe\n\n\nclass GodStraNew(IStrategy):\n    # #################### RESULTS PASTE PLACE ####################\n\n    # #################### END OF RESULT PLACE ####################\n\n    # TODO: Its not dry code!\n    # Buy Hyperoptable Parameters/Spaces.\n    buy_crossed_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"ADD-20\", space='buy')\n    buy_crossed_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"ASIN-6\", space='buy')\n    buy_crossed_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLEVENINGSTAR-50\", space='buy')\n\n    buy_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"SMA-100\", space='buy')\n    buy_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"WILLR-50\", space='buy')\n    buy_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLHANGINGMAN-20\", space='buy')\n\n    buy_operator0 = CategoricalParameter(operators, default=\"/<R\", space='buy')\n    buy_operator1 = CategoricalParameter(operators, default=\"<R\", space='buy')\n    buy_operator2 = CategoricalParameter(operators, default=\"CB\", space='buy')\n\n    buy_real_num0 = DecimalParameter(0, 1, decimals=DECIMALS,  default=0.89009, space='buy')\n    buy_real_num1 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.56953, space='buy')\n    buy_real_num2 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.38365, space='buy')\n\n    # Sell Hyperoptable Parameters/Spaces.\n    sell_crossed_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLSHOOTINGSTAR-150\", space='sell')\n    sell_crossed_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"MAMA-1-100\", space='sell')\n    sell_crossed_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLMATHOLD-6\", space='sell')\n\n    sell_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLUPSIDEGAP2CROWS-5\", space='sell')\n    sell_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLHARAMICROSS-150\", space='sell')\n    sell_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDL2CROWS-5\", space='sell')\n\n    sell_operator0 = CategoricalParameter(operators, default=\"<R\", space='sell')\n    sell_operator1 = CategoricalParameter(operators, default=\"D\", space='sell')\n    sell_operator2 = CategoricalParameter(operators, default=\"/>R\", space='sell')\n\n    sell_real_num0 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.09731, space='sell')\n    sell_real_num1 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.81657, space='sell')\n    sell_real_num2 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.87267, space='sell')\n\n    # Stoploss:\n    stoploss = -1\n    # Buy hypers\n    timeframe = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        It's good to calculate all indicators in all time periods here and so optimize the strategy.\n        But this strategy can take much time to generate anything that may not use in his optimization.\n        I just calculate the specific indicators in specific time period inside buy and sell strategy populator methods if needed.\n        Also, this method (populate_indicators) just calculates default value of hyperoptable params\n        so using this method have not big benefits instade of calculating useable things inside buy and sell trand populators\n        '''\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = list()\n\n        # TODO: Its not dry code!\n        buy_indicator = self.buy_indicator0.value\n        buy_crossed_indicator = self.buy_crossed_indicator0.value\n        buy_operator = self.buy_operator0.value\n        buy_real_num = self.buy_real_num0.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n        # backup\n        buy_indicator = self.buy_indicator1.value\n        buy_crossed_indicator = self.buy_crossed_indicator1.value\n        buy_operator = self.buy_operator1.value\n        buy_real_num = self.buy_real_num1.value\n\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        buy_indicator = self.buy_indicator2.value\n        buy_crossed_indicator = self.buy_crossed_indicator2.value\n        buy_operator = self.buy_operator2.value\n        buy_real_num = self.buy_real_num2.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        # print(len(dataframe.keys()))\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = list()\n        # TODO: Its not dry code!\n        sell_indicator = self.sell_indicator0.value\n        sell_crossed_indicator = self.sell_crossed_indicator0.value\n        sell_operator = self.sell_operator0.value\n        sell_real_num = self.sell_real_num0.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = self.sell_indicator1.value\n        sell_crossed_indicator = self.sell_crossed_indicator1.value\n        sell_operator = self.sell_operator1.value\n        sell_real_num = self.sell_real_num1.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = self.sell_indicator2.value\n        sell_crossed_indicator = self.sell_crossed_indicator2.value\n        sell_operator = self.sell_operator2.value\n        sell_real_num = self.sell_real_num2.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n        return dataframe\n"
  },
  {
    "path": "strategies/GodStraNew40/GodStraNew40.py",
    "content": "# GodStraNew Strategy\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces buy roi trailing sell --strategy GodStraNew\n# --- Do not remove these libs ---\nfrom freqtrade import data\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter\n\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# --------------------------------\n\n# Add your lib to import here\n# TODO: talib is fast but have not more indicators\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\nimport numpy as np\nfrom random import shuffle\n#  TODO: this gene is removed 'MAVP' cuz or error on periods\nall_god_genes = {\n    'Overlap Studies': {\n        'BBANDS-0',             # Bollinger Bands\n        'BBANDS-1',             # Bollinger Bands\n        'BBANDS-2',             # Bollinger Bands\n        'DEMA',                 # Double Exponential Moving Average\n        'EMA',                  # Exponential Moving Average\n        'HT_TRENDLINE',         # Hilbert Transform - Instantaneous Trendline\n        'KAMA',                 # Kaufman Adaptive Moving Average\n        'MA',                   # Moving average\n        'MAMA-0',               # MESA Adaptive Moving Average\n        'MAMA-1',               # MESA Adaptive Moving Average\n        # TODO: Fix this\n        # 'MAVP',               # Moving average with variable period\n        'MIDPOINT',             # MidPoint over period\n        'MIDPRICE',             # Midpoint Price over period\n        'SAR',                  # Parabolic SAR\n        'SAREXT',               # Parabolic SAR - Extended\n        'SMA',                  # Simple Moving Average\n        'T3',                   # Triple Exponential Moving Average (T3)\n        'TEMA',                 # Triple Exponential Moving Average\n        'TRIMA',                # Triangular Moving Average\n        'WMA',                  # Weighted Moving Average\n    },\n    'Momentum Indicators': {\n        'ADX',                  # Average Directional Movement Index\n        'ADXR',                 # Average Directional Movement Index Rating\n        'APO',                  # Absolute Price Oscillator\n        'AROON-0',              # Aroon\n        'AROON-1',              # Aroon\n        'AROONOSC',             # Aroon Oscillator\n        'BOP',                  # Balance Of Power\n        'CCI',                  # Commodity Channel Index\n        'CMO',                  # Chande Momentum Oscillator\n        'DX',                   # Directional Movement Index\n        'MACD-0',               # Moving Average Convergence/Divergence\n        'MACD-1',               # Moving Average Convergence/Divergence\n        'MACD-2',               # Moving Average Convergence/Divergence\n        'MACDEXT-0',            # MACD with controllable MA type\n        'MACDEXT-1',            # MACD with controllable MA type\n        'MACDEXT-2',            # MACD with controllable MA type\n        'MACDFIX-0',            # Moving Average Convergence/Divergence Fix 12/26\n        'MACDFIX-1',            # Moving Average Convergence/Divergence Fix 12/26\n        'MACDFIX-2',            # Moving Average Convergence/Divergence Fix 12/26\n        'MFI',                  # Money Flow Index\n        'MINUS_DI',             # Minus Directional Indicator\n        'MINUS_DM',             # Minus Directional Movement\n        'MOM',                  # Momentum\n        'PLUS_DI',              # Plus Directional Indicator\n        'PLUS_DM',              # Plus Directional Movement\n        'PPO',                  # Percentage Price Oscillator\n        'ROC',                  # Rate of change : ((price/prevPrice)-1)*100\n        'ROCP',                 # Rate of change Percentage: (price-prevPrice)/prevPrice\n        'ROCR',                 # Rate of change ratio: (price/prevPrice)\n        'ROCR100',              # Rate of change ratio 100 scale: (price/prevPrice)*100\n        'RSI',                  # Relative Strength Index\n        'STOCH-0',              # Stochastic\n        'STOCH-1',              # Stochastic\n        'STOCHF-0',             # Stochastic Fast\n        'STOCHF-1',             # Stochastic Fast\n        'STOCHRSI-0',           # Stochastic Relative Strength Index\n        'STOCHRSI-1',           # Stochastic Relative Strength Index\n        'TRIX',                 # 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA\n        'ULTOSC',               # Ultimate Oscillator\n        'WILLR',                # Williams' %R\n    },\n    'Volume Indicators': {\n        'AD',                   # Chaikin A/D Line\n        'ADOSC',                # Chaikin A/D Oscillator\n        'OBV',                  # On Balance Volume\n    },\n    'Volatility Indicators': {\n        'ATR',                  # Average True Range\n        'NATR',                 # Normalized Average True Range\n        'TRANGE',               # True Range\n    },\n    'Price Transform': {\n        'AVGPRICE',             # Average Price\n        'MEDPRICE',             # Median Price\n        'TYPPRICE',             # Typical Price\n        'WCLPRICE',             # Weighted Close Price\n    },\n    'Cycle Indicators': {\n        'HT_DCPERIOD',          # Hilbert Transform - Dominant Cycle Period\n        'HT_DCPHASE',           # Hilbert Transform - Dominant Cycle Phase\n        'HT_PHASOR-0',          # Hilbert Transform - Phasor Components\n        'HT_PHASOR-1',          # Hilbert Transform - Phasor Components\n        'HT_SINE-0',            # Hilbert Transform - SineWave\n        'HT_SINE-1',            # Hilbert Transform - SineWave\n        'HT_TRENDMODE',         # Hilbert Transform - Trend vs Cycle Mode\n    },\n    'Pattern Recognition': {\n        'CDL2CROWS',            # Two Crows\n        'CDL3BLACKCROWS',       # Three Black Crows\n        'CDL3INSIDE',           # Three Inside Up/Down\n        'CDL3LINESTRIKE',       # Three-Line Strike\n        'CDL3OUTSIDE',          # Three Outside Up/Down\n        'CDL3STARSINSOUTH',     # Three Stars In The South\n        'CDL3WHITESOLDIERS',    # Three Advancing White Soldiers\n        'CDLABANDONEDBABY',     # Abandoned Baby\n        'CDLADVANCEBLOCK',      # Advance Block\n        'CDLBELTHOLD',          # Belt-hold\n        'CDLBREAKAWAY',         # Breakaway\n        'CDLCLOSINGMARUBOZU',   # Closing Marubozu\n        'CDLCONCEALBABYSWALL',  # Concealing Baby Swallow\n        'CDLCOUNTERATTACK',     # Counterattack\n        'CDLDARKCLOUDCOVER',    # Dark Cloud Cover\n        'CDLDOJI',              # Doji\n        'CDLDOJISTAR',          # Doji Star\n        'CDLDRAGONFLYDOJI',     # Dragonfly Doji\n        'CDLENGULFING',         # Engulfing Pattern\n        'CDLEVENINGDOJISTAR',   # Evening Doji Star\n        'CDLEVENINGSTAR',       # Evening Star\n        'CDLGAPSIDESIDEWHITE',  # Up/Down-gap side-by-side white lines\n        'CDLGRAVESTONEDOJI',    # Gravestone Doji\n        'CDLHAMMER',            # Hammer\n        'CDLHANGINGMAN',        # Hanging Man\n        'CDLHARAMI',            # Harami Pattern\n        'CDLHARAMICROSS',       # Harami Cross Pattern\n        'CDLHIGHWAVE',          # High-Wave Candle\n        'CDLHIKKAKE',           # Hikkake Pattern\n        'CDLHIKKAKEMOD',        # Modified Hikkake Pattern\n        'CDLHOMINGPIGEON',      # Homing Pigeon\n        'CDLIDENTICAL3CROWS',   # Identical Three Crows\n        'CDLINNECK',            # In-Neck Pattern\n        'CDLINVERTEDHAMMER',    # Inverted Hammer\n        'CDLKICKING',           # Kicking\n        'CDLKICKINGBYLENGTH',   # Kicking - bull/bear determined by the longer marubozu\n        'CDLLADDERBOTTOM',      # Ladder Bottom\n        'CDLLONGLEGGEDDOJI',    # Long Legged Doji\n        'CDLLONGLINE',          # Long Line Candle\n        'CDLMARUBOZU',          # Marubozu\n        'CDLMATCHINGLOW',       # Matching Low\n        'CDLMATHOLD',           # Mat Hold\n        'CDLMORNINGDOJISTAR',   # Morning Doji Star\n        'CDLMORNINGSTAR',       # Morning Star\n        'CDLONNECK',            # On-Neck Pattern\n        'CDLPIERCING',          # Piercing Pattern\n        'CDLRICKSHAWMAN',       # Rickshaw Man\n        'CDLRISEFALL3METHODS',  # Rising/Falling Three Methods\n        'CDLSEPARATINGLINES',   # Separating Lines\n        'CDLSHOOTINGSTAR',      # Shooting Star\n        'CDLSHORTLINE',         # Short Line Candle\n        'CDLSPINNINGTOP',       # Spinning Top\n        'CDLSTALLEDPATTERN',    # Stalled Pattern\n        'CDLSTICKSANDWICH',     # Stick Sandwich\n        'CDLTAKURI',            # Takuri (Dragonfly Doji with very long lower shadow)\n        'CDLTASUKIGAP',         # Tasuki Gap\n        'CDLTHRUSTING',         # Thrusting Pattern\n        'CDLTRISTAR',           # Tristar Pattern\n        'CDLUNIQUE3RIVER',      # Unique 3 River\n        'CDLUPSIDEGAP2CROWS',   # Upside Gap Two Crows\n        'CDLXSIDEGAP3METHODS',  # Upside/Downside Gap Three Methods\n\n    },\n    'Statistic Functions': {\n        'BETA',                 # Beta\n        'CORREL',               # Pearson's Correlation Coefficient (r)\n        'LINEARREG',            # Linear Regression\n        'LINEARREG_ANGLE',      # Linear Regression Angle\n        'LINEARREG_INTERCEPT',  # Linear Regression Intercept\n        'LINEARREG_SLOPE',      # Linear Regression Slope\n        'STDDEV',               # Standard Deviation\n        'TSF',                  # Time Series Forecast\n        'VAR',                  # Variance\n    }\n\n}\ngod_genes = set()\n########################### SETTINGS ##############################\n\ngod_genes = {'SMA'}\n# god_genes |= all_god_genes['Overlap Studies']\n# god_genes |= all_god_genes['Momentum Indicators']\n# god_genes |= all_god_genes['Volume Indicators']\n# god_genes |= all_god_genes['Volatility Indicators']\n# god_genes |= all_god_genes['Price Transform']\n# god_genes |= all_god_genes['Cycle Indicators']\n# god_genes |= all_god_genes['Pattern Recognition']\n# god_genes |= all_god_genes['Statistic Functions']\n\ntimeperiods = [5, 6, 12, 15, 50, 55, 100, 110]\noperators = [\n    \"D\",  # Disabled gene\n    \">\",  # Indicator, bigger than cross indicator\n    \"<\",  # Indicator, smaller than cross indicator\n    \"=\",  # Indicator, equal with cross indicator\n    \"C\",  # Indicator, crossed the cross indicator\n    \"CA\",  # Indicator, crossed above the cross indicator\n    \"CB\",  # Indicator, crossed below the cross indicator\n    \">R\",  # Normalized indicator, bigger than real number\n    \"=R\",  # Normalized indicator, equal with real number\n    \"<R\",  # Normalized indicator, smaller than real number\n    \"/>R\",  # Normalized indicator devided to cross indicator, bigger than real number\n    \"/=R\",  # Normalized indicator devided to cross indicator, equal with real number\n    \"/<R\",  # Normalized indicator devided to cross indicator, smaller than real number\n    \"UT\",  # Indicator, is in UpTrend status\n    \"DT\",  # Indicator, is in DownTrend status\n    \"OT\",  # Indicator, is in Off trend status(RANGE)\n    \"CUT\",  # Indicator, Entered to UpTrend status\n    \"CDT\",  # Indicator, Entered to DownTrend status\n    \"COT\"  # Indicator, Entered to Off trend status(RANGE)\n]\n# number of candles to check up,don,off trend.\nTREND_CHECK_CANDLES = 4\nDECIMALS = 1\n########################### END SETTINGS ##########################\n# DATAFRAME = DataFrame()\n\ngod_genes = list(god_genes)\n# print('selected indicators for optimzatin: \\n', god_genes)\n\ngod_genes_with_timeperiod = list()\nfor god_gene in god_genes:\n    for timeperiod in timeperiods:\n        god_genes_with_timeperiod.append(f'{god_gene}-{timeperiod}')\n\n# Let give somethings to CatagoricalParam to Play with them\n# When just one thing is inside catagorical lists\n# TODO: its Not True Way :)\nif len(god_genes) == 1:\n    god_genes = god_genes*2\nif len(timeperiods) == 1:\n    timeperiods = timeperiods*2\nif len(operators) == 1:\n    operators = operators*2\n\n\ndef normalize(df):\n    df = (df-df.min())/(df.max()-df.min())\n    return df\n\n\ndef gene_calculator(dataframe, indicator):\n    # Cuz Timeperiods not effect calculating CDL patterns recognations\n    if 'CDL' in indicator:\n        splited_indicator = indicator.split('-')\n        splited_indicator[1] = \"0\"\n        new_indicator = \"-\".join(splited_indicator)\n        # print(indicator, new_indicator)\n        indicator = new_indicator\n\n    gene = indicator.split(\"-\")\n\n    gene_name = gene[0]\n    gene_len = len(gene)\n\n    if indicator in dataframe.keys():\n        # print(f\"{indicator}, calculated befoure\")\n        # print(len(dataframe.keys()))\n        return dataframe[indicator]\n    else:\n        result = None\n        # For Pattern Recognations\n        if gene_len == 1:\n            # print('gene_len == 1\\t', indicator)\n            result = getattr(ta, gene_name)(\n                dataframe\n            )\n            return normalize(result)\n        elif gene_len == 2:\n            # print('gene_len == 2\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(result)\n        # For\n        elif gene_len == 3:\n            # print('gene_len == 3\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(result)\n        # For trend operators(MA-5-SMA-4)\n        elif gene_len == 4:\n            # print('gene_len == 4\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n        # For trend operators(STOCH-0-4-SMA-4)\n        elif gene_len == 5:\n            # print('gene_len == 5\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_index}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n\n\ndef condition_generator(dataframe, operator, indicator, crossed_indicator, real_num):\n\n    condition = (dataframe['volume'] > 10)\n\n    # TODO : it ill callculated in populate indicators.\n\n    dataframe[indicator] = gene_calculator(dataframe, indicator)\n    dataframe[crossed_indicator] = gene_calculator(dataframe, crossed_indicator)\n\n    indicator_trend_sma = f\"{indicator}-SMA-{TREND_CHECK_CANDLES}\"\n    if operator in [\"UT\", \"DT\", \"OT\", \"CUT\", \"CDT\", \"COT\"]:\n        dataframe[indicator_trend_sma] = gene_calculator(dataframe, indicator_trend_sma)\n\n    if operator == \">\":\n        condition = (\n            dataframe[indicator] > dataframe[crossed_indicator]\n        )\n    elif operator == \"=\":\n        condition = (\n            np.isclose(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"<\":\n        condition = (\n            dataframe[indicator] < dataframe[crossed_indicator]\n        )\n    elif operator == \"C\":\n        condition = (\n            (qtpylib.crossed_below(dataframe[indicator], dataframe[crossed_indicator])) |\n            (qtpylib.crossed_above(dataframe[indicator], dataframe[crossed_indicator]))\n        )\n    elif operator == \"CA\":\n        condition = (\n            qtpylib.crossed_above(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"CB\":\n        condition = (\n            qtpylib.crossed_below(\n                dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \">R\":\n        condition = (\n            dataframe[indicator] > real_num\n        )\n    elif operator == \"=R\":\n        condition = (\n            np.isclose(dataframe[indicator], real_num)\n        )\n    elif operator == \"<R\":\n        condition = (\n            dataframe[indicator] < real_num\n        )\n    elif operator == \"/>R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) > real_num\n        )\n    elif operator == \"/=R\":\n        condition = (\n            np.isclose(dataframe[indicator].div(dataframe[crossed_indicator]), real_num)\n        )\n    elif operator == \"/<R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) < real_num\n        )\n    elif operator == \"UT\":\n        condition = (\n            dataframe[indicator] > dataframe[indicator_trend_sma]\n        )\n    elif operator == \"DT\":\n        condition = (\n            dataframe[indicator] < dataframe[indicator_trend_sma]\n        )\n    elif operator == \"OT\":\n        condition = (\n\n            np.isclose(dataframe[indicator], dataframe[indicator_trend_sma])\n        )\n    elif operator == \"CUT\":\n        condition = (\n            (\n                qtpylib.crossed_above(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] > dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"CDT\":\n        condition = (\n            (\n                qtpylib.crossed_below(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] < dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"COT\":\n        condition = (\n            (\n                (\n                    qtpylib.crossed_below(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                ) |\n                (\n                    qtpylib.crossed_above(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                )\n            ) &\n            (\n                np.isclose(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            )\n        )\n\n    return condition, dataframe\n\n\n# Buy hyperspace params:\nbuy_params = {\n    \"buy_crossed_indicator0\": \"SMA-5\",\n    \"buy_crossed_indicator1\": \"SMA-12\",\n    \"buy_crossed_indicator2\": \"SMA-5\",\n    \"buy_indicator0\": \"SMA-15\",\n    \"buy_indicator1\": \"SMA-100\",\n    \"buy_indicator2\": \"SMA-110\",\n    \"buy_operator0\": \"<R\",\n    \"buy_operator1\": \">\",\n    \"buy_operator2\": \">\",\n    \"buy_real_num0\": 0.2,\n    \"buy_real_num1\": 0.5,\n    \"buy_real_num2\": 1.0,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"sell_crossed_indicator0\": \"SMA-100\",\n    \"sell_crossed_indicator1\": \"SMA-100\",\n    \"sell_crossed_indicator2\": \"SMA-15\",\n    \"sell_indicator0\": \"SMA-5\",\n    \"sell_indicator1\": \"SMA-5\",\n    \"sell_indicator2\": \"SMA-12\",\n    \"sell_operator0\": \"CB\",\n    \"sell_operator1\": \"CUT\",\n    \"sell_operator2\": \"OT\",\n    \"sell_real_num0\": 0.6,\n    \"sell_real_num1\": 0.5,\n    \"sell_real_num2\": 0.7,\n}\n\nclass GodStraNew40(IStrategy):\n    # #################### RESULTS PASTE PLACE ####################\n\n    # #################### END OF RESULT PLACE ####################\n\n    # TODO: Its not dry code!\n    # Buy Hyperoptable Parameters/Spaces.\n    buy_crossed_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=buy_params[\"buy_crossed_indicator0\"], space='buy')\n    buy_crossed_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=buy_params[\"buy_crossed_indicator1\"], space='buy')\n    buy_crossed_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=buy_params[\"buy_crossed_indicator2\"], space='buy')\n\n    buy_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=buy_params[\"buy_indicator0\"], space='buy')\n    buy_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=buy_params[\"buy_indicator1\"], space='buy')\n    buy_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=buy_params[\"buy_indicator2\"], space='buy')\n\n    buy_operator0 = CategoricalParameter(operators, default=buy_params[\"buy_operator0\"], space='buy')\n    buy_operator1 = CategoricalParameter(operators, default=buy_params[\"buy_operator1\"], space='buy')\n    buy_operator2 = CategoricalParameter(operators, default=buy_params[\"buy_operator2\"], space='buy')\n\n    buy_real_num0 = DecimalParameter(0, 1, decimals=DECIMALS,  default=buy_params[\"buy_real_num0\"], space='buy')\n    buy_real_num1 = DecimalParameter(0, 1, decimals=DECIMALS, default=buy_params[\"buy_real_num1\"], space='buy')\n    buy_real_num2 = DecimalParameter(0, 1, decimals=DECIMALS, default=buy_params[\"buy_real_num2\"], space='buy')\n\n    # Sell Hyperoptable Parameters/Spaces.\n    sell_crossed_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=sell_params[\"sell_crossed_indicator0\"], space='sell')\n    sell_crossed_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=sell_params[\"sell_crossed_indicator1\"], space='sell')\n    sell_crossed_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=sell_params[\"sell_crossed_indicator2\"], space='sell')\n\n    sell_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=sell_params[\"sell_indicator0\"], space='sell')\n    sell_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=sell_params[\"sell_indicator1\"], space='sell')\n    sell_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=sell_params[\"sell_indicator2\"], space='sell')\n\n    sell_operator0 = CategoricalParameter(operators, default=sell_params[\"sell_operator0\"], space='sell')\n    sell_operator1 = CategoricalParameter(operators, default=sell_params[\"sell_operator1\"], space='sell')\n    sell_operator2 = CategoricalParameter(operators, default=sell_params[\"sell_operator2\"], space='sell')\n\n    sell_real_num0 = DecimalParameter(0, 1, decimals=DECIMALS, default=sell_params[\"sell_real_num0\"], space='sell')\n    sell_real_num1 = DecimalParameter(0, 1, decimals=DECIMALS, default=sell_params[\"sell_real_num1\"], space='sell')\n    sell_real_num2 = DecimalParameter(0, 1, decimals=DECIMALS, default=sell_params[\"sell_real_num2\"], space='sell')\n\n    # Stoploss:\n    stoploss = -1\n    # Buy hypers\n    timeframe = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        It's good to calculate all indicators in all time periods here and so optimize the strategy.\n        But this strategy can take much time to generate anything that may not use in his optimization.\n        I just calculate the specific indicators in specific time period inside buy and sell strategy populator methods if needed.\n        Also, this method (populate_indicators) just calculates default value of hyperoptable params\n        so using this method have not big benefits instade of calculating useable things inside buy and sell trand populators\n        '''\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = list()\n\n        # TODO: Its not dry code!\n        buy_indicator = self.buy_indicator0.value\n        buy_crossed_indicator = self.buy_crossed_indicator0.value\n        buy_operator = self.buy_operator0.value\n        buy_real_num = self.buy_real_num0.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n        # backup\n        buy_indicator = self.buy_indicator1.value\n        buy_crossed_indicator = self.buy_crossed_indicator1.value\n        buy_operator = self.buy_operator1.value\n        buy_real_num = self.buy_real_num1.value\n\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        buy_indicator = self.buy_indicator2.value\n        buy_crossed_indicator = self.buy_crossed_indicator2.value\n        buy_operator = self.buy_operator2.value\n        buy_real_num = self.buy_real_num2.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        # print(len(dataframe.keys()))\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = list()\n        # TODO: Its not dry code!\n        sell_indicator = self.sell_indicator0.value\n        sell_crossed_indicator = self.sell_crossed_indicator0.value\n        sell_operator = self.sell_operator0.value\n        sell_real_num = self.sell_real_num0.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = self.sell_indicator1.value\n        sell_crossed_indicator = self.sell_crossed_indicator1.value\n        sell_operator = self.sell_operator1.value\n        sell_real_num = self.sell_real_num1.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = self.sell_indicator2.value\n        sell_crossed_indicator = self.sell_crossed_indicator2.value\n        sell_operator = self.sell_operator2.value\n        sell_real_num = self.sell_real_num2.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n        return dataframe\n"
  },
  {
    "path": "strategies/GodStraNew_SMAonly/GodStraNew_SMAonly.py",
    "content": "# GodStraNew Strategy\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces buy roi trailing sell --strategy GodStraNew\n# --- Do not remove these libs ---\nfrom freqtrade import data\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter\n\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# --------------------------------\n\n# Add your lib to import here\n# TODO: talib is fast but have not more indicators\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\nimport numpy as np\nfrom random import shuffle\n#  TODO: this gene is removed 'MAVP' cuz or error on periods\nall_god_genes = {\n    'Overlap Studies': {\n        'BBANDS-0',             # Bollinger Bands\n        'BBANDS-1',             # Bollinger Bands\n        'BBANDS-2',             # Bollinger Bands\n        'DEMA',                 # Double Exponential Moving Average\n        'EMA',                  # Exponential Moving Average\n        'HT_TRENDLINE',         # Hilbert Transform - Instantaneous Trendline\n        'KAMA',                 # Kaufman Adaptive Moving Average\n        'MA',                   # Moving average\n        'MAMA-0',               # MESA Adaptive Moving Average\n        'MAMA-1',               # MESA Adaptive Moving Average\n        # TODO: Fix this\n        # 'MAVP',               # Moving average with variable period\n        'MIDPOINT',             # MidPoint over period\n        'MIDPRICE',             # Midpoint Price over period\n        'SAR',                  # Parabolic SAR\n        'SAREXT',               # Parabolic SAR - Extended\n        'SMA',                  # Simple Moving Average\n        'T3',                   # Triple Exponential Moving Average (T3)\n        'TEMA',                 # Triple Exponential Moving Average\n        'TRIMA',                # Triangular Moving Average\n        'WMA',                  # Weighted Moving Average\n    },\n    'Momentum Indicators': {\n        'ADX',                  # Average Directional Movement Index\n        'ADXR',                 # Average Directional Movement Index Rating\n        'APO',                  # Absolute Price Oscillator\n        'AROON-0',              # Aroon\n        'AROON-1',              # Aroon\n        'AROONOSC',             # Aroon Oscillator\n        'BOP',                  # Balance Of Power\n        'CCI',                  # Commodity Channel Index\n        'CMO',                  # Chande Momentum Oscillator\n        'DX',                   # Directional Movement Index\n        'MACD-0',               # Moving Average Convergence/Divergence\n        'MACD-1',               # Moving Average Convergence/Divergence\n        'MACD-2',               # Moving Average Convergence/Divergence\n        'MACDEXT-0',            # MACD with controllable MA type\n        'MACDEXT-1',            # MACD with controllable MA type\n        'MACDEXT-2',            # MACD with controllable MA type\n        'MACDFIX-0',            # Moving Average Convergence/Divergence Fix 12/26\n        'MACDFIX-1',            # Moving Average Convergence/Divergence Fix 12/26\n        'MACDFIX-2',            # Moving Average Convergence/Divergence Fix 12/26\n        'MFI',                  # Money Flow Index\n        'MINUS_DI',             # Minus Directional Indicator\n        'MINUS_DM',             # Minus Directional Movement\n        'MOM',                  # Momentum\n        'PLUS_DI',              # Plus Directional Indicator\n        'PLUS_DM',              # Plus Directional Movement\n        'PPO',                  # Percentage Price Oscillator\n        'ROC',                  # Rate of change : ((price/prevPrice)-1)*100\n        'ROCP',                 # Rate of change Percentage: (price-prevPrice)/prevPrice\n        'ROCR',                 # Rate of change ratio: (price/prevPrice)\n        'ROCR100',              # Rate of change ratio 100 scale: (price/prevPrice)*100\n        'RSI',                  # Relative Strength Index\n        'STOCH-0',              # Stochastic\n        'STOCH-1',              # Stochastic\n        'STOCHF-0',             # Stochastic Fast\n        'STOCHF-1',             # Stochastic Fast\n        'STOCHRSI-0',           # Stochastic Relative Strength Index\n        'STOCHRSI-1',           # Stochastic Relative Strength Index\n        'TRIX',                 # 1-day Rate-Of-Change (ROC) of a Triple Smooth EMA\n        'ULTOSC',               # Ultimate Oscillator\n        'WILLR',                # Williams' %R\n    },\n    'Volume Indicators': {\n        'AD',                   # Chaikin A/D Line\n        'ADOSC',                # Chaikin A/D Oscillator\n        'OBV',                  # On Balance Volume\n    },\n    'Volatility Indicators': {\n        'ATR',                  # Average True Range\n        'NATR',                 # Normalized Average True Range\n        'TRANGE',               # True Range\n    },\n    'Price Transform': {\n        'AVGPRICE',             # Average Price\n        'MEDPRICE',             # Median Price\n        'TYPPRICE',             # Typical Price\n        'WCLPRICE',             # Weighted Close Price\n    },\n    'Cycle Indicators': {\n        'HT_DCPERIOD',          # Hilbert Transform - Dominant Cycle Period\n        'HT_DCPHASE',           # Hilbert Transform - Dominant Cycle Phase\n        'HT_PHASOR-0',          # Hilbert Transform - Phasor Components\n        'HT_PHASOR-1',          # Hilbert Transform - Phasor Components\n        'HT_SINE-0',            # Hilbert Transform - SineWave\n        'HT_SINE-1',            # Hilbert Transform - SineWave\n        'HT_TRENDMODE',         # Hilbert Transform - Trend vs Cycle Mode\n    },\n    'Pattern Recognition': {\n        'CDL2CROWS',            # Two Crows\n        'CDL3BLACKCROWS',       # Three Black Crows\n        'CDL3INSIDE',           # Three Inside Up/Down\n        'CDL3LINESTRIKE',       # Three-Line Strike\n        'CDL3OUTSIDE',          # Three Outside Up/Down\n        'CDL3STARSINSOUTH',     # Three Stars In The South\n        'CDL3WHITESOLDIERS',    # Three Advancing White Soldiers\n        'CDLABANDONEDBABY',     # Abandoned Baby\n        'CDLADVANCEBLOCK',      # Advance Block\n        'CDLBELTHOLD',          # Belt-hold\n        'CDLBREAKAWAY',         # Breakaway\n        'CDLCLOSINGMARUBOZU',   # Closing Marubozu\n        'CDLCONCEALBABYSWALL',  # Concealing Baby Swallow\n        'CDLCOUNTERATTACK',     # Counterattack\n        'CDLDARKCLOUDCOVER',    # Dark Cloud Cover\n        'CDLDOJI',              # Doji\n        'CDLDOJISTAR',          # Doji Star\n        'CDLDRAGONFLYDOJI',     # Dragonfly Doji\n        'CDLENGULFING',         # Engulfing Pattern\n        'CDLEVENINGDOJISTAR',   # Evening Doji Star\n        'CDLEVENINGSTAR',       # Evening Star\n        'CDLGAPSIDESIDEWHITE',  # Up/Down-gap side-by-side white lines\n        'CDLGRAVESTONEDOJI',    # Gravestone Doji\n        'CDLHAMMER',            # Hammer\n        'CDLHANGINGMAN',        # Hanging Man\n        'CDLHARAMI',            # Harami Pattern\n        'CDLHARAMICROSS',       # Harami Cross Pattern\n        'CDLHIGHWAVE',          # High-Wave Candle\n        'CDLHIKKAKE',           # Hikkake Pattern\n        'CDLHIKKAKEMOD',        # Modified Hikkake Pattern\n        'CDLHOMINGPIGEON',      # Homing Pigeon\n        'CDLIDENTICAL3CROWS',   # Identical Three Crows\n        'CDLINNECK',            # In-Neck Pattern\n        'CDLINVERTEDHAMMER',    # Inverted Hammer\n        'CDLKICKING',           # Kicking\n        'CDLKICKINGBYLENGTH',   # Kicking - bull/bear determined by the longer marubozu\n        'CDLLADDERBOTTOM',      # Ladder Bottom\n        'CDLLONGLEGGEDDOJI',    # Long Legged Doji\n        'CDLLONGLINE',          # Long Line Candle\n        'CDLMARUBOZU',          # Marubozu\n        'CDLMATCHINGLOW',       # Matching Low\n        'CDLMATHOLD',           # Mat Hold\n        'CDLMORNINGDOJISTAR',   # Morning Doji Star\n        'CDLMORNINGSTAR',       # Morning Star\n        'CDLONNECK',            # On-Neck Pattern\n        'CDLPIERCING',          # Piercing Pattern\n        'CDLRICKSHAWMAN',       # Rickshaw Man\n        'CDLRISEFALL3METHODS',  # Rising/Falling Three Methods\n        'CDLSEPARATINGLINES',   # Separating Lines\n        'CDLSHOOTINGSTAR',      # Shooting Star\n        'CDLSHORTLINE',         # Short Line Candle\n        'CDLSPINNINGTOP',       # Spinning Top\n        'CDLSTALLEDPATTERN',    # Stalled Pattern\n        'CDLSTICKSANDWICH',     # Stick Sandwich\n        'CDLTAKURI',            # Takuri (Dragonfly Doji with very long lower shadow)\n        'CDLTASUKIGAP',         # Tasuki Gap\n        'CDLTHRUSTING',         # Thrusting Pattern\n        'CDLTRISTAR',           # Tristar Pattern\n        'CDLUNIQUE3RIVER',      # Unique 3 River\n        'CDLUPSIDEGAP2CROWS',   # Upside Gap Two Crows\n        'CDLXSIDEGAP3METHODS',  # Upside/Downside Gap Three Methods\n\n    },\n    'Statistic Functions': {\n        'BETA',                 # Beta\n        'CORREL',               # Pearson's Correlation Coefficient (r)\n        'LINEARREG',            # Linear Regression\n        'LINEARREG_ANGLE',      # Linear Regression Angle\n        'LINEARREG_INTERCEPT',  # Linear Regression Intercept\n        'LINEARREG_SLOPE',      # Linear Regression Slope\n        'STDDEV',               # Standard Deviation\n        'TSF',                  # Time Series Forecast\n        'VAR',                  # Variance\n    }\n\n}\ngod_genes = set()\n########################### SETTINGS ##############################\n\ngod_genes = {'SMA'}\n# god_genes |= all_god_genes['Overlap Studies']\n# god_genes |= all_god_genes['Momentum Indicators']\n# god_genes |= all_god_genes['Volume Indicators']\n# god_genes |= all_god_genes['Volatility Indicators']\n# god_genes |= all_god_genes['Price Transform']\n# god_genes |= all_god_genes['Cycle Indicators']\n# god_genes |= all_god_genes['Pattern Recognition']\n# god_genes |= all_god_genes['Statistic Functions']\n\ntimeperiods = [5, 6, 12, 15, 50, 55, 100, 110]\noperators = [\n    \"D\",  # Disabled gene\n    \">\",  # Indicator, bigger than cross indicator\n    \"<\",  # Indicator, smaller than cross indicator\n    \"=\",  # Indicator, equal with cross indicator\n    \"C\",  # Indicator, crossed the cross indicator\n    \"CA\",  # Indicator, crossed above the cross indicator\n    \"CB\",  # Indicator, crossed below the cross indicator\n    \">R\",  # Normalized indicator, bigger than real number\n    \"=R\",  # Normalized indicator, equal with real number\n    \"<R\",  # Normalized indicator, smaller than real number\n    \"/>R\",  # Normalized indicator devided to cross indicator, bigger than real number\n    \"/=R\",  # Normalized indicator devided to cross indicator, equal with real number\n    \"/<R\",  # Normalized indicator devided to cross indicator, smaller than real number\n    \"UT\",  # Indicator, is in UpTrend status\n    \"DT\",  # Indicator, is in DownTrend status\n    \"OT\",  # Indicator, is in Off trend status(RANGE)\n    \"CUT\",  # Indicator, Entered to UpTrend status\n    \"CDT\",  # Indicator, Entered to DownTrend status\n    \"COT\"  # Indicator, Entered to Off trend status(RANGE)\n]\n# number of candles to check up,don,off trend.\nTREND_CHECK_CANDLES = 4\nDECIMALS = 1\n########################### END SETTINGS ##########################\n# DATAFRAME = DataFrame()\n\ngod_genes = list(god_genes)\n# print('selected indicators for optimzatin: \\n', god_genes)\n\ngod_genes_with_timeperiod = list()\nfor god_gene in god_genes:\n    for timeperiod in timeperiods:\n        god_genes_with_timeperiod.append(f'{god_gene}-{timeperiod}')\n\n# Let give somethings to CatagoricalParam to Play with them\n# When just one thing is inside catagorical lists\n# TODO: its Not True Way :)\nif len(god_genes) == 1:\n    god_genes = god_genes*2\nif len(timeperiods) == 1:\n    timeperiods = timeperiods*2\nif len(operators) == 1:\n    operators = operators*2\n\n\ndef normalize(df):\n    df = (df-df.min())/(df.max()-df.min())\n    return df\n\n\ndef gene_calculator(dataframe, indicator):\n    # Cuz Timeperiods not effect calculating CDL patterns recognations\n    if 'CDL' in indicator:\n        splited_indicator = indicator.split('-')\n        splited_indicator[1] = \"0\"\n        new_indicator = \"-\".join(splited_indicator)\n        # print(indicator, new_indicator)\n        indicator = new_indicator\n\n    gene = indicator.split(\"-\")\n\n    gene_name = gene[0]\n    gene_len = len(gene)\n\n    if indicator in dataframe.keys():\n        # print(f\"{indicator}, calculated befoure\")\n        # print(len(dataframe.keys()))\n        return dataframe[indicator]\n    else:\n        result = None\n        # For Pattern Recognations\n        if gene_len == 1:\n            # print('gene_len == 1\\t', indicator)\n            result = getattr(ta, gene_name)(\n                dataframe\n            )\n            return normalize(result)\n        elif gene_len == 2:\n            # print('gene_len == 2\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(result)\n        # For\n        elif gene_len == 3:\n            # print('gene_len == 3\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            result = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(result)\n        # For trend operators(MA-5-SMA-4)\n        elif gene_len == 4:\n            # print('gene_len == 4\\t', indicator)\n            gene_timeperiod = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            )\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n        # For trend operators(STOCH-0-4-SMA-4)\n        elif gene_len == 5:\n            # print('gene_len == 5\\t', indicator)\n            gene_timeperiod = int(gene[2])\n            gene_index = int(gene[1])\n            sharp_indicator = f'{gene_name}-{gene_index}-{gene_timeperiod}'\n            dataframe[sharp_indicator] = getattr(ta, gene_name)(\n                dataframe,\n                timeperiod=gene_timeperiod,\n            ).iloc[:, gene_index]\n            return normalize(ta.SMA(dataframe[sharp_indicator].fillna(0), TREND_CHECK_CANDLES))\n\n\ndef condition_generator(dataframe, operator, indicator, crossed_indicator, real_num):\n\n    condition = (dataframe['volume'] > 10)\n\n    # TODO : it ill callculated in populate indicators.\n\n    dataframe[indicator] = gene_calculator(dataframe, indicator)\n    dataframe[crossed_indicator] = gene_calculator(dataframe, crossed_indicator)\n\n    indicator_trend_sma = f\"{indicator}-SMA-{TREND_CHECK_CANDLES}\"\n    if operator in [\"UT\", \"DT\", \"OT\", \"CUT\", \"CDT\", \"COT\"]:\n        dataframe[indicator_trend_sma] = gene_calculator(dataframe, indicator_trend_sma)\n\n    if operator == \">\":\n        condition = (\n            dataframe[indicator] > dataframe[crossed_indicator]\n        )\n    elif operator == \"=\":\n        condition = (\n            np.isclose(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"<\":\n        condition = (\n            dataframe[indicator] < dataframe[crossed_indicator]\n        )\n    elif operator == \"C\":\n        condition = (\n            (qtpylib.crossed_below(dataframe[indicator], dataframe[crossed_indicator])) |\n            (qtpylib.crossed_above(dataframe[indicator], dataframe[crossed_indicator]))\n        )\n    elif operator == \"CA\":\n        condition = (\n            qtpylib.crossed_above(dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \"CB\":\n        condition = (\n            qtpylib.crossed_below(\n                dataframe[indicator], dataframe[crossed_indicator])\n        )\n    elif operator == \">R\":\n        condition = (\n            dataframe[indicator] > real_num\n        )\n    elif operator == \"=R\":\n        condition = (\n            np.isclose(dataframe[indicator], real_num)\n        )\n    elif operator == \"<R\":\n        condition = (\n            dataframe[indicator] < real_num\n        )\n    elif operator == \"/>R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) > real_num\n        )\n    elif operator == \"/=R\":\n        condition = (\n            np.isclose(dataframe[indicator].div(dataframe[crossed_indicator]), real_num)\n        )\n    elif operator == \"/<R\":\n        condition = (\n            dataframe[indicator].div(dataframe[crossed_indicator]) < real_num\n        )\n    elif operator == \"UT\":\n        condition = (\n            dataframe[indicator] > dataframe[indicator_trend_sma]\n        )\n    elif operator == \"DT\":\n        condition = (\n            dataframe[indicator] < dataframe[indicator_trend_sma]\n        )\n    elif operator == \"OT\":\n        condition = (\n\n            np.isclose(dataframe[indicator], dataframe[indicator_trend_sma])\n        )\n    elif operator == \"CUT\":\n        condition = (\n            (\n                qtpylib.crossed_above(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] > dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"CDT\":\n        condition = (\n            (\n                qtpylib.crossed_below(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            ) &\n            (\n                dataframe[indicator] < dataframe[indicator_trend_sma]\n            )\n        )\n    elif operator == \"COT\":\n        condition = (\n            (\n                (\n                    qtpylib.crossed_below(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                ) |\n                (\n                    qtpylib.crossed_above(\n                        dataframe[indicator],\n                        dataframe[indicator_trend_sma]\n                    )\n                )\n            ) &\n            (\n                np.isclose(\n                    dataframe[indicator],\n                    dataframe[indicator_trend_sma]\n                )\n            )\n        )\n\n    return condition, dataframe\n\n\nclass GodStraNew_SMAonly(IStrategy):\n    # #################### RESULTS PASTE PLACE ####################\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_crossed_indicator0\": \"SMA-110\",\n        \"buy_crossed_indicator1\": \"SMA-6\",\n        \"buy_crossed_indicator2\": \"SMA-100\",\n        \"buy_indicator0\": \"SMA-5\",\n        \"buy_indicator1\": \"SMA-5\",\n        \"buy_indicator2\": \"SMA-55\",\n        \"buy_operator0\": \"/<R\",\n        \"buy_operator1\": \"<R\",\n        \"buy_operator2\": \"/<R\",\n        \"buy_real_num0\": 0.3,\n        \"buy_real_num1\": 0.5,\n        \"buy_real_num2\": 0.9,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_crossed_indicator0\": \"SMA-50\",\n        \"sell_crossed_indicator1\": \"SMA-50\",\n        \"sell_crossed_indicator2\": \"SMA-110\",\n        \"sell_indicator0\": \"SMA-15\",\n        \"sell_indicator1\": \"SMA-110\",\n        \"sell_indicator2\": \"SMA-5\",\n        \"sell_operator0\": \"=\",\n        \"sell_operator1\": \"CA\",\n        \"sell_operator2\": \"<\",\n        \"sell_real_num0\": 0.9,\n        \"sell_real_num1\": 0.5,\n        \"sell_real_num2\": 0.8,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.288,\n        \"81\": 0.101,\n        \"170\": 0.049,\n        \"491\": 0\n    }\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.323\n    trailing_stop_positive_offset = 0.388\n    trailing_only_offset_is_reached = True\n\n    # #################### END OF RESULT PLACE ####################\n\n    # TODO: Its not dry code!\n    # Buy Hyperoptable Parameters/Spaces.\n    buy_crossed_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"ADD-20\", space='buy')\n    buy_crossed_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"ASIN-6\", space='buy')\n    buy_crossed_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLEVENINGSTAR-50\", space='buy')\n\n    buy_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"SMA-100\", space='buy')\n    buy_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"WILLR-50\", space='buy')\n    buy_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLHANGINGMAN-20\", space='buy')\n\n    buy_operator0 = CategoricalParameter(operators, default=\"/<R\", space='buy')\n    buy_operator1 = CategoricalParameter(operators, default=\"<R\", space='buy')\n    buy_operator2 = CategoricalParameter(operators, default=\"CB\", space='buy')\n\n    buy_real_num0 = DecimalParameter(0, 1, decimals=DECIMALS,  default=0.89009, space='buy')\n    buy_real_num1 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.56953, space='buy')\n    buy_real_num2 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.38365, space='buy')\n\n    # Sell Hyperoptable Parameters/Spaces.\n    sell_crossed_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLSHOOTINGSTAR-150\", space='sell')\n    sell_crossed_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"MAMA-1-100\", space='sell')\n    sell_crossed_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLMATHOLD-6\", space='sell')\n\n    sell_indicator0 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLUPSIDEGAP2CROWS-5\", space='sell')\n    sell_indicator1 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDLHARAMICROSS-150\", space='sell')\n    sell_indicator2 = CategoricalParameter(\n        god_genes_with_timeperiod, default=\"CDL2CROWS-5\", space='sell')\n\n    sell_operator0 = CategoricalParameter(operators, default=\"<R\", space='sell')\n    sell_operator1 = CategoricalParameter(operators, default=\"D\", space='sell')\n    sell_operator2 = CategoricalParameter(operators, default=\"/>R\", space='sell')\n\n    sell_real_num0 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.09731, space='sell')\n    sell_real_num1 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.81657, space='sell')\n    sell_real_num2 = DecimalParameter(0, 1, decimals=DECIMALS, default=0.87267, space='sell')\n\n    # Stoploss:\n    stoploss = -1\n    # Buy hypers\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        It's good to calculate all indicators in all time periods here and so optimize the strategy.\n        But this strategy can take much time to generate anything that may not use in his optimization.\n        I just calculate the specific indicators in specific time period inside buy and sell strategy populator methods if needed.\n        Also, this method (populate_indicators) just calculates default value of hyperoptable params\n        so using this method have not big benefits instade of calculating useable things inside buy and sell trand populators\n        '''\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = list()\n\n        # TODO: Its not dry code!\n        buy_indicator = self.buy_indicator0.value\n        buy_crossed_indicator = self.buy_crossed_indicator0.value\n        buy_operator = self.buy_operator0.value\n        buy_real_num = self.buy_real_num0.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n        # backup\n        buy_indicator = self.buy_indicator1.value\n        buy_crossed_indicator = self.buy_crossed_indicator1.value\n        buy_operator = self.buy_operator1.value\n        buy_real_num = self.buy_real_num1.value\n\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        buy_indicator = self.buy_indicator2.value\n        buy_crossed_indicator = self.buy_crossed_indicator2.value\n        buy_operator = self.buy_operator2.value\n        buy_real_num = self.buy_real_num2.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            buy_operator,\n            buy_indicator,\n            buy_crossed_indicator,\n            buy_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        # print(len(dataframe.keys()))\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = list()\n        # TODO: Its not dry code!\n        sell_indicator = self.sell_indicator0.value\n        sell_crossed_indicator = self.sell_crossed_indicator0.value\n        sell_operator = self.sell_operator0.value\n        sell_real_num = self.sell_real_num0.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = self.sell_indicator1.value\n        sell_crossed_indicator = self.sell_crossed_indicator1.value\n        sell_operator = self.sell_operator1.value\n        sell_real_num = self.sell_real_num1.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        sell_indicator = self.sell_indicator2.value\n        sell_crossed_indicator = self.sell_crossed_indicator2.value\n        sell_operator = self.sell_operator2.value\n        sell_real_num = self.sell_real_num2.value\n        condition, dataframe = condition_generator(\n            dataframe,\n            sell_operator,\n            sell_indicator,\n            sell_crossed_indicator,\n            sell_real_num\n        )\n        conditions.append(condition)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n        return dataframe"
  },
  {
    "path": "strategies/Guacamole/Guacamole.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI, VIDYA\n\n\nclass Guacamole(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n\n    # Buy hyperspace params:\n    buy_params = {\n        'macd': -0.75454, \n        'macdhist': -1, \n        'rmi': 49\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.13336,\n        \"19\": 0.07455,\n        \"37\": 0.04206,\n        \"57\": 0.02682,\n        \"73\": 0.01225,\n        \"125\": 0.0037,\n        \"244\": 0.0025\n    }\n\n    stoploss = -0.99\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01673\n    trailing_stop_positive_offset = 0.01851\n    trailing_only_offset_is_reached = False\n\n\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    # sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    process_only_new_candles = False\n\n    startup_candle_count: int = 20\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:        \n\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['rmi'] = RMI(dataframe)\n        dataframe['kama-3'] = ta.KAMA(dataframe, timeperiod=3)\n        dataframe['kama-21'] = ta.KAMA(dataframe, timeperiod=21)\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        dataframe['volume_ma'] = dataframe['volume'].rolling(window=24).mean()\n\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        conditions = []\n\n        active_trade = False\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n\n        if not active_trade:     \n            conditions.append(dataframe['kama-3'] > dataframe['kama-21'])\n            conditions.append(dataframe['macd'] > dataframe['macdsignal'])\n            conditions.append(dataframe['macd'] > params['macd'])\n            conditions.append(dataframe['macdhist'] > params['macdhist'])\n            conditions.append(dataframe['rmi'] > dataframe['rmi'].shift())\n            conditions.append(dataframe['rmi'] > params['rmi'])\n            conditions.append(dataframe['volume'] < (dataframe['volume_ma'] * 20))\n        else:\n            conditions.append(dataframe['close'] > dataframe['sar'])\n            conditions.append(dataframe['rmi'] >= 75)\n\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        conditions = []\n\n        active_trade = False\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n        \n        if active_trade:\n            ob = self.dp.orderbook(metadata['pair'], 1)\n            current_price = ob['asks'][0][0]\n            current_profit = active_trade[0].calc_profit_ratio(rate=current_price)\n\n            conditions.append(\n                (dataframe['rmi'] < 30) &\n                (current_profit > -0.03) &\n                (dataframe['volume'].gt(0))\n            )\n        \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        else:\n            dataframe['sell'] = 0\n      \n        return dataframe\n    \n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n    \"\"\"\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:\n        _, roi = self.min_roi_reached_entry(0)\n\n        if roi is None:\n           if Trade.max_rate >= Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate < Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return current_profit > roi\n        return False\n    \"\"\""
  },
  {
    "path": "strategies/Gumbo1/Gumbo1.py",
    "content": "\"\"\"\nhttps://github.com/raph92?tab=repositories\n\"\"\"\nimport logging\n\n# --- Do not remove these libs ---\nimport sys\nfrom functools import reduce\nfrom pathlib import Path\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.constants import ListPairsWithTimeframes\nfrom freqtrade.strategy import (\n    IntParameter,\n    DecimalParameter,\n    merge_informative_pair,\n)\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\nsys.path.append(str(Path(__file__).parent))\n\nlogger = logging.getLogger(__name__)\n\n\nclass Gumbo1(IStrategy):\n    # region Parameters\n    ewo_low = DecimalParameter(-20.0, 1, default=0, space=\"buy\", optimize=True)\n    t3_periods = IntParameter(5, 20, default=5, space=\"buy\", optimize=True)\n\n    stoch_high = IntParameter(60, 100, default=80, space=\"sell\", optimize=True)\n    stock_periods = IntParameter(70, 90, default=80, space=\"sell\", optimize=True)\n\n    # endregion\n    # region Params\n    minimal_roi = {\"0\": 0.10, \"20\": 0.05, \"64\": 0.03, \"168\": 0}\n    stoploss = -0.25\n    # endregion\n    timeframe = '5m'\n    use_custom_stoploss = False\n    inf_timeframe = '1h'\n    # Recommended\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n    startup_candle_count = 200\n\n    def informative_pairs(self) -> ListPairsWithTimeframes:\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def populate_informative_indicators(self, dataframe: DataFrame, metadata):\n        informative = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.inf_timeframe\n        )\n        # t3 from custom_indicators\n        informative['T3'] = T3(informative)\n        # bollinger bands\n        bbands = ta.BBANDS(informative, timeperiod=20)\n        informative['bb_lowerband'] = bbands['lowerband']\n        informative['bb_middleband'] = bbands['middleband']\n        informative['bb_upperband'] = bbands['upperband']\n\n        dataframe = merge_informative_pair(\n            dataframe, informative, self.timeframe, self.inf_timeframe\n        )\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # ewo\n        dataframe['EWO'] = EWO(dataframe)\n        # ema\n        dataframe['EMA'] = ta.EMA(dataframe)\n        # t3\n        for i in self.t3_periods.range:\n            dataframe[f'T3_{i}'] = T3(dataframe, i)\n        # bollinger bands 40\n        bbands = ta.BBANDS(dataframe, timeperiod=40)\n        dataframe['bb_lowerband_40'] = bbands['lowerband']\n        dataframe['bb_middleband_40'] = bbands['middleband']\n        dataframe['bb_upperband_40'] = bbands['upperband']\n        # stochastic\n        # stochastic windows\n        for i in self.stock_periods.range:\n            dataframe[f'stoch_{i}'] = stoch_sma(dataframe, window=i)\n        dataframe = self.populate_informative_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # ewo < 0\n        conditions.append(dataframe['EWO'] < self.ewo_low.value)\n        # middleband 1h >= t3 1h\n        conditions.append(dataframe['bb_middleband_1h'] >= dataframe['T3_1h'])\n        # t3 <= ema\n        conditions.append(dataframe[f'T3_{self.t3_periods.value}'] <= dataframe['EMA'])\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # stoch > 80\n        conditions.append(\n            dataframe[f'stoch_{self.stock_periods.value}'] > self.stoch_high.value\n        )\n        # t3 >= middleband_40\n        conditions.append(\n            dataframe[f'T3_{self.t3_periods.value}'] >= dataframe['bb_middleband_40']\n        )\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'sell'] = 1\n        return dataframe\n\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df[\"low\"] * 100\n    return emadif\n\n\ndef stoch_sma(dataframe: DataFrame, window=80):\n    \"\"\"\"\"\"\n    stoch = qtpylib.stoch(dataframe, window)\n    return qtpylib.sma((stoch['slow_k'] + stoch['slow_d']) / 2, 10)\n"
  },
  {
    "path": "strategies/Hacklemore2/Hacklemore2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\n\nclass Hacklemore2(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.14509,\n        \"9\": 0.07666,\n        \"23\": 0.0378,\n        \"36\": 0.01987,\n        \"60\": 0.0128,\n        \"145\": 0.00467,\n        \"285\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.99\n\n    trailing_stop = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '15m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    #sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=24).mean()\n\n        dataframe['RMI'] = RMI(dataframe)\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        dataframe['max'] = dataframe['high'].rolling(60).max()      \n\n        dataframe['min'] = dataframe['low'].rolling(60).min()       \n\n        dataframe['upper'] = np.where(dataframe['max'] > dataframe['max'].shift(),1,0)      \n\n        dataframe['lower'] = np.where(dataframe['min'] < dataframe['min'].shift(),1,0)      \n\n        dataframe['up_trend'] = np.where(dataframe['upper'].rolling(10, min_periods=1).sum() != 0,1,0)      \n\n        dataframe['dn_trend'] = np.where(dataframe['lower'].rolling(10, min_periods=1).sum() != 0,1,0)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        active_trade = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n\n        conditions = []\n\n        if not active_trade:\n            conditions.append(\n            (   (dataframe['up_trend'] == True) &\n                (dataframe['RMI'] > 55) &\n                (dataframe['RMI'] >= dataframe['RMI'].rolling(3).mean()) &\n                (dataframe['close'] > dataframe['close'].shift()) &\n                (dataframe['close'].shift() > dataframe['close'].shift(2)) &\n                (dataframe['sar'] < dataframe['close']) &\n                (dataframe['sar'].shift() < dataframe['close'].shift()) &\n                (dataframe['sar'].shift(2) < dataframe['close'].shift(2)) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 30))\n            ))\n\n        else:\n            conditions.append(dataframe['RMI'] >= 75) \n\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        active_trade = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n        \n        conditions = []\n\n        if active_trade:\n            ob = self.dp.orderbook(metadata['pair'], 1)\n            current_price = ob['asks'][0][0]\n            # current_profit = Trade.calc_profit_ratio(active_trade[0], rate=current_price)\n            current_profit = active_trade[0].calc_profit_ratio(rate=current_price)\n\n            conditions.append(\n                (dataframe['buy'] == 0) &\n                (dataframe['dn_trend'] == True) &\n                (dataframe['RMI'] < 30) &\n                (current_profit > -0.03) &\n                (dataframe['volume'].gt(0))\n            ) \n        \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        else:\n            dataframe['sell'] = 0\n      \n        return dataframe\n\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n    \"\"\"\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:\n        _, roi = self.min_roi_reached_entry(0)\n\n        if roi is None:\n           if Trade.max_rate >= Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate < Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return current_profit > roi\n        return False\n    \"\"\""
  },
  {
    "path": "strategies/Hacklemore3/Hacklemore3.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\n\nclass Hacklemore3(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.15,\n        \"5\": 0.015\n    }\n\n    # Stoploss:\n    stoploss = -0.99\n\n    trailing_stop = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=24).mean()\n        dataframe['rmi'] = RMI(dataframe)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['max'] = dataframe['high'].rolling(12).max()      \n        dataframe['min'] = dataframe['low'].rolling(12).min()       \n        dataframe['upper'] = np.where(dataframe['max'] > dataframe['max'].shift(),1,0)      \n        dataframe['lower'] = np.where(dataframe['min'] < dataframe['min'].shift(),1,0)      \n        dataframe['up_trend'] = np.where(dataframe['upper'].rolling(3, min_periods=1).sum() != 0,1,0)      \n        dataframe['dn_trend'] = np.where(dataframe['lower'].rolling(3, min_periods=1).sum() != 0,1,0)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        active_trade = False\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n\n        # Normal buy triggers that apply to new trades we want to enter\n        if not active_trade:\n            conditions.append(\n                (dataframe['up_trend'] == 1) &\n                (dataframe['rmi'] > 55) &\n                (dataframe['rmi'] >= dataframe['rmi'].rolling(3).mean()) &\n                (dataframe['close'] > dataframe['close'].shift()) &\n                (dataframe['close'].shift() > dataframe['close'].shift(2)) &\n                (dataframe['sar'] < dataframe['close']) &\n                (dataframe['sar'].shift() < dataframe['close'].shift()) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 30))\n            )\n        # Persist a buy signal for existing trades to make use of ignore_roi_if_buy_signal = True\n        # when this buy signal is not present a sell will happen according to ROI table\n        else:\n            conditions.append(dataframe['rmi'] >= 75) \n\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    \n        conditions = []\n\n        active_trade = False\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n        \n        # if we are in an active trade for this pair consider various things in our sell signal\n        if active_trade:\n            ob = self.dp.orderbook(metadata['pair'], 1)\n            current_price = ob['asks'][0][0]\n            current_profit = active_trade[0].calc_profit_ratio(rate=current_price)\n            max_price = active_trade[0].max_rate\n            # if we are at a loss, consider what the trend looks like in the sell\n            if current_profit < 0:\n                conditions.append(\n                    (dataframe['dn_trend'] == 1) &\n                    (dataframe['rmi'] < 50) &\n                    (dataframe['volume'].gt(0))\n                    # custom sell-reason: dynamic-stop-loss\n                )\n            # if we are in a profit, produce a sort of dynamic trailing stoploss\n            else: \n                conditions.append(\n                    (current_price > (max_price * 0.8)) &\n                    (dataframe['close'] < dataframe['close'].shift()) &\n                    (dataframe['high'] < dataframe['high'].shift())\n                    # custom sell-reason: dynamic-trailing-stop\n                ) \n        else:\n            # impossible condition needed for some reason?\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n    \"\"\"\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:\n        _, roi = self.min_roi_reached_entry(0)\n\n        if roi is None:\n           if Trade.max_rate >= Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate < Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return current_profit > roi\n        return False\n    \"\"\""
  },
  {
    "path": "strategies/HansenSmaOffsetV1/HansenSmaOffsetV1.py",
    "content": "# --- Do not remove these libs --- freqtrade backtesting --strategy SmoothScalp --timerange 20210110-20210410\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\"\"\" use 15 open trade, unlimited stake. \n\npairlist setting:\n\n\"pairlists\": [\n        {\n            \"method\": \"VolumePairList\",\n            \"number_assets\": 50,\n            \"sort_key\": \"quoteVolume\",\n            \"refresh_period\": 1800\n        }\n    ],\n\n\"\"\"\n\nclass HansenSmaOffsetV1(IStrategy):\n    timeframe = '15m'\n    #I haven't found the optimal ROI yet\n    minimal_roi = {\n        \"0\": 10,\n    }\n    stoploss = -99\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:   \n        dataframe['smau1'] = ta.SMA(dataframe['close'], timeperiod=20)+0.05*ta.SMA(dataframe['close'], timeperiod=20)\n        dataframe['smad1'] = ta.SMA(dataframe['close'], timeperiod=20)-0.05*ta.SMA(dataframe['close'], timeperiod=20)\n        dataframe['hclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2)\n        dataframe['hhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hlow']=dataframe[['open','close','low']].min(axis=1)\n        dataframe['emac'] = ta.SMA(dataframe['hclose'], timeperiod=6)\n        dataframe['emao'] = ta.SMA(dataframe['hopen'], timeperiod=6)\n        return dataframe\n        \n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['high']<dataframe['smad1'])&\n                (dataframe['hopen'] < dataframe['hclose'])\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['low']>dataframe['smau1'])&\n                (dataframe['hopen'] > dataframe['hclose'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/HarmonicDivergence/HarmonicDivergence.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\r\n# flake8: noqa: F401\r\n\r\n# --- Do not remove these libs ---\r\nimport datetime\r\nfrom typing import List, Tuple\r\nimport numpy as np  # noqa\r\nimport pandas as pd  # noqa\r\npd.options.mode.chained_assignment = None\r\nfrom pandas import DataFrame, Series\r\nfrom technical.util import resample_to_interval, resampled_merge\r\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\r\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\r\n\r\n\r\n# --------------------------------\r\n# Add your lib to import here\r\nimport talib.abstract as ta\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nfrom collections import deque\r\n\r\n\r\nclass PlotConfig():\r\n\r\n    def __init__(self):\r\n        self.config = {\r\n            'main_plot': {\r\n                resample('bollinger_upperband') : {'color': 'rgba(4,137,122,0.7)'},\r\n                resample('kc_upperband') : {'color': 'rgba(4,146,250,0.7)'},\r\n                resample('kc_middleband') : {'color': 'rgba(4,146,250,0.7)'},\r\n                resample('kc_lowerband') : {'color': 'rgba(4,146,250,0.7)'},\r\n                resample('bollinger_lowerband') : {\r\n                    'color': 'rgba(4,137,122,0.7)',\r\n                    'fill_to': resample('bollinger_upperband'),\r\n                    'fill_color': 'rgba(4,137,122,0.07)'\r\n                    },\r\n                resample('ema9') : {'color': 'purple'},\r\n                resample('ema20') : {'color': 'yellow'},\r\n                resample('ema50') : {'color': 'red'},\r\n                resample('ema200') : {'color': 'white'},\r\n            },\r\n            'subplots': {\r\n                \"ATR\" : {\r\n                    resample('atr'):{'color':'firebrick'}\r\n                }\r\n            }\r\n        }\r\n\r\n    def add_pivots_in_config(self):\r\n        self.config['main_plot'][\"pivot_lows\"] = {\r\n            \"plotly\": {\r\n                'mode': 'markers',\r\n                'marker': {\r\n                    'symbol': 'diamond-open',\r\n                    'size': 11,\r\n                    'line': {\r\n                        'width': 2\r\n                    },\r\n                    'color': 'olive'\r\n                }\r\n            }\r\n        }\r\n        self.config['main_plot'][\"pivot_highs\"] = {\r\n            \"plotly\": {\r\n                'mode': 'markers',\r\n                'marker': {\r\n                    'symbol': 'diamond-open',\r\n                    'size': 11,\r\n                    'line': {\r\n                        'width': 2\r\n                    },\r\n                    'color': 'violet'\r\n                }\r\n            }\r\n        }\r\n        self.config['main_plot'][\"pivot_highs\"] = {\r\n            \"plotly\": {\r\n                'mode': 'markers',\r\n                'marker': {\r\n                    'symbol': 'diamond-open',\r\n                    'size': 11,\r\n                    'line': {\r\n                        'width': 2\r\n                    },\r\n                    'color': 'violet'\r\n                }\r\n            }\r\n        }\r\n        return self\r\n\r\n    def add_divergence_in_config(self, indicator:str):\r\n        # self.config['main_plot'][\"bullish_divergence_\" + indicator + \"_occurence\"] = {\r\n        #     \"plotly\": {\r\n        #         'mode': 'markers',\r\n        #         'marker': {\r\n        #             'symbol': 'diamond',\r\n        #             'size': 11,\r\n        #             'line': {\r\n        #                 'width': 2\r\n        #             },\r\n        #             'color': 'orange'\r\n        #         }\r\n        #     }\r\n        # }\r\n        # self.config['main_plot'][\"bearish_divergence_\" + indicator + \"_occurence\"] = {\r\n        #     \"plotly\": {\r\n        #         'mode': 'markers',\r\n        #         'marker': {\r\n        #             'symbol': 'diamond',\r\n        #             'size': 11,\r\n        #             'line': {\r\n        #                 'width': 2\r\n        #             },\r\n        #             'color': 'purple'\r\n        #         }\r\n        #     }\r\n        # }\r\n        for i in range(3):\r\n            self.config['main_plot'][\"bullish_divergence_\" + indicator + \"_line_\" + str(i)] = {\r\n                \"plotly\": {\r\n                    'mode': 'lines',\r\n                    'line' : {\r\n                        'color': 'green',\r\n                        'dash' :'dash'\r\n                    }\r\n                }\r\n            }   \r\n            self.config['main_plot'][\"bearish_divergence_\" + indicator + \"_line_\" + str(i)] = {\r\n                \"plotly\": {\r\n                    'mode': 'lines',\r\n                    'line' : {\r\n                        \"color\":'crimson',\r\n                        'dash' :'dash'\r\n                    }\r\n                }\r\n            } \r\n        return self\r\n\r\n    def add_total_divergences_in_config(self, dataframe):\r\n        total_bullish_divergences_count = dataframe[resample(\"total_bullish_divergences_count\")]\r\n        total_bullish_divergences_names = dataframe[resample(\"total_bullish_divergences_names\")]\r\n        self.config['main_plot'][resample(\"total_bullish_divergences\")] = {\r\n            \"plotly\": {\r\n                'mode': 'markers+text',\r\n                'text': total_bullish_divergences_count,\r\n                'hovertext': total_bullish_divergences_names,\r\n                'textfont':{'size': 11, 'color':'green'},\r\n                'textposition':'bottom center',\r\n                'marker': {\r\n                    'symbol': 'diamond',\r\n                    'size': 11,\r\n                    'line': {\r\n                        'width': 2\r\n                    },\r\n                    'color': 'green'\r\n                }\r\n            }\r\n        }\r\n        total_bearish_divergences_count = dataframe[resample(\"total_bearish_divergences_count\")]\r\n        total_bearish_divergences_names = dataframe[resample(\"total_bearish_divergences_names\")]\r\n        self.config['main_plot'][resample(\"total_bearish_divergences\")] = {\r\n            \"plotly\": {\r\n                'mode': 'markers+text',\r\n                'text': total_bearish_divergences_count,\r\n                'hovertext': total_bearish_divergences_names,\r\n                'textfont':{'size': 11, 'color':'crimson'},\r\n                'textposition':'top center',\r\n                'marker': {\r\n                    'symbol': 'diamond',\r\n                    'size': 11,\r\n                    'line': {\r\n                        'width': 2\r\n                    },\r\n                    'color': 'crimson'\r\n                }\r\n            }\r\n        }\r\n        return self\r\n        \r\nclass HarmonicDivergence(IStrategy):\r\n    \"\"\"\r\n    This is a strategy template to get you started.\r\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\r\n\r\n    You can:\r\n        :return: a Dataframe with all mandatory indicators for the strategies\r\n    - Rename the class name (Do not forget to update class_name)\r\n    - Add any methods you want to build your strategy\r\n    - Add any lib you need to build your strategy\r\n\r\n    You must keep:\r\n    - the lib in the section \"Do not remove these libs\"\r\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\r\n    You should keep:\r\n    - timeframe, minimal_roi, stoploss, trailing_*\r\n    \"\"\"\r\n    # Strategy interface version - allow new iterations of the strategy interface.\r\n    # Check the documentation or the Sample strategy to get the latest version.\r\n    INTERFACE_VERSION = 2\r\n\r\n    # Minimal ROI designed for the strategy.\r\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\r\n    minimal_roi = {\r\n        \"300\" : 0.01,\r\n        \"60\": 0.02,\r\n        \"30\": 0.03,\r\n        \"0\": 0.05,\r\n        # \"420\" : 0.005,\r\n        # \"300\" : 0.007,\r\n        # \"240\" : 0.009,\r\n        #\"0\": 0.018\r\n        #\"0\": 0.007\r\n    }\r\n\r\n    # Optimal stoploss designed for the strategy.\r\n    # This attribute will be overridden if the config file contains \"stoploss\".\r\n    stoploss = -0.5\r\n\r\n    use_custom_stoploss = True\r\n\r\n    # Trailing stoploss\r\n    trailing_stop = True\r\n    trailing_stop_positive = 0.007\r\n    trailing_stop_positive_offset = 0.015  # Disabled / not configured\r\n    trailing_only_offset_is_reached = True\r\n\r\n    # Optimal timeframe for the strategy.\r\n    timeframe = '15m'\r\n\r\n    # Run \"populate_indicators()\" only for new candle.\r\n    process_only_new_candles = False\r\n\r\n    # These values can be overridden in the \"ask_strategy\" section in the config.\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Number of candles the strategy requires before producing valid signals\r\n    startup_candle_count: int = 30\r\n\r\n    # Optional order type mapping.\r\n    order_types = {\r\n        'buy': 'market',\r\n        'sell': 'market',\r\n        'stoploss': 'limit',\r\n        'stoploss_on_exchange': False\r\n    }\r\n\r\n    # Optional order time in force.\r\n    order_time_in_force = {\r\n        'buy': 'gtc',\r\n        'sell': 'gtc'\r\n    }\r\n\r\n    plot_config = None\r\n\r\n    def get_ticker_indicator(self):\r\n        return int(self.timeframe[:-1])\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Adds several different TA indicators to the given DataFrame\r\n\r\n        Performance Note: For the best performance be frugal on the number of indicators\r\n        you are using. Let uncomment only the indicator you are using in your strategies\r\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\r\n        :param dataframe: Dataframe with data from the exchange\r\n        :param metadata: Additional information, like the currently traded pair\r\n        :return: a Dataframe with all mandatory indicators for the strategies\r\n        \"\"\"\r\n\r\n        # Get the informative pair\r\n        # informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe='15m')\r\n        # informative = resample_to_interval(dataframe, self.get_ticker_indicator() * 15)\r\n        informative = dataframe\r\n        # Momentum Indicators\r\n        # ------------------------------------\r\n\r\n        # RSI\r\n        informative['rsi'] = ta.RSI(informative)\r\n        # Stochastic Slow\r\n        informative['stoch'] = ta.STOCH(informative)['slowk']\r\n        # ROC\r\n        informative['roc'] = ta.ROC(informative)\r\n        # Ultimate Oscillator\r\n        informative['uo'] = ta.ULTOSC(informative)\r\n        # Awesome Oscillator\r\n        informative['ao'] = qtpylib.awesome_oscillator(informative)\r\n        # MACD\r\n        informative['macd'] = ta.MACD(informative)['macd']\r\n        # Commodity Channel Index\r\n        informative['cci'] = ta.CCI(informative)\r\n        # CMF\r\n        informative['cmf'] = chaikin_money_flow(informative, 20)\r\n        # OBV\r\n        informative['obv'] = ta.OBV(informative)\r\n        # MFI\r\n        informative['mfi'] = ta.MFI(informative)\r\n        # ADX\r\n        informative['adx'] = ta.ADX(informative)\r\n\r\n        # ATR\r\n        informative['atr'] = qtpylib.atr(informative, window=14, exp=False)\r\n\r\n        # Keltner Channel\r\n        # keltner = qtpylib.keltner_channel(dataframe, window=20, atrs=1)\r\n        keltner = emaKeltner(informative)\r\n        informative[\"kc_upperband\"] = keltner[\"upper\"]\r\n        informative[\"kc_middleband\"] = keltner[\"mid\"]\r\n        informative[\"kc_lowerband\"] = keltner[\"lower\"]\r\n\r\n        # Bollinger Bands\r\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative), window=20, stds=2)\r\n        informative['bollinger_upperband'] = bollinger['upper']\r\n        informative['bollinger_lowerband'] = bollinger['lower']\r\n\r\n        # EMA - Exponential Moving Average\r\n        informative['ema9'] = ta.EMA(informative, timeperiod=9)\r\n        informative['ema20'] = ta.EMA(informative, timeperiod=20)\r\n        informative['ema50'] = ta.EMA(informative, timeperiod=50)\r\n        informative['ema200'] = ta.EMA(informative, timeperiod=200)        \r\n        \r\n        pivots = pivot_points(informative)\r\n        informative['pivot_lows'] = pivots['pivot_lows']\r\n        informative['pivot_highs'] = pivots['pivot_highs']\r\n\r\n        # Use the helper function merge_informative_pair to safely merge the pair\r\n        # Automatically renames the columns and merges a shorter timeframe dataframe and a longer timeframe informative pair\r\n        # use ffill to have the 1d value available in every row throughout the day.\r\n        # Without this, comparisons between columns of the original and the informative pair would only work once per day.\r\n        # Full documentation of this method, see below\r\n \r\n\r\n        initialize_divergences_lists(informative)\r\n        add_divergences(informative, 'rsi')\r\n        add_divergences(informative, 'stoch')\r\n        add_divergences(informative, 'roc')\r\n        add_divergences(informative, 'uo')\r\n        add_divergences(informative, 'ao')\r\n        add_divergences(informative, 'macd')\r\n        add_divergences(informative, 'cci')\r\n        add_divergences(informative, 'cmf')\r\n        add_divergences(informative, 'obv')\r\n        add_divergences(informative, 'mfi')\r\n        add_divergences(informative, 'adx')\r\n\r\n        # print(\"-------------------informative-------------------\")\r\n        # print(informative)\r\n        # print(\"-------------------dataframe-------------------\")\r\n        # print(dataframe)\r\n        # dataframe = merge_informative_pair(dataframe, informative, self.timeframe, '15m', ffill=True)\r\n\r\n        # dataframe = resampled_merge(dataframe, informative)\r\n        # print(dataframe[resample(\"total_bullish_divergences_count\")])\r\n        # for index, value in enumerate(dataframe[resample(\"total_bullish_divergences_count\")]):\r\n        #     if value < 0.5:\r\n        #         dataframe[resample(\"total_bullish_divergences_count\")][index] = None\r\n        #         dataframe[resample(\"total_bullish_divergences\")][index] = None\r\n        #         dataframe[resample(\"total_bullish_divergences_names\")][index] = None\r\n        #     else:\r\n        #         print(value)\r\n        #         print(dataframe[resample(\"total_bullish_divergences\")][index])\r\n        #         print(dataframe[resample(\"total_bullish_divergences_names\")][index])\r\n        HarmonicDivergence.plot_config = (\r\n            PlotConfig()\r\n            # .add_pivots_in_config()\r\n            # .add_divergence_in_config('rsi')\r\n            # .add_divergence_in_config('stoch')\r\n            # .add_divergence_in_config('roc')\r\n            # .add_divergence_in_config('uo')\r\n            # .add_divergence_in_config('ao')\r\n            # .add_divergence_in_config('macd')\r\n            # .add_divergence_in_config('cci')\r\n            # .add_divergence_in_config('cmf')\r\n            # .add_divergence_in_config('obv')\r\n            # .add_divergence_in_config('mfi')\r\n            # .add_divergence_in_config('adx')\r\n            .add_total_divergences_in_config(dataframe)\r\n            .config)\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the buy signal for the given dataframe\r\n        :param dataframe: DataFrame populated with indicators\r\n        :param metadata: Additional information, like the currently traded pair\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        dataframe.loc[\r\n            (\r\n                (dataframe[resample('total_bullish_divergences')].shift() > 0)\r\n                # # & (dataframe['high'] > dataframe['high'].shift())\r\n                # & (\r\n                #     (keltner_middleband_check(dataframe) & (ema_check(dataframe)) & (green_candle(dataframe)))\r\n                #     # (keltner_middleband_check(dataframe) & (green_candle(dataframe)))\r\n                #     | (keltner_lowerband_check(dataframe) & (ema_check(dataframe)))\r\n                #     # | keltner_lowerband_check(dataframe)\r\n                #     # | (keltner_lowerband_check(dataframe) & (green_candle(dataframe)))\r\n                #     | (bollinger_lowerband_check(dataframe) & (ema_check(dataframe)))\r\n                # )\r\n                & two_bands_check(dataframe)\r\n                # # & bollinger_keltner_check(dataframe)\r\n                # & ema_cross_check(dataframe)\r\n                & (dataframe['volume'] > 0)  # Make sure Volume is not 0\r\n            ),\r\n            'buy'] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the sell signal for the given dataframe\r\n        :param dataframe: DataFrame populated with indicators\r\n        :param metadata: Additional information, like the currently traded pair\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\r\n            ),\r\n            'sell'] = 0\r\n        return dataframe\r\n        \r\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\r\n                    current_profit: float, **kwargs):\r\n\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n        takeprofit = 999999\r\n        # self.trailing_stop = False\r\n        \r\n        for i in range(1,len(dataframe['close'])):\r\n            if dataframe.iloc[-i]['date'].to_pydatetime().replace(tzinfo=datetime.timezone.utc) == trade.open_date_utc:\r\n                buy_candle = dataframe.iloc[-i-1].squeeze()\r\n                takeprofit = buy_candle[resample('high')] + buy_candle[resample('atr')]\r\n                break\r\n\r\n        # if takeprofit < current_rate:\r\n            # self.trailing_stop = True\r\n            # return True\r\n\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\r\n                            current_rate: float, current_profit: float, **kwargs) -> float:\r\n\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n        stoploss = 999999\r\n\r\n        for i in range(1,len(dataframe['close'])):            \r\n            if dataframe.iloc[-i]['date'].to_pydatetime().replace(tzinfo=datetime.timezone.utc) == trade.open_date_utc:\r\n                buy_candle = dataframe.iloc[-i-1].squeeze()\r\n                stoploss = buy_candle[resample('low')] - buy_candle[resample('atr')]\r\n                # stoploss = buy_candle[resample('high')] - buy_candle[resample('atr')]\r\n                break\r\n\r\n        # Convert absolute price to percentage relative to current_rate\r\n        if stoploss < current_rate:\r\n            return (stoploss / current_rate) - 1\r\n\r\n        # return maximum stoploss value, keeping current stoploss price unchanged\r\n        return 1\r\n\r\ndef resample(indicator):\r\n    # return \"resample_15_\" + indicator\r\n    return indicator\r\n\r\ndef two_bands_check(dataframe):\r\n    check = (\r\n    # ((dataframe['low'] < dataframe['bollinger_lowerband']) & (dataframe['high'] > dataframe['kc_lowerband'])) |\r\n    ((dataframe[resample('low')] < dataframe[resample('kc_lowerband')]) & (dataframe[resample('high')] > dataframe[resample('kc_upperband')])) # 1\r\n    #  ((dataframe['low'] < dataframe['kc_lowerband']) & (dataframe['high'] > dataframe['kc_middleband'])) # 2\r\n    # | ((dataframe['low'] < dataframe['kc_middleband']) & (dataframe['high'] > dataframe['kc_upperband'])) # 2\r\n    )\r\n    return ~check\r\n\r\ndef ema_cross_check(dataframe):\r\n    dataframe['ema20_50_cross'] = qtpylib.crossed_below(dataframe[resample('ema20')],dataframe[resample('ema50')])\r\n    dataframe['ema20_200_cross'] = qtpylib.crossed_below(dataframe[resample('ema20')],dataframe[resample('ema200')])\r\n    dataframe['ema50_200_cross'] = qtpylib.crossed_below(dataframe[resample('ema50')],dataframe[resample('ema200')])\r\n    return ~(\r\n        dataframe['ema20_50_cross'] \r\n        | dataframe['ema20_200_cross'] \r\n        | dataframe['ema50_200_cross'] \r\n        )\r\n\r\ndef green_candle(dataframe):\r\n    return dataframe[resample('open')] < dataframe[resample('close')]\r\n\r\ndef keltner_middleband_check(dataframe):\r\n    return (dataframe[resample('low')] < dataframe[resample('kc_middleband')]) & (dataframe[resample('high')] > dataframe[resample('kc_middleband')])\r\n\r\ndef keltner_lowerband_check(dataframe):\r\n    return (dataframe[resample('low')] < dataframe[resample('kc_lowerband')]) & (dataframe[resample('high')] > dataframe[resample('kc_lowerband')])\r\n\r\ndef bollinger_lowerband_check(dataframe):\r\n    return (dataframe[resample('low')] < dataframe[resample('bollinger_lowerband')]) & (dataframe[resample('high')] > dataframe[resample('bollinger_lowerband')])\r\n\r\ndef bollinger_keltner_check(dataframe):\r\n    return (dataframe[resample('bollinger_lowerband')] < dataframe[resample('kc_lowerband')]) & (dataframe[resample('bollinger_upperband')] > dataframe[resample('kc_upperband')])\r\n\r\ndef ema_check(dataframe):\r\n    check = (\r\n        (dataframe[resample('ema9')] < dataframe[resample('ema20')])\r\n        & (dataframe[resample('ema20')] < dataframe[resample('ema50')])\r\n        & (dataframe[resample('ema50')] < dataframe[resample('ema200')]))\r\n    return ~check\r\n\r\ndef initialize_divergences_lists(dataframe: DataFrame):\r\n    dataframe[\"total_bullish_divergences\"] = np.empty(len(dataframe['close'])) * np.nan\r\n    dataframe[\"total_bullish_divergences_count\"] = np.empty(len(dataframe['close'])) * np.nan\r\n    dataframe[\"total_bullish_divergences_count\"] = [0 if x != x else x for x in dataframe[\"total_bullish_divergences_count\"]]\r\n    dataframe[\"total_bullish_divergences_names\"] = np.empty(len(dataframe['close'])) * np.nan\r\n    dataframe[\"total_bullish_divergences_names\"] = ['' if x != x else x for x in dataframe[\"total_bullish_divergences_names\"]]\r\n    dataframe[\"total_bearish_divergences\"] = np.empty(len(dataframe['close'])) * np.nan\r\n    dataframe[\"total_bearish_divergences_count\"] = np.empty(len(dataframe['close'])) * np.nan\r\n    dataframe[\"total_bearish_divergences_count\"] = [0 if x != x else x for x in dataframe[\"total_bearish_divergences_count\"]]\r\n    dataframe[\"total_bearish_divergences_names\"] = np.empty(len(dataframe['close'])) * np.nan\r\n    dataframe[\"total_bearish_divergences_names\"] = ['' if x != x else x for x in dataframe[\"total_bearish_divergences_names\"]]\r\n\r\ndef add_divergences(dataframe: DataFrame, indicator: str):\r\n    (bearish_divergences, bearish_lines, bullish_divergences, bullish_lines) = divergence_finder_dataframe(dataframe, indicator)\r\n    dataframe['bearish_divergence_' + indicator + '_occurence'] = bearish_divergences\r\n    # for index, bearish_line in enumerate(bearish_lines):\r\n    #     dataframe['bearish_divergence_' + indicator + '_line_'+ str(index)] = bearish_line\r\n    dataframe['bullish_divergence_' + indicator + '_occurence'] = bullish_divergences\r\n    # for index, bullish_line in enumerate(bullish_lines):\r\n    #     dataframe['bullish_divergence_' + indicator + '_line_'+ str(index)] = bullish_line\r\n\r\ndef divergence_finder_dataframe(dataframe: DataFrame, indicator_source: str) -> Tuple[pd.Series, pd.Series]:\r\n    bearish_lines = [np.empty(len(dataframe['close'])) * np.nan]\r\n    bearish_divergences = np.empty(len(dataframe['close'])) * np.nan\r\n    bullish_lines = [np.empty(len(dataframe['close'])) * np.nan]\r\n    bullish_divergences = np.empty(len(dataframe['close'])) * np.nan\r\n    low_iterator = []\r\n    high_iterator = []\r\n\r\n    for index, row in enumerate(dataframe.itertuples(index=True, name='Pandas')):\r\n        if np.isnan(row.pivot_lows):\r\n            low_iterator.append(0 if len(low_iterator) == 0 else low_iterator[-1])\r\n        else:\r\n            low_iterator.append(index)\r\n        if np.isnan(row.pivot_highs):\r\n            high_iterator.append(0 if len(high_iterator) == 0 else high_iterator[-1])\r\n        else:\r\n            high_iterator.append(index)\r\n\r\n    for index, row in enumerate(dataframe.itertuples(index=True, name='Pandas')):\r\n\r\n        bearish_occurence = bearish_divergence_finder(dataframe,\r\n            dataframe[indicator_source],\r\n            high_iterator,\r\n            index)\r\n\r\n        if bearish_occurence != None:\r\n            (prev_pivot , current_pivot) = bearish_occurence \r\n            bearish_prev_pivot = dataframe['close'][prev_pivot]\r\n            bearish_current_pivot = dataframe['close'][current_pivot]\r\n            bearish_ind_prev_pivot = dataframe[indicator_source][prev_pivot]\r\n            bearish_ind_current_pivot = dataframe[indicator_source][current_pivot]\r\n            length = current_pivot - prev_pivot\r\n            bearish_lines_index = 0\r\n            can_exist = True\r\n            while(True):\r\n                can_draw = True\r\n                if bearish_lines_index <= len(bearish_lines):\r\n                    bearish_lines.append(np.empty(len(dataframe['close'])) * np.nan)\r\n                actual_bearish_lines = bearish_lines[bearish_lines_index]\r\n                for i in range(length + 1):\r\n                    point = bearish_prev_pivot + (bearish_current_pivot - bearish_prev_pivot) * i / length\r\n                    indicator_point =  bearish_ind_prev_pivot + (bearish_ind_current_pivot - bearish_ind_prev_pivot) * i / length\r\n                    if i != 0 and i != length:\r\n                        if (point <= dataframe['close'][prev_pivot + i] \r\n                        or indicator_point <= dataframe[indicator_source][prev_pivot + i]):\r\n                            can_exist = False\r\n                    if not np.isnan(actual_bearish_lines[prev_pivot + i]):\r\n                        can_draw = False\r\n                if not can_exist:\r\n                    break\r\n                if can_draw:\r\n                    for i in range(length + 1):\r\n                        actual_bearish_lines[prev_pivot + i] = bearish_prev_pivot + (bearish_current_pivot - bearish_prev_pivot) * i / length\r\n                    break\r\n                bearish_lines_index = bearish_lines_index + 1\r\n            if can_exist:\r\n                bearish_divergences[index] = row.close\r\n                dataframe[\"total_bearish_divergences\"][index] = row.close\r\n                if index > 30:\r\n                    dataframe[\"total_bearish_divergences_count\"][index-30] = dataframe[\"total_bearish_divergences_count\"][index-30] + 1\r\n                    dataframe[\"total_bearish_divergences_names\"][index-30] = dataframe[\"total_bearish_divergences_names\"][index-30] + indicator_source.upper() + '<br>'\r\n\r\n        bullish_occurence = bullish_divergence_finder(dataframe,\r\n            dataframe[indicator_source],\r\n            low_iterator,\r\n            index)\r\n        \r\n        if bullish_occurence != None:\r\n            (prev_pivot , current_pivot) = bullish_occurence\r\n            bullish_prev_pivot = dataframe['close'][prev_pivot]\r\n            bullish_current_pivot = dataframe['close'][current_pivot]\r\n            bullish_ind_prev_pivot = dataframe[indicator_source][prev_pivot]\r\n            bullish_ind_current_pivot = dataframe[indicator_source][current_pivot]\r\n            length = current_pivot - prev_pivot\r\n            bullish_lines_index = 0\r\n            can_exist = True\r\n            while(True):\r\n                can_draw = True\r\n                if bullish_lines_index <= len(bullish_lines):\r\n                    bullish_lines.append(np.empty(len(dataframe['close'])) * np.nan)\r\n                actual_bullish_lines = bullish_lines[bullish_lines_index]\r\n                for i in range(length + 1):\r\n                    point = bullish_prev_pivot + (bullish_current_pivot - bullish_prev_pivot) * i / length\r\n                    indicator_point =  bullish_ind_prev_pivot + (bullish_ind_current_pivot - bullish_ind_prev_pivot) * i / length\r\n                    if i != 0 and i != length:\r\n                        if (point >= dataframe['close'][prev_pivot + i] \r\n                        or indicator_point >= dataframe[indicator_source][prev_pivot + i]):\r\n                            can_exist = False\r\n                    if not np.isnan(actual_bullish_lines[prev_pivot + i]):\r\n                        can_draw = False\r\n                if not can_exist:\r\n                    break\r\n                if can_draw:\r\n                    for i in range(length + 1):\r\n                        actual_bullish_lines[prev_pivot + i] = bullish_prev_pivot + (bullish_current_pivot - bullish_prev_pivot) * i / length\r\n                    break\r\n                bullish_lines_index = bullish_lines_index + 1\r\n            if can_exist:\r\n                bullish_divergences[index] = row.close\r\n                dataframe[\"total_bullish_divergences\"][index] = row.close\r\n                if index > 30:\r\n                    dataframe[\"total_bullish_divergences_count\"][index-30] = dataframe[\"total_bullish_divergences_count\"][index-30] + 1\r\n                    dataframe[\"total_bullish_divergences_names\"][index-30] = dataframe[\"total_bullish_divergences_names\"][index-30] + indicator_source.upper() + '<br>'\r\n    \r\n    return (bearish_divergences, bearish_lines, bullish_divergences, bullish_lines)\r\n\r\ndef bearish_divergence_finder(dataframe, indicator, high_iterator, index):\r\n    if high_iterator[index] == index:\r\n        current_pivot = high_iterator[index]\r\n        occurences = list(dict.fromkeys(high_iterator))\r\n        current_index = occurences.index(high_iterator[index])\r\n        for i in range(current_index-1,current_index-6,-1):            \r\n            prev_pivot = occurences[i]\r\n            if np.isnan(prev_pivot):\r\n                return\r\n            if ((dataframe['pivot_highs'][current_pivot] < dataframe['pivot_highs'][prev_pivot] and indicator[current_pivot] > indicator[prev_pivot])\r\n            or (dataframe['pivot_highs'][current_pivot] > dataframe['pivot_highs'][prev_pivot] and indicator[current_pivot] < indicator[prev_pivot])):\r\n                return (prev_pivot , current_pivot)\r\n    return None\r\n\r\ndef bullish_divergence_finder(dataframe, indicator, low_iterator, index):\r\n    if low_iterator[index] == index:\r\n        current_pivot = low_iterator[index]\r\n        occurences = list(dict.fromkeys(low_iterator))\r\n        current_index = occurences.index(low_iterator[index])\r\n        for i in range(current_index-1,current_index-6,-1):\r\n            prev_pivot = occurences[i]\r\n            if np.isnan(prev_pivot):\r\n                return \r\n            if ((dataframe['pivot_lows'][current_pivot] < dataframe['pivot_lows'][prev_pivot] and indicator[current_pivot] > indicator[prev_pivot])\r\n            or (dataframe['pivot_lows'][current_pivot] > dataframe['pivot_lows'][prev_pivot] and indicator[current_pivot] < indicator[prev_pivot])):\r\n                return (prev_pivot, current_pivot)\r\n    return None\r\n\r\nfrom enum import Enum\r\nclass PivotSource(Enum):\r\n    HighLow = 0\r\n    Close = 1\r\n\r\ndef pivot_points(dataframe: DataFrame, window: int = 5, pivot_source: PivotSource = PivotSource.Close) -> DataFrame:\r\n    high_source = None\r\n    low_source = None\r\n\r\n    if pivot_source == PivotSource.Close:\r\n        high_source = 'close'\r\n        low_source = 'close'\r\n    elif pivot_source == PivotSource.HighLow:\r\n        high_source = 'high'\r\n        low_source = 'low'\r\n\r\n    pivot_points_lows = np.empty(len(dataframe['close'])) * np.nan\r\n    pivot_points_highs = np.empty(len(dataframe['close'])) * np.nan\r\n    last_values = deque()\r\n    \r\n    # find pivot points\r\n    for index, row in enumerate(dataframe.itertuples(index=True, name='Pandas')):\r\n        last_values.append(row)\r\n        if len(last_values) >= window * 2 + 1:\r\n            current_value = last_values[window]\r\n            is_greater = True\r\n            is_less = True\r\n            for window_index in range(0, window):\r\n                left = last_values[window_index]\r\n                right = last_values[2 * window - window_index]\r\n                local_is_greater, local_is_less = check_if_pivot_is_greater_or_less(current_value, high_source, low_source, left, right)\r\n                is_greater &= local_is_greater\r\n                is_less &= local_is_less\r\n            if is_greater:\r\n                pivot_points_highs[index - window] = getattr(current_value, high_source)\r\n            if is_less:\r\n                pivot_points_lows[index - window] = getattr(current_value, low_source)\r\n            last_values.popleft()\r\n   \r\n    # find last one\r\n    if len(last_values) >= window + 2:\r\n        current_value = last_values[-2]\r\n        is_greater = True\r\n        is_less = True\r\n        for window_index in range(0, window):\r\n            left = last_values[-2 - window_index - 1]\r\n            right = last_values[-1]\r\n            local_is_greater, local_is_less = check_if_pivot_is_greater_or_less(current_value, high_source, low_source, left, right)\r\n            is_greater &= local_is_greater\r\n            is_less &= local_is_less\r\n        if is_greater:\r\n            pivot_points_highs[index - 1] = getattr(current_value, high_source)\r\n        if is_less:\r\n            pivot_points_lows[index - 1] = getattr(current_value, low_source)\r\n\r\n    return pd.DataFrame(index=dataframe.index, data={\r\n        'pivot_lows': pivot_points_lows,\r\n        'pivot_highs': pivot_points_highs\r\n    })\r\n\r\ndef check_if_pivot_is_greater_or_less(current_value, high_source: str, low_source: str, left, right) -> Tuple[bool, bool]:\r\n    is_greater = True\r\n    is_less = True\r\n    if (getattr(current_value, high_source) < getattr(left, high_source) or\r\n        getattr(current_value, high_source) < getattr(right, high_source)):\r\n        is_greater = False\r\n\r\n    if (getattr(current_value, low_source) > getattr(left, low_source) or\r\n        getattr(current_value, low_source) > getattr(right, low_source)):\r\n        is_less = False\r\n    return (is_greater, is_less)\r\n\r\ndef emaKeltner(dataframe):\r\n    keltner = {}\r\n    atr = qtpylib.atr(dataframe, window=10)\r\n    ema20 = ta.EMA(dataframe, timeperiod=20)\r\n    keltner['upper'] = ema20 + atr\r\n    keltner['mid'] = ema20\r\n    keltner['lower'] = ema20 - atr\r\n    return keltner\r\n\r\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\r\n    \"\"\"Chaikin Money Flow (CMF)\r\n    It measures the amount of Money Flow Volume over a specific period.\r\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\r\n    Args:\r\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\r\n        n(int): n period.\r\n        fillna(bool): if True, fill nan values.\r\n    Returns:\r\n        pandas.Series: New feature generated.\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\r\n    mfv = mfv.fillna(0.0)  # float division by zero\r\n    mfv *= df['volume']\r\n    cmf = (mfv.rolling(n, min_periods=0).sum()\r\n           / df['volume'].rolling(n, min_periods=0).sum())\r\n    if fillna:\r\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\r\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/Heracles/Heracles.py",
    "content": "# Heracles Strategy: Strongest Son of GodStra\n# ( With just 1 Genome! its a bacteria :D )\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# IMPORTANT:Add to your pairlists inside config.json (Under StaticPairList):\n#   {\n#       \"method\": \"AgeFilter\",\n#       \"min_days_listed\": 100\n#   },\n# IMPORTANT: INSTALL TA BEFOUR RUN(pip install ta)\n# ######################################################################\n# Optimal config settings:\n# \"max_open_trades\": 100,\n# \"stake_amount\": \"unlimited\",\n\n# --- Do not remove these libs ---\nimport logging\n\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n# Add your lib to import here\n# import talib.abstract as ta\nimport pandas as pd\nimport ta\nfrom ta.utils import dropna\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\nimport numpy as np\n\n\nclass Heracles(IStrategy):\n    # 65/600:   2275 trades. 1438/7/830 W/D/L.\n    # Avg profit   3.10%. Median profit   3.06%.\n    # Total profit  113171 USDT ( 7062 Σ%).\n    # Avg duration 345 min. Objective: -23.0\n\n    # Buy hyperspace params:\n    buy_params = {\n        'buy-cross-0': 'volatility_kcw',\n        'buy-indicator-0': 'volatility_dcp',\n        'buy-oper-0': '<',\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-cross-0': 'trend_macd_signal',\n        'sell-indicator-0': 'trend_ema_fast',\n        'sell-oper-0': '=',\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.32836,\n        \"1629\": 0.17896,\n        \"6302\": 0.05372,\n        \"10744\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.04655\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.02444\n    trailing_stop_positive_offset = 0.04406\n    trailing_only_offset_is_reached = True\n\n    # Buy hypers\n    timeframe = '12h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Add all ta features\n        dataframe = dropna(dataframe)\n\n        dataframe['volatility_kcw'] = ta.volatility.keltner_channel_wband(\n            dataframe['high'],\n            dataframe['low'],\n            dataframe['close'],\n            window=20,\n            window_atr=10,\n            fillna=False,\n            original_version=True\n        )\n        dataframe['volatility_dcp'] = ta.volatility.donchian_channel_pband(\n            dataframe['high'],\n            dataframe['low'],\n            dataframe['close'],\n            window=10,\n            offset=0,\n            fillna=False\n        )\n        dataframe['trend_macd_signal'] = ta.trend.macd_signal(\n            dataframe['close'],\n            window_slow=26,\n            window_fast=12,\n            window_sign=9,\n            fillna=False\n        )\n\n        dataframe['trend_ema_fast'] = ta.trend.EMAIndicator(\n            close=dataframe['close'], window=12, fillna=False\n        ).ema_indicator()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        IND = self.buy_params['buy-indicator-0']\n        CRS = self.buy_params['buy-cross-0']\n        DFIND = dataframe[IND]\n        DFCRS = dataframe[CRS]\n\n        dataframe.loc[\n            (DFIND < DFCRS),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        IND = self.sell_params['sell-indicator-0']\n        CRS = self.sell_params['sell-cross-0']\n\n        DFIND = dataframe[IND]\n        DFCRS = dataframe[CRS]\n\n        dataframe.loc[\n            (qtpylib.crossed_below(DFIND, DFCRS)),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/HourBasedStrategy/HourBasedStrategy.py",
    "content": "# Hour Strategy\n# In this strategy we try to find the best hours to buy and sell in a day.(in hourly timeframe)\n# Because of that you should just use 1h timeframe on this strategy.\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# Requires hyperopt before running.\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --strategy HourBasedStrategy -e 200\n\n\nfrom freqtrade.strategy import IntParameter, IStrategy\nfrom pandas import DataFrame\n\n# --------------------------------\n# Add your lib to import here\n# No need to These imports. just for who want to add more conditions:\n# import talib.abstract as ta\n# import freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass HourBasedStrategy(IStrategy):\n    # SHIB/USDT, 1000$x1:100days\n    # 158/1000:     51 trades. 29/19/3 Wins/Draws/Losses. Avg profit   4.02%. Median profit   2.48%. Total profit  4867.53438466 USDT ( 486.75%). Avg duration 1 day, 19:38:00 min. Objective: -4.17276\n    # buy_params = {\"buy_hour_max\": 18,\"buy_hour_min\": 7,}\n    # sell_params = {\"sell_hour_max\": 9,\"sell_hour_min\": 21,}\n    # minimal_roi = {\"0\": 0.18,\"171\": 0.155,\"315\": 0.075,\"1035\": 0}\n    # stoploss = -0.292\n\n    # SHIB/USDT, 1000$x1:100days\n    # 36/1000:    113 trades. 55/14/44 Wins/Draws/Losses. Avg profit   2.06%. Median profit   0.00%. Total profit  5126.14785426 USDT ( 512.61%). Avg duration 16:48:00 min. Objective: -4.57837\n    # buy_params = {\"buy_hour_max\": 21,\"buy_hour_min\": 6,}\n    # sell_params = {\"sell_hour_max\": 6,\"sell_hour_min\": 4,}\n    # minimal_roi = {\"0\": 0.247,\"386\": 0.186,\"866\": 0.052,\"1119\": 0}\n    # stoploss = -0.302\n\n    # SAND/USDT, 1000$x1:100days\n    # 72/1000:    158 trades. 67/13/78 Wins/Draws/Losses. Avg profit   1.37%. Median profit   0.00%. Total profit  4274.73622346 USDT ( 427.47%). Avg duration 13:50:00 min. Objective: -4.87331\n    # buy_params = {\"buy_hour_max\": 23,\"buy_hour_min\": 4,}\n    # sell_params = {\"sell_hour_max\": 23,\"sell_hour_min\": 3,}\n    # minimal_roi = {\"0\": 0.482,\"266\": 0.191,\"474\": 0.09,\"1759\": 0}\n    # stoploss = -0.05\n\n    # KDA/USDT, 1000$x1:100days\n    # 7/1000:     65 trades. 40/23/2 Wins/Draws/Losses. Avg profit   6.42%. Median profit   7.59%. Total profit  41120.00939125 USDT ( 4112.00%). Avg duration 1 day, 9:40:00 min. Objective: -8.46089\n    # buy_params = {\"buy_hour_max\": 22,\"buy_hour_min\": 9,}\n    # sell_params = {\"sell_hour_max\": 1,\"sell_hour_min\": 7,}\n    # minimal_roi = {\"0\": 0.517,\"398\": 0.206,\"1003\": 0.076,\"1580\": 0}\n    # stoploss = -0.338\n\n    # {KDA/USDT, BTC/USDT, DOGE/USDT, SAND/USDT, ETH/USDT, SOL/USDT}, 1000$x1:100days, ShuffleFilter42\n    # 56/1000:     63 trades. 41/19/3 Wins/Draws/Losses. Avg profit   4.60%. Median profit   8.89%. Total profit  11596.50333022 USDT ( 1159.65%). Avg duration 1 day, 14:46:00 min. Objective: -5.76694\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_hour_max\": 24,\n        \"buy_hour_min\": 4,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_hour_max\": 21,\n        \"sell_hour_min\": 22,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.528,\n        \"169\": 0.113,\n        \"528\": 0.089,\n        \"1837\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.10\n\n    # Optimal timeframe\n    timeframe = '1h'\n\n    buy_hour_min = IntParameter(0, 24, default=1, space='buy')\n    buy_hour_max = IntParameter(0, 24, default=0, space='buy')\n\n    sell_hour_min = IntParameter(0, 24, default=1, space='sell')\n    sell_hour_max = IntParameter(0, 24, default=0, space='sell')\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['hour'] = dataframe['date'].dt.hour\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        min, max = self.buy_hour_min.value, self.buy_hour_max.value\n        dataframe.loc[\n            (\n                (dataframe['hour'].between(min, max))\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        min, max = self.sell_hour_min.value, self.sell_hour_max.value\n        dataframe.loc[\n            (\n                (dataframe['hour'].between(min, max))\n            ),\n            'buy'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/HyperStra_GSN_SMAOnly/HyperStra_GSN_SMAOnly.py",
    "content": "from logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter, BooleanParameter\nimport technical.indicators as ftt\n\nfrom talib import abstract\n\n# ###############################################################################\n# ###############################################################################\n# @Farhad#0318\n# Idea is from GodStraNew_SMAOnly\n# ###############################################################################\n# ###############################################################################\n\n# MA Indicator ( EMA, SMA, MA, ... )\nMA_Indicator = abstract.SMA\n\nclass HyperStra_GSN_SMAOnly(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ##################################################################\n    # Hyperopt Params Paste Here\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_1_indicator\": 5,\n        \"buy_1_indicator_sec\": 110,\n        \"buy_1_operator\": \"normalized_devided_smaller_n\",\n        \"buy_1_real_number\": 0.3,\n\n        \"buy_2_indicator\": 5,\n        \"buy_2_indicator_sec\": 6,\n        \"buy_2_operator\": \"normalized_smaller_n\",\n        \"buy_2_real_number\": 0.5,\n\n        \"buy_3_indicator\": 55,\n        \"buy_3_indicator_sec\": 100,\n        \"buy_3_operator\": \"normalized_devided_smaller_n\",\n        \"buy_3_real_number\": 0.9,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_1_indicator\": 50,\n        \"sell_1_indicator_sec\": 15,\n        \"sell_1_operator\": \"equal\",\n        \"sell_1_real_number\": 0.9,\n\n        \"sell_2_indicator\": 50,\n        \"sell_2_indicator_sec\": 110,\n        \"sell_2_operator\": \"cross_above\",\n        \"sell_2_real_number\": 0.5,\n\n        \"sell_3_indicator\": 110,\n        \"sell_3_indicator_sec\": 5,\n        \"sell_3_operator\": \"below\",\n        \"sell_3_real_number\": 0.8,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.288,\n        \"81\": 0.101,\n        \"170\": 0.049,\n        \"491\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.05\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.016\n    trailing_only_offset_is_reached = True\n\n    # ##################################################################\n    # ##################################################################\n\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"StoplossGuard\",\n                \"lookback_period_candles\": 2,\n                \"trade_limit\": 1,\n                \"stop_duration_candles\": 12,\n                \"only_per_pair\": False\n            },\n            {\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration_candles\": 2\n            }\n        ]\n\n    # ##################################################################\n    # ##################################################################\n\n    # Sell signal\n    use_custom_stoploss = False\n    use_sell_signal = True\n    timeframe = '5m'\n    ignore_roi_if_buy_signal = False\n    process_only_new_candles = False\n    startup_candle_count = 440\n\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n\n    # ##################################################################\n    # ##################################################################\n\n    # #################################\n    # Optimiztions HyperSMA BUY\n    optimize_hypersma_buy_1_1_sma = True\n    optimize_hypersma_buy_1_2_sma = True\n    optimize_hypersma_buy_1_3_sma = True\n\n    # #################################\n    # Optimiztions HyperSMA Sell\n    optimize_hypersma_sell_1_1_sma = True\n    optimize_hypersma_sell_1_2_sma = True\n    optimize_hypersma_sell_1_3_sma = True\n\n    # ##################################################################\n    # ##################################################################\n\n    sma_timeperiods = [5, 6, 15, 50, 55, 100, 110]\n    sma_operators = [\n        'equal',\n        'above',\n        'below',\n        'cross_above',\n        'cross_below',\n        'divide_greater',\n        'divide_smaller',\n        'normalized_equal_n',\n        'normalized_smaller_n',\n        'normalized_bigger_n',\n        'normalized_devided_equal_n',\n        'normalized_devided_smaller_n',\n        'normalized_devided_bigger_n'\n    ]\n\n    # ##################################################################\n    # ##################################################################\n    # HyperSMA\n\n    # normalizer_lenght = IntParameter(low=1, high=400, default=20, space='buy', optimize=True)\n\n    # BUY\n    buy_1_indicator = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_1_indicator'], space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n    buy_1_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_1_indicator_sec'], space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n    buy_1_real_number = DecimalParameter(low=0, high=0.99, default=buy_params['buy_1_real_number'], decimals=2, space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n    buy_1_operator = CategoricalParameter(categories=sma_operators, default=buy_params['buy_1_operator'], space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n\n    buy_2_indicator = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_2_indicator'], space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n    buy_2_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_2_indicator_sec'], space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n    buy_2_real_number = DecimalParameter(low=0, high=0.99, default=buy_params['buy_2_real_number'], decimals=2, space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n    buy_2_operator = CategoricalParameter(categories=sma_operators, default=buy_params['buy_2_operator'], space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n\n    buy_3_indicator = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_3_indicator'], space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n    buy_3_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_3_indicator_sec'], space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n    buy_3_real_number = DecimalParameter(low=0, high=0.99, default=buy_params['buy_3_real_number'], decimals=2, space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n    buy_3_operator = CategoricalParameter(categories=sma_operators, default=buy_params['buy_3_operator'], space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n\n    # SELL\n    sell_1_indicator = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_1_indicator'], space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n    sell_1_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_1_indicator_sec'], space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n    sell_1_real_number = DecimalParameter(low=0, high=0.99, default=sell_params['sell_1_real_number'], decimals=2, space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n    sell_1_operator = CategoricalParameter(categories=sma_operators, default=sell_params['sell_1_operator'], space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n\n    sell_2_indicator = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_2_indicator'], space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n    sell_2_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_2_indicator_sec'], space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n    sell_2_real_number = DecimalParameter(low=0, high=0.99, default=sell_params['sell_2_real_number'], decimals=2, space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n    sell_2_operator = CategoricalParameter(categories=sma_operators, default=sell_params['sell_2_operator'], space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n\n    sell_3_indicator = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_3_indicator'], space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n    sell_3_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_3_indicator_sec'], space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n    sell_3_real_number = DecimalParameter(low=0, high=0.99, default=sell_params['sell_3_real_number'], decimals=2, space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n    sell_3_operator = CategoricalParameter(categories=sma_operators, default=sell_params['sell_3_operator'], space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n\n    # ##################################################################\n    # HyperSMA\n    # ##################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # ###############################\n        # Multi SMA\n        for m_timeperiod in self.sma_timeperiods:\n            dataframe[f'ma_{m_timeperiod}'] = MA_Indicator(dataframe, timeperiod=m_timeperiod)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                    (dataframe['volume'] > 0) &\n                    (\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.buy_1_indicator.value,\n                                                     indicator_sec=self.buy_1_indicator_sec.value,\n                                                     real_number=self.buy_1_real_number.value,\n                                                     operator=self.buy_1_operator.value, option='buy')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.buy_2_indicator.value,\n                                                     indicator_sec=self.buy_2_indicator_sec.value,\n                                                     real_number=self.buy_2_real_number.value,\n                                                     operator=self.buy_2_operator.value, option='buy')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.buy_3_indicator.value,\n                                                     indicator_sec=self.buy_3_indicator_sec.value,\n                                                     real_number=self.buy_3_real_number.value,\n                                                     operator=self.buy_3_operator.value, option='buy')\n                            )\n                    )\n            )\n        )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                    (dataframe['volume'] > 0) &\n                    (\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.sell_1_indicator.value, indicator_sec=self.sell_1_indicator_sec.value,\n                                                     real_number=self.sell_1_real_number.value,\n                                                     operator=self.sell_1_operator.value, option='sell')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.sell_2_indicator.value, indicator_sec=self.sell_2_indicator_sec.value,\n                                                     real_number=self.sell_2_real_number.value,\n                                                     operator=self.sell_2_operator.value, option='sell')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.sell_3_indicator.value, indicator_sec=self.sell_3_indicator_sec.value,\n                                                     real_number=self.sell_3_real_number.value,\n                                                     operator=self.sell_3_operator.value, option='sell')\n                            )\n                    )\n            )\n        )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'sell'] = 1\n        return dataframe\n\n    def condition_maker(self, dataframe: DataFrame, indicator: int, indicator_sec: int, real_number: float, operator: str, option: str):\n        indicator_1 = f'ma_{indicator}'\n        indicator_2 = f'ma_{indicator_sec}'\n\n        if operator == 'equal':\n            return dataframe[indicator_1] == dataframe[indicator_2]\n\n        if operator == 'above':\n            return dataframe[indicator_1] >= dataframe[indicator_2]\n\n        if operator == 'below':\n            return dataframe[indicator_1] <= dataframe[indicator_2]\n\n        if operator == 'cross_above':\n            return qtpylib.crossed_above(dataframe[indicator_1], dataframe[indicator_2])\n\n        if operator == 'cross_below':\n            return qtpylib.crossed_below(dataframe[indicator_1], dataframe[indicator_2])\n\n        if operator == 'divide_greater':\n            return dataframe[indicator_1].div(dataframe[indicator_2]) <= real_number\n\n        if operator == 'divide_smaller':\n            return dataframe[indicator_1].div(dataframe[indicator_2]) >= real_number\n\n        if operator == 'normalized_equal_n':\n            return Normalizer(dataframe[indicator_1]) == real_number\n\n        if operator == 'normalized_smaller_n':\n            return Normalizer(dataframe[indicator_1]) < real_number\n\n        if operator == 'normalized_bigger_n':\n            return Normalizer(dataframe[indicator_1]) > real_number\n\n        if operator == 'normalized_devided_equal_n':\n            return (Normalizer(dataframe[indicator_1]).div(Normalizer(dataframe[indicator_2]))) == real_number\n\n        if operator == 'normalized_devided_smaller_n':\n            return (Normalizer(dataframe[indicator_1]).div(Normalizer(dataframe[indicator_2]))) < real_number\n\n        if operator == 'normalized_devided_bigger_n':\n            return (Normalizer(dataframe[indicator_1]).div(Normalizer(dataframe[indicator_2]))) > real_number\n\n\n# ##################################################################\n# Methods\n# ##################################################################\n\ndef Normalizer(df: DataFrame) -> DataFrame:\n    df = (df - df.min()) / (df.max() - df.min())\n    return df\n"
  },
  {
    "path": "strategies/HyperStra_SMAOnly/HyperStra_SMAOnly.py",
    "content": "from logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter, BooleanParameter\nimport technical.indicators as ftt\n\nfrom talib import abstract\n\n# ###############################################################################\n# ###############################################################################\n# @Farhad#0318\n# Idea is from GodStraNew_SMAOnly\n# ###############################################################################\n# ###############################################################################\n\n# MA Indicator ( EMA, SMA, MA, ... )\nMA_Indicator = abstract.SMA\n\n\nclass HyperStra_SMAOnly(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ##################################################################\n    # Hyperopt Params Paste Here\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_1_indicator\": 5,\n        \"buy_1_indicator_sec\": 110,\n        \"buy_1_operator\": \"normalized_devided_smaller_n\",\n        \"buy_1_real_number\": 0.3,\n\n        \"buy_2_indicator\": 5,\n        \"buy_2_indicator_sec\": 6,\n        \"buy_2_operator\": \"normalized_smaller_n\",\n        \"buy_2_real_number\": 0.5,\n\n        \"buy_3_indicator\": 55,\n        \"buy_3_indicator_sec\": 100,\n        \"buy_3_operator\": \"normalized_devided_smaller_n\",\n        \"buy_3_real_number\": 0.9,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_1_indicator\": 50,\n        \"sell_1_indicator_sec\": 15,\n        \"sell_1_operator\": \"equal\",\n        \"sell_1_real_number\": 0.9,\n\n        \"sell_2_indicator\": 50,\n        \"sell_2_indicator_sec\": 110,\n        \"sell_2_operator\": \"cross_above\",\n        \"sell_2_real_number\": 0.5,\n\n        \"sell_3_indicator\": 110,\n        \"sell_3_indicator_sec\": 5,\n        \"sell_3_operator\": \"below\",\n        \"sell_3_real_number\": 0.8,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.288,\n        \"81\": 0.101,\n        \"170\": 0.049,\n        \"491\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.05\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.016\n    trailing_only_offset_is_reached = True\n\n    # ##################################################################\n    # ##################################################################\n\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"StoplossGuard\",\n                \"lookback_period_candles\": 2,\n                \"trade_limit\": 1,\n                \"stop_duration_candles\": 12,\n                \"only_per_pair\": False\n            },\n            {\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration_candles\": 2\n            }\n        ]\n\n    # ##################################################################\n    # ##################################################################\n\n    # Sell signal\n    use_custom_stoploss = False\n    use_sell_signal = True\n    timeframe = '5m'\n    ignore_roi_if_buy_signal = False\n    process_only_new_candles = False\n    startup_candle_count = 440\n\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n\n    # ##################################################################\n    # ##################################################################\n\n    # #################################\n    # Optimiztions HyperSMA BUY\n    optimize_hypersma_buy_1_1_sma = True\n    optimize_hypersma_buy_1_2_sma = True\n    optimize_hypersma_buy_1_3_sma = True\n\n    # #################################\n    # Optimiztions HyperSMA Sell\n    optimize_hypersma_sell_1_1_sma = True\n    optimize_hypersma_sell_1_2_sma = True\n    optimize_hypersma_sell_1_3_sma = True\n\n    # ##################################################################\n    # ##################################################################\n\n    sma_timeperiods = [5, 6, 15, 50, 55, 100, 110]\n    sma_operators = [\n        'equal',\n        'above',\n        'below',\n        'cross_above',\n        'cross_below',\n        'divide_greater',\n        'divide_smaller',\n        'normalized_equal_n',\n        'normalized_smaller_n',\n        'normalized_bigger_n',\n        'normalized_devided_equal_n',\n        'normalized_devided_smaller_n',\n        'normalized_devided_bigger_n'\n    ]\n\n    # ##################################################################\n    # ##################################################################\n    # HyperSMA\n\n    # normalizer_lenght = IntParameter(low=1, high=400, default=20, space='buy', optimize=True)\n\n    # BUY\n    buy_1_indicator = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_1_indicator'], space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n    buy_1_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_1_indicator_sec'], space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n    buy_1_real_number = DecimalParameter(low=0, high=0.99, default=buy_params['buy_1_real_number'], decimals=2, space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n    buy_1_operator = CategoricalParameter(categories=sma_operators, default=buy_params['buy_1_operator'], space='buy', optimize=optimize_hypersma_buy_1_1_sma)\n\n    buy_2_indicator = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_2_indicator'], space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n    buy_2_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_2_indicator_sec'], space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n    buy_2_real_number = DecimalParameter(low=0, high=0.99, default=buy_params['buy_2_real_number'], decimals=2, space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n    buy_2_operator = CategoricalParameter(categories=sma_operators, default=buy_params['buy_2_operator'], space='buy', optimize=optimize_hypersma_buy_1_2_sma)\n\n    buy_3_indicator = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_3_indicator'], space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n    buy_3_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=buy_params['buy_3_indicator_sec'], space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n    buy_3_real_number = DecimalParameter(low=0, high=0.99, default=buy_params['buy_3_real_number'], decimals=2, space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n    buy_3_operator = CategoricalParameter(categories=sma_operators, default=buy_params['buy_3_operator'], space='buy', optimize=optimize_hypersma_buy_1_3_sma)\n\n    # SELL\n    sell_1_indicator = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_1_indicator'], space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n    sell_1_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_1_indicator_sec'], space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n    sell_1_real_number = DecimalParameter(low=0, high=0.99, default=sell_params['sell_1_real_number'], decimals=2, space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n    sell_1_operator = CategoricalParameter(categories=sma_operators, default=sell_params['sell_1_operator'], space='sell', optimize=optimize_hypersma_sell_1_1_sma)\n\n    sell_2_indicator = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_2_indicator'], space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n    sell_2_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_2_indicator_sec'], space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n    sell_2_real_number = DecimalParameter(low=0, high=0.99, default=sell_params['sell_2_real_number'], decimals=2, space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n    sell_2_operator = CategoricalParameter(categories=sma_operators, default=sell_params['sell_2_operator'], space='sell', optimize=optimize_hypersma_sell_1_2_sma)\n\n    sell_3_indicator = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_3_indicator'], space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n    sell_3_indicator_sec = CategoricalParameter(categories=sma_timeperiods, default=sell_params['sell_3_indicator_sec'], space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n    sell_3_real_number = DecimalParameter(low=0, high=0.99, default=sell_params['sell_3_real_number'], decimals=2, space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n    sell_3_operator = CategoricalParameter(categories=sma_operators, default=sell_params['sell_3_operator'], space='sell', optimize=optimize_hypersma_sell_1_3_sma)\n\n    # ##################################################################\n    # HyperSMA\n    # ##################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # ###############################\n        # Multi SMA\n        for m_timeperiod in self.sma_timeperiods:\n            dataframe[f'ma_{m_timeperiod}'] = MA_Indicator(dataframe, timeperiod=m_timeperiod)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                    (dataframe['volume'] > 0) &\n                    (\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.buy_1_indicator.value,\n                                                     indicator_sec=self.buy_1_indicator_sec.value,\n                                                     real_number=self.buy_1_real_number.value,\n                                                     operator=self.buy_1_operator.value, option='buy')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.buy_2_indicator.value,\n                                                     indicator_sec=self.buy_2_indicator_sec.value,\n                                                     real_number=self.buy_2_real_number.value,\n                                                     operator=self.buy_2_operator.value, option='buy')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.buy_3_indicator.value,\n                                                     indicator_sec=self.buy_3_indicator_sec.value,\n                                                     real_number=self.buy_3_real_number.value,\n                                                     operator=self.buy_3_operator.value, option='buy')\n                            )\n                    )\n            )\n        )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                    (dataframe['volume'] > 0) &\n                    (\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.sell_1_indicator.value, indicator_sec=self.sell_1_indicator_sec.value,\n                                                     real_number=self.sell_1_real_number.value,\n                                                     operator=self.sell_1_operator.value, option='sell')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.sell_2_indicator.value, indicator_sec=self.sell_2_indicator_sec.value,\n                                                     real_number=self.sell_2_real_number.value,\n                                                     operator=self.sell_2_operator.value, option='sell')\n                            )\n                            &\n                            (\n                                self.condition_maker(dataframe=dataframe,\n                                                     indicator=self.sell_3_indicator.value, indicator_sec=self.sell_3_indicator_sec.value,\n                                                     real_number=self.sell_3_real_number.value,\n                                                     operator=self.sell_3_operator.value, option='sell')\n                            )\n                    )\n            )\n        )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), 'sell'] = 1\n        return dataframe\n\n    def condition_maker(self, dataframe: DataFrame, indicator: int, indicator_sec: int, real_number: float, operator: str, option: str):\n        indicator_1 = f'ma_{indicator}'\n        indicator_2 = f'ma_{indicator_sec}'\n\n        if operator == 'equal':\n            return dataframe[indicator_1] == dataframe[indicator_2]\n\n        if operator == 'above':\n            return dataframe[indicator_1] >= dataframe[indicator_2]\n\n        if operator == 'below':\n            return dataframe[indicator_1] <= dataframe[indicator_2]\n\n        if operator == 'cross_above':\n            return qtpylib.crossed_above(dataframe[indicator_1], dataframe[indicator_2])\n\n        if operator == 'cross_below':\n            return qtpylib.crossed_below(dataframe[indicator_1], dataframe[indicator_2])\n\n        if operator == 'divide_greater':\n            return dataframe[indicator_1].div(dataframe[indicator_2]) <= real_number\n\n        if operator == 'divide_smaller':\n            return dataframe[indicator_1].div(dataframe[indicator_2]) >= real_number\n\n        if operator == 'normalized_equal_n':\n            return Normalizer(dataframe[indicator_1]) == real_number\n\n        if operator == 'normalized_smaller_n':\n            return Normalizer(dataframe[indicator_1]) < real_number\n\n        if operator == 'normalized_bigger_n':\n            return Normalizer(dataframe[indicator_1]) > real_number\n\n        if operator == 'normalized_devided_equal_n':\n            return (Normalizer(dataframe[indicator_1]).div(Normalizer(dataframe[indicator_2]))) == real_number\n\n        if operator == 'normalized_devided_smaller_n':\n            return (Normalizer(dataframe[indicator_1]).div(Normalizer(dataframe[indicator_2]))) < real_number\n\n        if operator == 'normalized_devided_bigger_n':\n            return (Normalizer(dataframe[indicator_1]).div(Normalizer(dataframe[indicator_2]))) > real_number\n\n\n# ##################################################################\n# Methods\n# ##################################################################\n\ndef Normalizer(df: DataFrame) -> DataFrame:\n    df = (df - df.min()) / (df.max() - df.min())\n    return df\n"
  },
  {
    "path": "strategies/INSIDEUP/INSIDEUP.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas as pd\nimport pandas_ta as pta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nimport time\nimport warnings\n\n# Custom imports to fetch API data\nimport requests\nimport json\n\n\nclass INSIDEUP(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.237,\n        \"4195\": 0.17,\n        \"7191\": 0.053,\n        \"14695\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.99  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.011  # value loaded from strategy\n    trailing_stop_positive_offset = 0.029  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1d'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Inputs:\n        # # prices: ['open', 'high', 'low', 'close']\n\n        # # Three Inside Up/Down: values [0, -100, 100]\n        dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [-100, 0, 100]\n        # # MORNINGDOJISTAR: values [0, 100]\n        dataframe['CDLMORNINGDOJISTAR'] = ta.CDLMORNINGDOJISTAR(dataframe) # values [0, 100]\n        # # Piercing Line: values [0, 100]\n        dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Three Black Crows: values [-100, 0, 100]\n        dataframe['CDL3BLACKCROWS'] = ta.CDL3BLACKCROWS(dataframe) # values [-100, 0, 100]\n\n        # RSI\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['slowadx'] = ta.ADX(dataframe, 35)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dateTime = datetime.now()\n\n        dataframe.loc[\n            # Check for downtrend movement\n            (\n             (dataframe['close'] < dataframe['close'].shift(2)) |\n             (dataframe['rsi_14'] < 50)\n            ) &\n            (\n             (dataframe['adx'] > 13.0)\n            ) &\n            # Check for patterns\n            (\n                # the user should consider that a three inside up is significant\n                #when it appears in a downtrend\n                (dataframe['CDL3INSIDE'] >= 0).any() # Bullish\n            ),\n            ['buy', 'buy_tag']] = (1, 'buy_3_inside')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        no sell signal\n        \"\"\"\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichess/Ichess.py",
    "content": "# Ichess Strategy  ichimoku_score\n# Associate various ichimoku signals with a score.\n# For example, bullish signal => positive score,\n# and bearish signal => negative score. If the total score is above 0, it may indicate a bullish trend .\n# Otherwise, if it is below 0, it may indicate a bearish trend .\n# We used two smoothed moving averages to find the trend.\n# More info:\n# https://github.com/freqtrade/freqtrade-strategies/issues/97\n# https://www.tradingview.com/script/P1bybHZA-Ichimoku-Cloud-Signal-Score-v2-0-0/\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport numpy as np\n# --------------------------------\n\n# Add your lib to import here\n# import talib.abstract as ta\nimport talib as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\n\nclass Ichess(IStrategy):\n    \n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.642,\n        \"8834\": 0.37,\n        \"25392\": 0.118,\n        \"55146\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.314\n\n    # Opt Timeframe\n    timeframe = '1d'\n\n    buy_fast_timeperiod = IntParameter(2, 50, default=9, space=\"buy\")\n    buy_slow_timeperiod = IntParameter(2, 50, default=10, space=\"buy\")\n\n    sell_fast_timeperiod = IntParameter(2, 50, default=15, space=\"sell\")\n    sell_slow_timeperiod = IntParameter(2, 50, default=16, space=\"sell\")\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conversion_line_period = 9\n        base_line_periods = 26\n        laggin_span = 52\n        displacement = 26\n\n        df = dataframe.copy()\n\n        # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(df)\n        df['ha_open'] = heikinashi['open']\n        df['ha_close'] = heikinashi['close']\n        df['ha_high'] = heikinashi['high']\n        df['ha_low'] = heikinashi['low']\n\n        df['tenkan'] = (df['ha_high'].rolling(window=conversion_line_period).max() +\n                        df['ha_low'].rolling(window=conversion_line_period).min()) / 2\n        df['kijun'] = (df['ha_high'].rolling(window=base_line_periods).max() +\n                       df['ha_low'].rolling(window=base_line_periods).min()) / 2\n        df['senkou_leading_a'] = (df['tenkan'] + df['kijun']) / 2\n        df['senkou_leading_b'] = (df['ha_high'].rolling(\n            window=laggin_span).max() + df['ha_low'].rolling(window=laggin_span).min()) / 2\n        df['senkou_span_a'] = df['senkou_leading_a'].shift(displacement)\n        df['senkou_span_b'] = df['senkou_leading_b'].shift(displacement)\n        df['chikou_span'] = df['ha_close'].shift(displacement)\n\n        df['tenkan1'] = df['tenkan'].shift(+1)\n        df['kijun1'] = df['kijun'].shift(+1)\n        df['senkou_leading_a1'] = df['senkou_leading_a'].shift(+1)\n        df['senkou_leading_b1'] = df['senkou_leading_b'].shift(+1)\n        df['senkou_span_a1'] = df['senkou_span_a'].shift(+1)\n        df['senkou_span_b1'] = df['senkou_span_b'].shift(+1)\n        df['chikou_span1'] = df['chikou_span'].shift(+1)\n\n        df['ha_close1'] = df['ha_close'].shift(+1)\n\n        # // == Price and Kijun Sen (standard line) Cross ==\n\n        def calcTkCross(\n            tenkan,\n            kijun,\n            tenkan1,\n            kijun1,\n            senkou_span_a,\n            senkou_span_b,\n        ):\n            if (tenkan > kijun) and (tenkan1 <= kijun1):\n                intersect = (tenkan1 * (kijun - kijun1) - kijun1 * (tenkan -\n                             tenkan1)) / ((kijun - kijun1) - (tenkan - tenkan1))\n                if (intersect > senkou_span_a) and (intersect > senkou_span_b):\n                    return 2\n                elif(intersect < senkou_span_a) and (intersect < senkou_span_b):\n                    return 0.5\n                else:\n                    return 1\n            elif (tenkan < kijun) and (tenkan1 >= kijun1):\n                intersect = (tenkan1 * (kijun - kijun1) - kijun1 * (tenkan -\n                             tenkan1)) / ((kijun - kijun1) - (tenkan - tenkan1))\n                if (intersect > senkou_span_a) and (intersect > senkou_span_b):\n                    return -0.5\n                elif(intersect < senkou_span_a) and (intersect < senkou_span_b):\n                    return -2\n                else:\n                    return -1\n            else:\n                return 0\n\n        # df['tkCrossScore'] = np.vectorize(calcTkCross)()\n        df['tkCrossScore'] = np.vectorize(calcTkCross)(\n            df['tenkan'],\n            df['kijun'],\n            df['tenkan1'],\n            df['kijun1'],\n            df['senkou_span_a'],\n            df['senkou_span_b'],\n        )\n        # // == Price and Kijun Sen (standard line) Cross ==\n\n        def calcPkCross(\n            ha_close,\n            kijun,\n            ha_close1,\n            kijun1,\n            senkou_span_a,\n            senkou_span_b,\n        ):\n            if (ha_close > kijun) and (ha_close1 <= kijun1):\n                intersect = (ha_close1 * (kijun - kijun1) - kijun1 * (ha_close -\n                             ha_close1)) / ((kijun - kijun1) - (ha_close - ha_close1))\n                if (intersect > senkou_span_a) and (intersect > senkou_span_b):\n                    return 2\n                elif(intersect < senkou_span_a) and (intersect < senkou_span_b):\n                    return 0.5\n                else:\n                    return 1\n            elif (ha_close < kijun) and (ha_close1 >= kijun1):\n                intersect = (ha_close1 * (kijun - kijun1) - kijun1 * (ha_close -\n                             ha_close1)) / ((kijun - kijun1) - (ha_close - ha_close1))\n                if (intersect > senkou_span_a) and (intersect > senkou_span_b):\n                    return -0.5\n                elif(intersect < senkou_span_a) and (intersect < senkou_span_b):\n                    return -2\n                else:\n                    return -1\n            else:\n                return 0\n\n        df['pkCrossScore'] = np.vectorize(calcPkCross)(\n            df['ha_close'],\n            df['kijun'],\n            df['ha_close1'],\n            df['kijun1'],\n            df['senkou_span_a'],\n            df['senkou_span_b'],\n        )\n\n        # // == Kumo Breakouts ==\n        def calcKumoBreakout(\n            ha_close,\n            senkou_span_a,\n            ha_close1,\n            senkou_span_a1,\n            senkou_span_b,\n            senkou_span_b1,\n        ):\n            if (((ha_close > senkou_span_a) and (ha_close1 <= senkou_span_a1) and (senkou_span_a > senkou_span_b)) or ((ha_close > senkou_span_b) and (ha_close1 <= senkou_span_b1) and (senkou_span_a < senkou_span_b))):\n                return 2\n            elif(((ha_close < senkou_span_a) and (ha_close1 >= senkou_span_a1) and (senkou_span_a < senkou_span_b)) or ((ha_close < senkou_span_b) and (ha_close1 >= senkou_span_b1) and (senkou_span_a > senkou_span_b))):\n                return -2\n            else:\n                return 0\n\n        df['kumoBreakoutScore'] = np.vectorize(calcKumoBreakout)(\n            df['ha_close'],\n            df['senkou_span_a'],\n            df['ha_close1'],\n            df['senkou_span_a1'],\n            df['senkou_span_b'],\n            df['senkou_span_b1'],\n        )\n\n        # // == Senkou Span Cross ==\n        def calcSenkouCross(\n            senkou_leading_a,\n            senkou_leading_b,\n            senkou_leading_a1,\n            senkou_leading_b1,\n            ha_close,\n            senkou_span_a,\n            senkou_span_b,\n        ):\n            if (senkou_leading_a > senkou_leading_b) and (senkou_leading_a1 <= senkou_leading_b1):\n                if (ha_close > senkou_span_a) and (ha_close > senkou_span_b):\n                    return 2\n                elif(ha_close < senkou_span_a) and (ha_close < senkou_span_b):\n                    return 0.5\n                else:\n                    return 1\n            elif (senkou_leading_a < senkou_leading_b) and (senkou_leading_a1 >= senkou_leading_b1):\n                if (ha_close > senkou_span_a) and (ha_close > senkou_span_b):\n                    return -0.5\n                elif(ha_close < senkou_span_a) and (ha_close < senkou_span_b):\n                    return -2\n                else:\n                    return -1\n            else:\n                return 0\n\n        df['senkouCrossScore'] = np.vectorize(calcSenkouCross)(\n            df['senkou_leading_a'],\n            df['senkou_leading_b'],\n            df['senkou_leading_a1'],\n            df['senkou_leading_b1'],\n            df['ha_close'],\n            df['senkou_span_a'],\n            df['senkou_span_b'],\n        )\n        # // == Chikou Span Cross ==\n\n        def calcChikouCross(\n            ha_close,\n            chikou_span,\n            ha_close1,\n            chikou_span1,\n            senkou_span_a,\n            senkou_span_b,\n        ):\n            if (ha_close > chikou_span) and (ha_close1 <= chikou_span1):\n                intersect = (ha_close1 * (chikou_span - chikou_span1) - chikou_span1 * (\n                    ha_close - ha_close1)) / ((chikou_span - chikou_span1) - (ha_close - ha_close1))\n                if (intersect > senkou_span_a) and (intersect > senkou_span_b):\n                    return 2\n                elif(intersect < senkou_span_a) and (intersect < senkou_span_b):\n                    return 0.5\n                else:\n                    return 1\n            elif (ha_close < chikou_span) and (ha_close1 >= chikou_span1):\n                intersect = (ha_close1 * (chikou_span - chikou_span1) - chikou_span1 * (\n                    ha_close - ha_close1)) / ((chikou_span - chikou_span1) - (ha_close - ha_close1))\n                if (intersect > senkou_span_a) and (intersect > senkou_span_b):\n                    return -0.5\n                elif(intersect < senkou_span_a) and (intersect < senkou_span_b):\n                    return -2\n                else:\n                    return -1\n            else:\n                return 0\n\n        df['chikouCrossScore'] = np.vectorize(calcChikouCross)(\n            df['ha_close'],\n            df['chikou_span'],\n            df['ha_close1'],\n            df['chikou_span1'],\n            df['senkou_span_a'],\n            df['senkou_span_b'],\n        )\n\n        # // == price relative to cloud ==\n        def calcPricePlacement(\n            ha_close,\n            senkou_span_a,\n            senkou_span_b,\n        ):\n            if (ha_close > senkou_span_a) and (ha_close > senkou_span_b):\n                return 2\n            elif(ha_close < senkou_span_a) and (ha_close < senkou_span_b):\n                return -2\n            else:\n                return 0\n\n        df['pricePlacementScore'] = np.vectorize(calcPricePlacement)(\n            df['ha_close'],\n            df['senkou_span_a'],\n            df['senkou_span_b'],\n        )\n\n        # // == lag line releative to cloud ==\n        def calcChikouPlacement(\n            ha_close,\n            senkou_leading_a,\n            senkou_leading_b,\n        ):\n            if (ha_close > senkou_leading_a) and (ha_close > senkou_leading_b):\n                return 2\n            elif(ha_close < senkou_leading_a) and (ha_close < senkou_leading_b):\n                return -2\n            else:\n                return 0\n\n        df['chikouPlacementScore'] = np.vectorize(calcChikouPlacement)(\n            df['ha_close'],\n            df['senkou_leading_a'],\n            df['senkou_leading_b'],\n        )\n\n        # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # //\n        dataframe['Ichimoku_Score'] = (\n            df['tkCrossScore'] +\n            df['pkCrossScore'] +\n            df['kumoBreakoutScore'] +\n            df['senkouCrossScore'] +\n            df['chikouCrossScore']\n        ).rolling(1).sum().cumsum()\n\n        print(metadata['pair'],dataframe['Ichimoku_Score'].median())\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # exit()\n        dataframe.loc[\n            # (dataframe['Ichimoku_Score']>0)&\n            qtpylib.crossed_above(\n                ta.SMA(dataframe['Ichimoku_Score'], self.buy_fast_timeperiod.value),\n                ta.SMA(dataframe['Ichimoku_Score'], self.buy_slow_timeperiod.value)\n            ), 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n                # (dataframe['Ichimoku_Score']<0)|\n                (\n                qtpylib.crossed_below(\n                    ta.SMA(dataframe['Ichimoku_Score'], self.sell_fast_timeperiod.value),\n                    ta.SMA(dataframe['Ichimoku_Score'], self.sell_slow_timeperiod.value)\n                )\n            ), 'sell'] = 1\n\n        return dataframe\n\n"
  },
  {
    "path": "strategies/Ichi/Ichi.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame, Series\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, \\\n    CategoricalParameter\nfrom technical.indicators import ichimoku\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom functools import reduce\n# from freqtrade.state import RunMode\nimport logging\nimport os\n\nlogger = logging.getLogger(__name__)\n\nLOG_FILENAME = datetime.now().strftime('logfile_%d_%m_%Y.log')\nos.system(\"rm \" + LOG_FILENAME)\n\n# This will have an impact on all the logging from FreqTrade, when using other strategies than this one !!! \nfor handler in logging.root.handlers[:]:\n    logging.root.removeHandler(handler)\nlogging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG, format='%(asctime)s :: %(message)s')\n\nlogging.info(\"test\")\n\n\nclass Ichi(IStrategy):\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': True\n    }\n\n    minimal_roi = {\n        \"60\": 0,\n        \"45\": 0.0025 / 2,\n        \"30\": 0.003 / 2,\n        \"15\": 0.005 / 2,\n        \"10\": 0.075 / 2,\n        \"5\": 0.01 / 2,\n        \"0\": 0.02 / 2,\n    }\n    timeframe = '15m'\n    stoploss = -0.20\n\n    INTERFACE_VERSION = 2\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ichi = ichimoku(dataframe)\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n        dataframe['chikou'] = ichi['chikou_span']\n\n        # EMA\n        #        dataframe['ema8'] = ta.EMA(dataframe, timeperiod=8)\n        #        dataframe['ema13'] = ta.EMA(dataframe, timeperiod=13)\n        #        dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        #        dataframe['ema55'] = ta.EMA(dataframe, timeperiod=55)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                        (dataframe['open'].shift(1) < dataframe['senkou_b'].shift(1))\n                        & (dataframe['close'].shift(1) > dataframe['senkou_b'].shift(1))\n                        & (dataframe['open'] > dataframe['senkou_b'])\n                        & (dataframe['close'] > dataframe['senkou_b'])\n\n                    #\t\t\t\t& (dataframe['cloud_green'] == True)\n                    #\t\t\t\t&(dataframe['tenkan'] > dataframe['kijun'])\n                    #\t\t\t\t&(dataframe['tenkan'].shift(1) < dataframe['kijun'].shift(1))\n                    #\t\t\t\t& (dataframe['close'].shift(-26) > dataframe['close'].shift(26))\n                )\n                #\t\t\t &\n                #             (\n                #                (dataframe['ema21'] > dataframe['ema55']) & # Wenn EMA21 > EMA51\n                #                (dataframe['ema13'] > dataframe['ema21']) &\n                #                (dataframe['ema8'] > dataframe['ema13'])\n                #             )\n\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        #        dataframe.loc[\n        #            (\n        #                (dataframe['close'].shift(-26) <= dataframe['close'].shift(26))\n        #            ),\n        #            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku/Ichimoku.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\nfrom technical.indicators import ichimoku\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass Ichimoku(IStrategy):\n    \"\"\"\n    Ichimoku Strategy\n    \"\"\"\n\n    minimal_roi = {\n        \"0\":  1\n    }\n\n    stoploss = -0.1\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        \"\"\"\n\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n\n        ichi = ichimoku(dataframe)\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n\n        dataframe.loc[\n            (\n                (dataframe['tenkan'].shift(1)<dataframe['kijun'].shift(1)) &\n                (dataframe['tenkan']>dataframe['kijun']) &\n                (dataframe['cloud_red']==True)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        \"\"\"\n\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_SenkouSpanCross/Ichimoku_SenkouSpanCross.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\nfrom technical.indicators import ichimoku\n\nclass Ichimoku_SenkouSpanCross(IStrategy):\n    \"\"\"\n    \"\"\"\n    minimal_roi = {\n        \"0\": 1000\n    }\n    stoploss = -0.99\n    timeframe = '4h'\n    # startup_candle_count: int = 300\n    # trailing stoploss\n    trailing_stop = True\n    trailing_stop_positive = 0.45\n    trailing_stop_positive_offset = 0.50\n    trailing_only_offset_is_reached = True\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    def informative_pairs(self):\n        return [\n            ]\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ichi = ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        # dataframe['chikou_span'] = ichi['chikou_span']\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        return dataframe\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['senkou_a'], dataframe['senkou_b'])) &\n                (dataframe['close'] > dataframe['senkou_a']) &\n                (dataframe['close'] > dataframe['senkou_b']) &\n                (dataframe['cloud_green'] == True)\n            ),\n            'buy'] = 1\n        return dataframe\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['senkou_b'], dataframe['senkou_a'])) &\n                (dataframe['close'] < dataframe['senkou_a']) &\n                (dataframe['close'] < dataframe['senkou_b']) &\n                (dataframe['cloud_red'] == True)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_v12/Ichimoku_v12.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n#from technical.indicators import accumulation_distribution\nfrom technical.util import resample_to_interval, resampled_merge\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\nfrom technical.indicators import ichimoku\n\nclass Ichimoku_v12(IStrategy):\n    \"\"\"\n\n    \"\"\"\n\n    minimal_roi = {\n        \"0\": 0.05\n    }\n\n    stoploss = -1 #-0.35\n\n    ticker_interval = '4h' #3m\n\n    # startup_candle_count: int = 2\n\n    # trailing stoploss\n    #trailing_stop = True\n    #trailing_stop_positive = 0.40 #0.35\n    #trailing_stop_positive_offset = 0.50\n    #trailing_only_offset_is_reached = False\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ichi = ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        # dataframe['chikou_span'] = ichi['chikou_span']\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['senkou_a']) &\n                (dataframe['close'] > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['senkou_a']) &\n                (dataframe['close'] > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # dataframe.loc[\n        #     (\n        #         (qtpylib.crossed_below(dataframe['close'], dataframe['senkou_b'])) &\n        #         (dataframe['close'] < dataframe['senkou_a']) &\n        #         (dataframe['close'] < dataframe['senkou_b'])\n        #     ),\n        #     'sell'] = 1\n        #\n        # dataframe.loc[\n        #     (\n        #         (qtpylib.crossed_below(dataframe['close'], dataframe['senkou_a'])) &\n        #         (dataframe['close'] < dataframe['senkou_a']) &\n        #         (dataframe['close'] < dataframe['senkou_b'])\n        #     ),\n        #     'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_v30/Ichimoku_v30.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n#from technical.indicators import accumulation_distribution\nfrom technical.util import resample_to_interval, resampled_merge\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\nfrom technical.indicators import ichimoku\n\nclass Ichimoku_v30(IStrategy):\n    \"\"\"\n\n    \"\"\"\n\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -1 #-0.35\n\n    ticker_interval = '4h' #3m\n\n    # startup_candle_count: int = 2\n\n    # trailing stoploss\n    #trailing_stop = True\n    #trailing_stop_positive = 0.40 #0.35\n    #trailing_stop_positive_offset = 0.50\n    #trailing_only_offset_is_reached = False\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ichi = ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        # dataframe['chikou_span'] = ichi['chikou_span']\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # # Evening Doji Star: values [0, 100]\n        dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['close'].shift(2), dataframe['senkou_a'])) &\n                (dataframe['close'].shift(2) > dataframe['senkou_a']) &\n                (dataframe['close'].shift(2) > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['close'].shift(2), dataframe['senkou_b'])) &\n                (dataframe['close'].shift(2) > dataframe['senkou_a']) &\n                (dataframe['close'].shift(2 ) > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['CDLEVENINGDOJISTAR'] != 0)\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_v31/Ichimoku_v31.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom technical.util import resample_to_interval, resampled_merge\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom technical.indicators import ichimoku\n\nclass Ichimoku_v31(IStrategy):\n  # ROI table:\n  minimal_roi = {\n    \"0\": 100\n  }\n\n  # Stoploss:\n  stoploss = -0.99\n\n  # Optimal timeframe for the strategy.\n  timeframe = '1h'\n\n  inf_tf = '4h'\n\n  # Run \"populate_indicators()\" only for new candle.\n  process_only_new_candles = True\n\n  # These values can be overridden in the \"ask_strategy\" section in the config.\n  use_sell_signal = True\n  sell_profit_only = False\n  ignore_roi_if_buy_signal = True\n\n  # Number of candles the strategy requires before producing valid signals\n  startup_candle_count = 150\n\n  # Optional order type mapping.\n  order_types = {\n    'buy': 'market',\n    'sell': 'market',\n    'stoploss': 'market',\n    'stoploss_on_exchange': False\n  }\n\n  def informative_pairs(self):\n    if not self.dp:\n      # Don't do anything if DataProvider is not available.\n      return []\n    # Get access to all pairs available in whitelist.\n    pairs = self.dp.current_whitelist()\n    # Assign tf to each pair so they can be downloaded and cached for strategy.\n    informative_pairs =  [(pair, '4h') for pair in pairs]\n    return informative_pairs\n\n  def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n    if not self.dp:\n      # Don't do anything if DataProvider is not available.\n      return dataframe\n\n    dataframe_inf = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_tf)\n\n    #Heiken Ashi Candlestick Data\n    heikinashi = qtpylib.heikinashi(dataframe_inf)\n\n    dataframe_inf['ha_open'] = heikinashi['open']\n    dataframe_inf['ha_close'] = heikinashi['close']\n    dataframe_inf['ha_high'] = heikinashi['high']\n    dataframe_inf['ha_low'] = heikinashi['low']\n\n    ha_ichi = ichimoku(heikinashi,\n      conversion_line_period=20,\n      base_line_periods=60,\n      laggin_span=120,\n      displacement=30\n    )\n\n    #Required Ichi Parameters\n    dataframe_inf['senkou_a'] = ha_ichi['senkou_span_a']\n    dataframe_inf['senkou_b'] = ha_ichi['senkou_span_b']\n    dataframe_inf['cloud_green'] = ha_ichi['cloud_green']\n    dataframe_inf['cloud_red'] = ha_ichi['cloud_red']\n\n    # Merge timeframes\n    dataframe = merge_informative_pair(dataframe, dataframe_inf, self.timeframe, self.inf_tf, ffill=True)\n\n    \"\"\"\n    Senkou Span A > Senkou Span B = Cloud Green\n    Senkou Span B > Senkou Span A = Cloud Red\n    \"\"\"\n    return dataframe\n\n  def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    dataframe.loc[\n      (\n        ((dataframe['ha_close_4h'].crossed_above(dataframe['senkou_a_4h'])) &\n        (dataframe['ha_close_4h'].shift() < (dataframe['senkou_a_4h'])) &\n        (dataframe['cloud_green_4h'] == True)) |\n        ((dataframe['ha_close_4h'].crossed_above(dataframe['senkou_b_4h'])) &\n        (dataframe['ha_close_4h'].shift() < (dataframe['senkou_b_4h'])) &\n        (dataframe['cloud_red_4h'] == True))\n      ),\n      'buy'] = 1\n\n    return dataframe\n\n  def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    dataframe.loc[\n      (\n        (dataframe['ha_close_4h'] < dataframe['senkou_a_4h']) |\n        (dataframe['ha_close_4h'] < dataframe['senkou_b_4h'])\n      ),\n        'sell'] = 1\n    return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_v32/Ichimoku_v32.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n#from technical.indicators import accumulation_distribution\nfrom technical.util import resample_to_interval, resampled_merge\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\nfrom technical.indicators import ichimoku\n\nclass Ichimoku_v32(IStrategy):\n    \"\"\"\n\n    \"\"\"\n\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -1 #-0.35\n\n    ticker_interval = '4h' #3m\n\n    # startup_candle_count: int = 2\n\n    # trailing stoploss\n    #trailing_stop = True\n    #trailing_stop_positive = 0.40 #0.35\n    #trailing_stop_positive_offset = 0.50\n    #trailing_only_offset_is_reached = False\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ichi = ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        # dataframe['chikou_span'] = ichi['chikou_span']\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['ha_close'].shift(2), dataframe['senkou_a'])) &\n                (dataframe['ha_close'].shift(2) > dataframe['senkou_a']) &\n                (dataframe['ha_close'].shift(2) > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['ha_close'].shift(2), dataframe['senkou_b'])) &\n                (dataframe['ha_close'].shift(2) > dataframe['senkou_a']) &\n                (dataframe['ha_close'].shift(2 ) > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['tenkan'], dataframe['kijun'])) &\n                (dataframe['ha_close'] < dataframe['senkou_a']) &\n                (dataframe['ha_close'] < dataframe['senkou_b']) &\n                (dataframe['cloud_red'] == True)\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_v33/Ichimoku_v33.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n#from technical.indicators import accumulation_distribution\nfrom technical.util import resample_to_interval, resampled_merge\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\nfrom technical.indicators import ichimoku\n\nclass Ichimoku_v33(IStrategy):\n    \"\"\"\n\n    \"\"\"\n\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -1 #-0.35\n\n    ticker_interval = '4h' #3m\n\n    # startup_candle_count: int = 2\n\n    # trailing stoploss\n    #trailing_stop = True\n    #trailing_stop_positive = 0.40 #0.35\n    #trailing_stop_positive_offset = 0.50\n    #trailing_only_offset_is_reached = False\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ichi = ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        # dataframe['chikou_span'] = ichi['chikou_span']\n        dataframe['tenkan'] = ichi['tenkan_sen']\n        dataframe['kijun'] = ichi['kijun_sen']\n        dataframe['senkou_a'] = ichi['senkou_span_a']\n        dataframe['senkou_b'] = ichi['senkou_span_b']\n        dataframe['cloud_green'] = ichi['cloud_green']\n        dataframe['cloud_red'] = ichi['cloud_red']\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['close'].shift(2), dataframe['senkou_a'])) &\n                (dataframe['close'].shift(2) > dataframe['senkou_a']) &\n                (dataframe['close'].shift(2) > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['close'].shift(2), dataframe['senkou_b'])) &\n                (dataframe['close'].shift(2) > dataframe['senkou_a']) &\n                (dataframe['close'].shift(2 ) > dataframe['senkou_b'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['tenkan'], dataframe['kijun'])) &\n                (dataframe['close'] < dataframe['senkou_a']) &\n                (dataframe['close'] < dataframe['senkou_b']) &\n                (dataframe['cloud_red'] == True)\n            ),\n            'sell'] = 1\n\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['sar'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Ichimoku_v37/Ichimoku_v37.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\r\n# --- Do not remove these libs ---\r\nimport numpy as np  # noqa\r\nimport pandas as pd  # noqa\r\nfrom pandas import DataFrame\r\nfrom freqtrade.strategy.interface import IStrategy\r\n# --------------------------------\r\n# Add your lib to import here\r\nimport talib.abstract as ta\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nfrom technical.util import resample_to_interval, resampled_merge\r\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\r\nfrom technical.indicators import ichimoku\r\n\r\nclass Ichimoku_v37(IStrategy):\r\n  # ROI table:\r\n  minimal_roi = {\r\n    \"0\": 100\r\n  }\r\n\r\n  # Stoploss:\r\n  stoploss = -0.99\r\n\r\n  # Optimal timeframe for the strategy.\r\n  timeframe = '4h'\r\n\r\n  inf_tf = '1d'\r\n\r\n  # Run \"populate_indicators()\" only for new candle.\r\n  process_only_new_candles = True\r\n\r\n  # These values can be overridden in the \"ask_strategy\" section in the config.\r\n  use_sell_signal = True\r\n  sell_profit_only = False\r\n  ignore_roi_if_buy_signal = True\r\n\r\n  # Number of candles the strategy requires before producing valid signals\r\n  startup_candle_count = 150\r\n\r\n  # Optional order type mapping.\r\n  order_types = {\r\n    'buy': 'market',\r\n    'sell': 'market',\r\n    'stoploss': 'market',\r\n    'stoploss_on_exchange': False\r\n  }\r\n\r\n  def informative_pairs(self):\r\n    if not self.dp:\r\n      # Don't do anything if DataProvider is not available.\r\n      return []\r\n    # Get access to all pairs available in whitelist.\r\n    pairs = self.dp.current_whitelist()\r\n    # Assign tf to each pair so they can be downloaded and cached for strategy.\r\n    informative_pairs =  [(pair, '1d') for pair in pairs]\r\n    return informative_pairs\r\n\r\n  def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n    if not self.dp:\r\n      # Don't do anything if DataProvider is not available.\r\n      return dataframe\r\n\r\n    dataframe_inf = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_tf)\r\n\r\n    #Heiken Ashi Candlestick Data\r\n    heikinashi = qtpylib.heikinashi(dataframe_inf)\r\n    heik = qtpylib.heikinashi(dataframe)\r\n\r\n    dataframe_inf['ha_open'] = heikinashi['open']\r\n    dataframe_inf['ha_close'] = heikinashi['close']\r\n    dataframe_inf['ha_high'] = heikinashi['high']\r\n    dataframe_inf['ha_low'] = heikinashi['low']\r\n\r\n    dataframe['ha_4h_open'] = heik['open']\r\n    dataframe['ha_4h_close'] = heik['close']\r\n    dataframe['ha_4h_high'] = heik['high']\r\n    dataframe['ha_4h_low'] = heik['low']\r\n\r\n    ha_ichi = ichimoku(heikinashi,\r\n      conversion_line_period=20,\r\n      base_line_periods=60,\r\n      laggin_span=120,\r\n      displacement=30\r\n    )\r\n\r\n    #Required Ichi Parameters\r\n    dataframe_inf['senkou_a'] = ha_ichi['senkou_span_a']\r\n    dataframe_inf['senkou_b'] = ha_ichi['senkou_span_b']\r\n    dataframe_inf['cloud_green'] = ha_ichi['cloud_green']\r\n    dataframe_inf['cloud_red'] = ha_ichi['cloud_red']\r\n\r\n    # Merge timeframes\r\n    dataframe = merge_informative_pair(dataframe, dataframe_inf, self.timeframe, self.inf_tf, ffill=True)\r\n\r\n    \"\"\"\r\n    Senkou Span A > Senkou Span B = Cloud Green\r\n    Senkou Span B > Senkou Span A = Cloud Red\r\n    \"\"\"\r\n    return dataframe\r\n\r\n  def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n    dataframe.loc[\r\n      (\r\n        (\r\n          (dataframe['ha_4h_close'].crossed_above(dataframe['senkou_a_1d'])) &\r\n          (dataframe['ha_4h_close'].shift() < (dataframe['senkou_a_1d'])) &\r\n          (dataframe['cloud_green_1d'] == True)\r\n        ) |\r\n        (\r\n          (dataframe['ha_4h_close'].crossed_above(dataframe['senkou_b_1d'])) &\r\n          (dataframe['ha_4h_close'].shift() < (dataframe['senkou_b_1d'])) &\r\n          (dataframe['cloud_red_1d'] == True)\r\n        )\r\n      ),\r\n      'buy'] = 1\r\n\r\n    return dataframe\r\n\r\n  def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n    dataframe.loc[\r\n      (\r\n        (dataframe['ha_4h_close'] < dataframe['senkou_a_1d']) |\r\n        (dataframe['ha_4h_close'] < dataframe['senkou_b_1d'])\r\n      ),\r\n        'sell'] = 1\r\n        \r\n    return dataframe\r\n"
  },
  {
    "path": "strategies/InformativeSample/InformativeSample.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass InformativeSample(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.04\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"BTC/USDT\", '15m')]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        if self.dp:\n            # Get ohlcv data for informative pair at 15m interval.\n            inf_tf = '15m'\n            informative = self.dp.get_pair_dataframe(pair=f\"BTC/USDT\",\n                                                     timeframe=inf_tf)\n\n            # calculate SMA20 on informative pair\n            informative['sma20'] = informative['close'].rolling(20).mean()\n\n            # Combine the 2 dataframe\n            # This will result in a column named 'closeETH' or 'closeBTC' - depending on stake_currency.\n            dataframe = merge_informative_pair(dataframe, informative,\n                                               self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema20'] > dataframe['ema50']) &\n                # stake/USDT above sma(stake/USDT, 20)\n                (dataframe['close_15m'] > dataframe['sma20_15m'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['ema20'] < dataframe['ema50']) &\n                # stake/USDT below sma(stake/USDT, 20)\n                (dataframe['close_15m'] < dataframe['sma20_15m'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Inverse/Inverse.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame, Series\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\n\nclass Inverse(IStrategy):\n    \n    INTERFACE_VERSION = 2\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fisher_cci_1\": -0.42,\n        \"buy_fisher_cci_2\": 0.41, \n        \"buy_fisher_length\": 31,  \n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fisher_cci_1\": 0.42,  \n        \"sell_fisher_cci_2\": -0.34, \n    }\n\n    # ROI table:  \n    minimal_roi = {\n        \"0\": 100\n    }\n\n    # Stoploss:\n    stoploss = -0.2\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.078\n    trailing_stop_positive_offset = 0.174\n    trailing_only_offset_is_reached = False\n\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n    info_timeframe = '4h'\n    \n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        'main_plot': {\n        },\n        'subplots': {\n            \"fisher\": {\n                'fisher_stoch': {'color': 'blue'},\n                'fisher_cci': {'color': 'red'},\n                'fisher_rsi': {'color': 'black'},\n                'fisher_mfi': {'color': 'purple'},\n            },\n        }\n    }\n    \n    # Hyperoptable parameters\n    buy_fisher_length = IntParameter(low=13, high=55, default=34, space=\"buy\", optimize=True, load=True)\n    buy_fisher_cci_1 = DecimalParameter(low=-0.6, high=-0.3, decimals=2, default=-0.5, space='buy', optimize=True, load=True)\n    buy_fisher_cci_2 = DecimalParameter(low=0.3, high=0.6, decimals=2, default=0.5, space='buy', optimize=True, load=True)\n    \n    sell_fisher_cci_1 = DecimalParameter(low=0.3, high=0.6, decimals=2, default=0.5, space='sell', optimize=True, load=True)\n    sell_fisher_cci_2 = DecimalParameter(low=-0.6, high=-0.3, decimals=2, default=-0.5, space='sell', optimize=True, load=True)\n    \n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        if (last_candle is not None):\n#            if (sell_reason in ['roi','sell_signal','trailing_stop_loss']):\n            if (sell_reason in ['sell_signal']):\n                if last_candle['di_up'] and (last_candle['adx'] > previous_candle_1['adx']):\n                    return False\n        return True\n    \n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        \n        # informative_pairs.append(('BTC/USDT', self.btc_info_timeframe))\n        \n        return informative_pairs\n\n    def informative_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        \n        # Get the informative pair\n        informative_p = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_p['ema_50'] = ta.EMA(informative_p, timeperiod=50)\n        informative_p['ema_100'] = ta.EMA(informative_p, timeperiod=100)\n        informative_p['ema_200'] = ta.EMA(informative_p, timeperiod=200)\n        \n        # SSL Channels\n        ssl_down, ssl_up = self.SSLChannels(informative_p, 20)\n        informative_p['ssl_down'] = ssl_down\n        informative_p['ssl_up'] = ssl_up\n\n        return informative_p\n    \n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        # RSI\n        # dataframe['rsi'] = ta.RSI(dataframe, timeperiod=self.buy_fisher_length.value)\n        # # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # wmarsi = ta.WMA(rsi, timeperiod = 9)\n        # dataframe['fisher_rsi'] = (numpy.exp(2 * wmarsi) - 1) / (numpy.exp(2 * wmarsi) + 1)\n        \n        # # MFI - Money Flow Index\n        # dataframe['mfi'] = ta.MFI(dataframe, timeperiod=self.buy_fisher_length.value)\n        # # Inverse Fisher transform on MFI\n        # mfi = 0.1 * (dataframe['mfi'] - 50)\n        # wmamfi = ta.WMA(mfi, timeperiod = 9)\n        # dataframe['fisher_mfi'] = (numpy.exp(2 * wmamfi) - 1) / (numpy.exp(2 * wmamfi) + 1)\n        \n        # # Stochastic\n        # stoch_fast = ta.STOCHF(dataframe, fastk_period=self.buy_fisher_length.value)\n        # dataframe['fastk'] = stoch_fast['fastk']\n        # # Inverse Fisher transform on Stochastic\n        # stoch = 0.1 * (dataframe['fastk'] - 50)\n        # wmastoch = ta.WMA(stoch, timeperiod = 9)\n        # dataframe['fisher_stoch'] = (numpy.exp(2 * wmastoch) - 1) / (numpy.exp(2 * wmastoch) + 1)\n        \n        # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        for cci_length in self.buy_fisher_length.range:\n            dataframe[f'cci'] = ta.CCI(dataframe, timeperiod=cci_length)\n            # Inverse Fisher transform on CCI\n            cci = 0.1 * (dataframe[f'cci'] / 4)\n            wmacci = ta.WMA(cci, timeperiod = 9)\n            dataframe[f'fisher_cci_{cci_length}'] = (numpy.exp(2 * wmacci) - 1) / (numpy.exp(2 * wmacci) + 1)\n        \n        # dataframe['fisher_average'] = (\n        #     (dataframe['fisher_rsi'] + \n        #      dataframe['fisher_cci'] + \n        #      dataframe['fisher_mfi'] + \n        #      dataframe['fisher_stoch']\n        #     ) / 4).astype(float)\n        \n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        \n        # confirm_trade_exit\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=3)\n        dataframe['di_up'] = ta.PLUS_DI(dataframe, timeperiod=3) > ta.MINUS_DI(dataframe, timeperiod=3)\n        \n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_p = self.informative_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_p, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe.loc[\n            (\n                (\n                    (qtpylib.crossed_above(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_1.value))\n                    |\n                    (\n                        (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_2.value).rolling(8).max() == 1) &\n                        (qtpylib.crossed_above(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_2.value))\n                    )\n                ) &\n                (dataframe[f'ssl_up_{self.info_timeframe}'] > dataframe[f'ssl_down_{self.info_timeframe}']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe[f'ema_50_{self.info_timeframe}'] > dataframe[f'ema_100_{self.info_timeframe}']) &\n                (dataframe[f'ema_50_{self.info_timeframe}'] > dataframe[f'ema_200_{self.info_timeframe}']) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe.loc[\n            (\n                (\n                    (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.sell_fisher_cci_1.value)) \n                    | (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.sell_fisher_cci_2.value))    \n                ) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n\n    # SSL Channels\n    def SSLChannels(self, dataframe, length = 7):\n        df = dataframe.copy()\n        df['ATR'] = ta.ATR(df, timeperiod=14)\n        df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n        df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n        df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n        df['hlv'] = df['hlv'].ffill()\n        df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n        df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n        return df['sslDown'], df['sslUp']\n    "
  },
  {
    "path": "strategies/InverseV2/InverseV2.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame, Series\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\n\nclass InverseV2(IStrategy):\n    \n    INTERFACE_VERSION = 2\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fisher_cci_1\": -0.42,\n        \"buy_fisher_cci_2\": 0.41, \n        \"buy_fisher_length\": 31,  \n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fisher_cci_1\": 0.42,  \n        \"sell_fisher_cci_2\": -0.34, \n    }\n\n    # ROI table:  \n    minimal_roi = {\n        \"0\": 100\n    }\n\n    # Stoploss:\n    stoploss = -0.2\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.078\n    trailing_stop_positive_offset = 0.174\n    trailing_only_offset_is_reached = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n    info_timeframe = '4h'\n    \n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        'main_plot': {\n        },\n        'subplots': {\n            \"fisher\": {\n                'fisher_stoch': {'color': 'blue'},\n                'fisher_cci': {'color': 'red'},\n                'fisher_rsi': {'color': 'black'},\n                'fisher_mfi': {'color': 'purple'},\n            },\n        }\n    }\n    \n    # Hyperoptable parameters\n    buy_fisher_length = IntParameter(low=13, high=55, default=34, space=\"buy\", optimize=True, load=True)\n    buy_fisher_cci_1 = DecimalParameter(low=-0.6, high=-0.3, decimals=2, default=-0.5, space='buy', optimize=True, load=True)\n    buy_fisher_cci_2 = DecimalParameter(low=0.3, high=0.6, decimals=2, default=0.5, space='buy', optimize=True, load=True)\n    \n    sell_fisher_cci_1 = DecimalParameter(low=0.3, high=0.6, decimals=2, default=0.5, space='sell', optimize=True, load=True)\n    sell_fisher_cci_2 = DecimalParameter(low=-0.6, high=-0.3, decimals=2, default=-0.5, space='sell', optimize=True, load=True)\n    \n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        if (last_candle is not None):\n            # if (sell_reason in ['roi','sell_signal','trailing_stop_loss']):\n            if (sell_reason in ['sell_signal']):\n                if last_candle['di_up'] and (last_candle['adx'] > previous_candle_1['adx']):\n                    return False\n        return True\n    \n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        \n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        \n        return informative_pairs\n\n    def informative_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        \n        # Get the informative pair\n        informative_p = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_p['ema_50'] = ta.EMA(informative_p, timeperiod=50)\n        informative_p['ema_100'] = ta.EMA(informative_p, timeperiod=100)\n        informative_p['ema_200'] = ta.EMA(informative_p, timeperiod=200)\n        \n        # SSL Channels\n        ssl_down, ssl_up = self.SSLChannels(informative_p, 20)\n        informative_p['ssl_down'] = ssl_down\n        informative_p['ssl_up'] = ssl_up\n\n        return informative_p\n    \n    def informative_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        \n        informative_btc = self.dp.get_pair_dataframe(pair=\"BTC/USDT\", timeframe=self.info_timeframe)\n        \n        informative_btc['btc_cci'] = ta.CCI(informative_btc)\n        \n        return informative_btc\n    \n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        # RSI\n        # dataframe['rsi'] = ta.RSI(dataframe, timeperiod=self.buy_fisher_length.value)\n        # # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # wmarsi = ta.WMA(rsi, timeperiod = 9)\n        # dataframe['fisher_rsi'] = (numpy.exp(2 * wmarsi) - 1) / (numpy.exp(2 * wmarsi) + 1)\n        \n        # # MFI - Money Flow Index\n        # dataframe['mfi'] = ta.MFI(dataframe, timeperiod=self.buy_fisher_length.value)\n        # # Inverse Fisher transform on MFI\n        # mfi = 0.1 * (dataframe['mfi'] - 50)\n        # wmamfi = ta.WMA(mfi, timeperiod = 9)\n        # dataframe['fisher_mfi'] = (numpy.exp(2 * wmamfi) - 1) / (numpy.exp(2 * wmamfi) + 1)\n        \n        # # Stochastic\n        # stoch_fast = ta.STOCHF(dataframe, fastk_period=self.buy_fisher_length.value)\n        # dataframe['fastk'] = stoch_fast['fastk']\n        # # Inverse Fisher transform on Stochastic\n        # stoch = 0.1 * (dataframe['fastk'] - 50)\n        # wmastoch = ta.WMA(stoch, timeperiod = 9)\n        # dataframe['fisher_stoch'] = (numpy.exp(2 * wmastoch) - 1) / (numpy.exp(2 * wmastoch) + 1)\n        \n        # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        for cci_length in self.buy_fisher_length.range:\n            dataframe[f'cci'] = ta.CCI(dataframe, timeperiod=cci_length)\n            # Inverse Fisher transform on CCI\n            cci = 0.1 * (dataframe[f'cci'] / 4)\n            wmacci = ta.WMA(cci, timeperiod = 9)\n            dataframe[f'fisher_cci_{cci_length}'] = (numpy.exp(2 * wmacci) - 1) / (numpy.exp(2 * wmacci) + 1)\n        \n        # dataframe['fisher_average'] = (\n        #     (dataframe['fisher_rsi'] + \n        #      dataframe['fisher_cci'] + \n        #      dataframe['fisher_mfi'] + \n        #      dataframe['fisher_stoch']\n        #     ) / 4).astype(float)\n        \n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        \n        # confirm_trade_exit\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=3)\n        dataframe['di_up'] = ta.PLUS_DI(dataframe, timeperiod=3) > ta.MINUS_DI(dataframe, timeperiod=3)\n        \n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_p = self.informative_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_p, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n            \n            \n        '''\n        --> Informative btc timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_btc = self.informative_btc_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_btc, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe.loc[\n            (\n                (\n                    (qtpylib.crossed_above(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_1.value))\n                    |\n                    (\n                        (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_2.value).rolling(8).max() == 1) &\n                        (qtpylib.crossed_above(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.buy_fisher_cci_2.value))\n                    )\n                ) &\n                (dataframe[f'ssl_up_{self.info_timeframe}'] > dataframe[f'ssl_down_{self.info_timeframe}']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe[f'ema_50_{self.info_timeframe}'] > dataframe[f'ema_100_{self.info_timeframe}']) &\n                (dataframe[f'ema_50_{self.info_timeframe}'] > dataframe[f'ema_200_{self.info_timeframe}']) &\n                \n                (dataframe[f'btc_cci_{self.info_timeframe}'] < 0) &\n                \n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe.loc[\n            (\n                (\n                    (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.sell_fisher_cci_1.value)) \n                    | (qtpylib.crossed_below(dataframe[f'fisher_cci_{self.buy_fisher_length.value}'], self.sell_fisher_cci_2.value))    \n                ) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n\n    # SSL Channels\n    def SSLChannels(self, dataframe, length = 7):\n        df = dataframe.copy()\n        df['ATR'] = ta.ATR(df, timeperiod=14)\n        df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n        df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n        df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n        df['hlv'] = df['hlv'].ffill()\n        df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n        df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n        return df['sslDown'], df['sslUp']\n    "
  },
  {
    "path": "strategies/JustROCR/JustROCR.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\n\n\nclass JustROCR(IStrategy):\n    minimal_roi = {\n        \"0\": 0.20\n    }\n\n    stoploss = -0.20\n    trailing_stop = True\n    ticker_interval = '1h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rocr'] = ta.ROCR(dataframe, period=499)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                dataframe['rocr'] > 1.10\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/JustROCR3/JustROCR3.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\n\n\nclass JustROCR3(IStrategy):\n    minimal_roi = {\n        \"0\": 0.50\n    }\n\n    stoploss = -0.01\n    trailing_stop = True\n    ticker_interval = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rocr'] = ta.ROCR(dataframe, period=499)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                dataframe['rocr'] > 1.10\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/JustROCR5/JustROCR5.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\n\n\nclass JustROCR5(IStrategy):\n    minimal_roi = {\n        \"0\": 0.05\n    }\n\n    stoploss = -0.01\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rocr'] = ta.ROCR(dataframe, timeperiod=5)\n        dataframe['rocr_2'] = ta.ROCR(dataframe, timeperiod=2)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rocr'] > 1.10) &\n                (dataframe['rocr_2'] > 1.01)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/JustROCR6/JustROCR6.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\n\n\nclass JustROCR6(IStrategy):\n    minimal_roi = {\n        \"0\": 0.05\n    }\n\n    stoploss = -0.01\n    trailing_stop = True\n    ticker_interval = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rocr_499'] = ta.ROCR(dataframe, timeperiod=499)\n        dataframe['rocr_200'] = ta.ROCR(dataframe, timeperiod=200)\n        dataframe['rocr_100'] = ta.ROCR(dataframe, timeperiod=100)\n        dataframe['rocr_50'] = ta.ROCR(dataframe, timeperiod=50)\n        dataframe['rocr_10'] = ta.ROCR(dataframe, timeperiod=10)\n        dataframe['rocr_5'] = ta.ROCR(dataframe, timeperiod=5)\n        dataframe['rocr_2'] = ta.ROCR(dataframe, timeperiod=2)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rocr_499'] > 1.20) &\n                (dataframe['rocr_200'] > 1.15) &\n                (dataframe['rocr_100'] > 1.125) &\n                (dataframe['rocr_50'] > 1.10) &\n                (dataframe['rocr_10'] > 1.075) &\n                (dataframe['rocr_5'] > 1.05) &\n                (dataframe['rocr_2'] > 1.01)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/KAMACCIRSI/KAMACCIRSI.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nfrom functools import reduce\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass KAMACCIRSI(IStrategy):\n    \"\"\"\n    author@: werkkrew\n    github@: https://github.com/werkkrew/freqtrade-strategies\n\n    Strategy using 3 indicators with fully customizable parameters and full hyperopt support\n    including indicator periods as well as cross points.\n\n    There is nothing groundbreaking about this strategy, how it works, or what it does.\n    It was mostly an experiment for me to learn Freqtrade strategies and hyperopt development.\n\n    Default hyperopt defined parameters below were done on 60 days of data from Kraken against 20 BTC pairs\n    using the SharpeHyperOptLoss loss function.\n\n    Suggestions and improvements are welcome!\n\n    Supports selling via strategy, as well as ROI and Stoploss/Trailing Stoploss\n\n    Indicators Used:\n    KAMA \"Kaufman Adaptive Moving Average\" (Short Duration)\n    KAMA (Long Duration)\n    CCI \"Commodity Channel Index\"\n    RSI \"Relative Strength Index\"\n\n    Buy Strategy:\n        kama-cross OR kama-slope\n            kama-short > kama-long\n            kama-long-slope > 1\n        cci-enabled?\n            cci > X\n        rsi-enabled?\n            rsi > Y\n\n    Sell Strategy:\n        kama-cross OR kama-slope\n            kama-short < kama-long\n            kama-long-slope < 1\n        cci-enabled?\n            cci < A\n        rsi-enabled?\n            rsi < B\n\n    Ideas and Todo:\n        - Add informative pairs to help decision (e.g. BTC/USD to inform other */BTC pairs)\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    \"\"\"\n    HYPEROPT SETTINGS\n    The following is set by Hyperopt, or can be set by hand if you wish:\n\n    - minimal_roi table\n    - stoploss\n    - trailing stoploss\n    - for buy/sell separate\n        - kama-trigger = cross, slope\n        - kama-short timeperiod\n        - kama-long timeperiod\n        - cci period\n        - cci upper / lower threshold\n        - rsi period\n        - rsi upper / lower threshold\n\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n\n    # Buy hyperspace params:\n    buy_params = {\n        'cci-enabled': True,\n        'cci-limit': 198,\n        'cci-period': 18,\n        'kama-long-period': 46,\n        'kama-short-period': 11,\n        'kama-trigger': 'cross',\n        'rsi-enabled': False,\n        'rsi-limit': 72,\n        'rsi-period': 5\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-cci-enabled': False,\n        'sell-cci-limit': -144,\n        'sell-cci-period': 18,\n        'sell-kama-long-period': 41,\n        'sell-kama-short-period': 5,\n        'sell-kama-trigger': 'cross',\n        'sell-rsi-enabled': False,\n        'sell-rsi-limit': 69,\n        'sell-rsi-period': 12\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.11599,\n        \"18\": 0.03112,\n        \"34\": 0.01895,\n        \"131\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.32982\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.28596\n    trailing_stop_positive_offset = 0.29771\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    # Set this to the highest period value in the indicator_params dict or highest of the ranges in the hyperopt settings (default: 72)\n    startup_candle_count: int = 72\n\n    \"\"\"\n    Not currently being used for anything, thinking about implementing this later.\n    \"\"\"\n    def informative_pairs(self):\n        # https://www.freqtrade.io/en/latest/strategy-customization/#additional-data-informative_pairs\n        informative_pairs = [(f\"{self.config['stake_currency']}/USD\", self.timeframe)]\n        return informative_pairs\n\n    \"\"\"\n    Populate all of the indicators we need (note: indicators are separate for buy/sell)\n    \"\"\"\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        dataframe['buy-cci'] = ta.CCI(dataframe, timeperiod=self.buy_params['cci-period'])\n        dataframe['sell-cci'] = ta.CCI(dataframe, timeperiod=self.sell_params['sell-cci-period'])\n\n        # RSI\n        dataframe['buy-rsi'] = ta.RSI(dataframe, timeperiod=self.buy_params['rsi-period'])\n        dataframe['sell-rsi'] = ta.RSI(dataframe, timeperiod=self.sell_params['sell-rsi-period'])\n\n        # KAMA - Kaufman Adaptive Moving Average\n        dataframe['buy-kama-short'] = ta.KAMA(dataframe, timeperiod=self.buy_params['kama-short-period'])\n        dataframe['buy-kama-long'] = ta.KAMA(dataframe, timeperiod=self.buy_params['kama-long-period'])\n        dataframe['buy-kama-long-slope'] = (dataframe['buy-kama-long'] / dataframe['buy-kama-long'].shift())\n\n        dataframe['sell-kama-short'] = ta.KAMA(dataframe, timeperiod=self.sell_params['sell-kama-short-period'])\n        dataframe['sell-kama-long'] = ta.KAMA(dataframe, timeperiod=self.sell_params['sell-kama-long-period'])\n        dataframe['sell-kama-long-slope'] = (dataframe['sell-kama-long'] / dataframe['sell-kama-long'].shift())\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        if self.buy_params['rsi-enabled']:\n            conditions.append(dataframe['buy-rsi'] > self.buy_params['rsi-limit'])\n        if self.buy_params['cci-enabled']:\n            conditions.append(dataframe['buy-cci'] > self.buy_params['cci-limit'])\n        if self.buy_params['kama-trigger'] == 'cross':\n            conditions.append(dataframe['buy-kama-short'] > dataframe['buy-kama-long'])\n        if self.buy_params['kama-trigger'] == 'slope':\n            conditions.append(dataframe['buy-kama-long'] > 1)\n\n        # Check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        if self.sell_params['sell-rsi-enabled']:\n            conditions.append(dataframe['sell-rsi'] < self.sell_params['sell-rsi-limit'])\n        if self.sell_params['sell-cci-enabled']:\n            conditions.append(dataframe['sell-cci'] < self.sell_params['sell-cci-limit'])\n        if self.sell_params['sell-kama-trigger'] == 'cross':\n            conditions.append(dataframe['sell-kama-short'] < dataframe['sell-kama-long'])\n        if self.sell_params['sell-kama-trigger'] == 'slope':\n            conditions.append(dataframe['sell-kama-long'] < 1)\n\n        # Check that volume is not 0\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/KC_BB/KC_BB.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport pandas_ta as pta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass KC_BB(IStrategy):\n    \"\"\"\n\n    author @jilv220\n    KC_BB Stra\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 20.5\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.99\n\n    use_custom_stoploss = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n\n        return sl_new\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n\n        # SMA\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n\n        # KC 20 2\n        dataframe['range_ma_20'] = ta.SMA(dataframe['trange'], 20)\n        dataframe['kc_upperband_20_2'] = dataframe['sma_20'] + dataframe['range_ma_20'] * 2\n        dataframe['kc_lowerband_20_2'] = dataframe['sma_20'] - dataframe['range_ma_20'] * 2\n\n        # KC 28 1\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # BB 20 2\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n\n        dataframe['kc_bb_delta'] =  ( dataframe['kc_lowerband_20_2'] - dataframe['bb_lowerband2'] ) / dataframe['bb_lowerband2'] * 100\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n\n        # fisher\n        rsi = ta.RSI(dataframe)\n        dataframe[\"rsi\"] = rsi\n        rsi = 0.1 * (rsi - 50)\n        dataframe[\"fisher\"] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # EMA\n        dataframe['ema_fast'] = ta.EMA(dataframe['ha_close'], timeperiod=3)\n\n        # Williams R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n\n                (dataframe['kc_lowerband_28_1'] < dataframe['bb_upperband2']) &\n                (dataframe['kc_lowerband_28_1'] > dataframe['bb_lowerband2']) &\n                (dataframe['kc_bb_delta'] < 1.5) &\n                (dataframe['kc_bb_delta'] > 0.928) &\n                (dataframe['r_14'] < -80) &\n                (dataframe['r_14'] > -90) &\n                (dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.008)\n\n            ,'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n\n                (dataframe['fisher'] > 0.39075) &\n                (dataframe['ha_high'].le(dataframe['ha_high'].shift(1))) &\n                (dataframe['ha_high'].shift(1).le(dataframe['ha_high'].shift(2))) &\n                (dataframe['ha_close'].le(dataframe['ha_close'].shift(1))) &\n                (dataframe['ema_fast'] > dataframe['ha_close']) &\n                (dataframe['ha_close'] * 0.99754 > dataframe['bb_middleband2']) &\n                (dataframe['volume'] > 0)\n\n            ,'sell'] = 1\n\n        return dataframe\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n"
  },
  {
    "path": "strategies/Kamaflage/Kamaflage.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI, VIDYA\n\n\nclass Kamaflage(IStrategy):\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n\n    buy_params = {\n        'macd': 0,\n        'macdhist': 0,\n        'rmi': 50\n    }\n\n    sell_params = {\n\n    }\n\n    minimal_roi = {\n        \"0\": 0.15,\n        \"10\": 0.10,\n        \"20\": 0.05,\n        \"30\": 0.025,\n        \"60\": 0.01\n    }\n\n    # Stoploss:\n    stoploss = -1\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01125\n    trailing_stop_positive_offset = 0.04673\n    trailing_only_offset_is_reached = True\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    # sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    process_only_new_candles = False\n\n    startup_candle_count: int = 20\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:        \n\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['rmi'] = RMI(dataframe)\n        dataframe['kama-3'] = ta.KAMA(dataframe, timeperiod=3)\n        dataframe['kama-21'] = ta.KAMA(dataframe, timeperiod=21)\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        dataframe['volume_ma'] = dataframe['volume'].rolling(window=24).mean()\n\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        conditions = []\n\n        active_trade = False\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n\n        if not active_trade:     \n            conditions.append(dataframe['kama-3'] > dataframe['kama-21'])\n            conditions.append(dataframe['macd'] > dataframe['macdsignal'])\n            conditions.append(dataframe['macd'] > params['macd'])\n            conditions.append(dataframe['macdhist'] > params['macdhist'])\n            conditions.append(dataframe['rmi'] > dataframe['rmi'].shift())\n            conditions.append(dataframe['rmi'] > params['rmi'])\n            conditions.append(dataframe['volume'] < (dataframe['volume_ma'] * 20))\n        else:\n            conditions.append(dataframe['close'] > dataframe['sar'])\n            conditions.append(dataframe['rmi'] >= 75)\n\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        conditions = []\n\n        active_trade = False\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            active_trade = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True),]).all()\n        \n        if active_trade:\n            ob = self.dp.orderbook(metadata['pair'], 1)\n            current_price = ob['asks'][0][0]\n            current_profit = active_trade[0].calc_profit_ratio(rate=current_price)\n\n            conditions.append(\n                (dataframe['buy'] == 0) &\n                (dataframe['rmi'] < 30) &\n                (current_profit > -0.03) &\n                (dataframe['volume'].gt(0))\n            )\n        \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        else:\n            dataframe['sell'] = 0\n      \n        return dataframe\n    \n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['bids'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob['asks'][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n    \"\"\"\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:\n        _, roi = self.min_roi_reached_entry(0)\n\n        if roi is None:\n           if Trade.max_rate >= Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate < Trade.open_rate: \n                return False\n            if Trade.max_rate < Trade.rate * 0.8 and Trade.rate > Trade.open_rate: \n                return current_profit > roi\n        return False\n    \"\"\""
  },
  {
    "path": "strategies/Leveraged/Leveraged.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\nclass Leveraged(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    works on new objectify branch!\n\n    idea:\n        only buy on an upward tending market\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    #minimal_roi = {\n    #    \"0\": 0.01\n    #}\n    minimal_roi = {\n        \"120\": 0.0,\n        \"45\" : 0.01,\n        \"30\" : 0.015,\n        \"0\" : 0.025\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # resample factor to establish our general trend. Basically don't buy if a trend is not given\n    resample_factor = 12\n\n    EMA_SHORT_TERM = 5\n    EMA_MEDIUM_TERM = 12\n    EMA_LONG_TERM = 21\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = self.resample(dataframe, self.timeframe, self.resample_factor)\n\n        ##################################################################################\n        # buy and sell indicators\n\n        dataframe['ema_{}'.format(self.EMA_SHORT_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_SHORT_TERM\n        )\n        dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_MEDIUM_TERM\n        )\n        dataframe['ema_{}'.format(self.EMA_LONG_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_LONG_TERM\n        )\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['min'] = ta.MIN(dataframe, timeperiod=self.EMA_MEDIUM_TERM)\n        dataframe['max'] = ta.MAX(dataframe, timeperiod=self.EMA_MEDIUM_TERM)\n\n        dataframe['cci'] = ta.CCI(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=7)\n\n        dataframe['average'] = (dataframe['close'] + dataframe['open'] + dataframe['high'] + dataframe['low']) / 4\n\n        ##################################################################################\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (\n                            (\n                                    (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_SHORT_TERM)]) &\n                                    (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)]) &\n                                    (dataframe['close'] == dataframe['min']) &\n                                    (dataframe['close'] <= dataframe['bb_lowerband'])\n                            )\n                            |\n                            # simple v bottom shape (lopsided to the left to increase reactivity)\n                            # which has to be below a very slow average\n                            # this pattern only catches a few, but normally very good buy points\n                            (\n                                    (dataframe['average'].shift(5) > dataframe['average'].shift(4))\n                                    & (dataframe['average'].shift(4) > dataframe['average'].shift(3))\n                                    & (dataframe['average'].shift(3) > dataframe['average'].shift(2))\n                                    & (dataframe['average'].shift(2) > dataframe['average'].shift(1))\n                                    & (dataframe['average'].shift(1) < dataframe['average'].shift(0))\n                                    & (dataframe['low'].shift(1) < dataframe['bb_middleband'])\n                                    & (dataframe['cci'].shift(1) < -100)\n                                    & (dataframe['rsi'].shift(1) < 30)\n                                    & (dataframe['mfi'].shift(1) < 30)\n\n                            )\n                            |\n                            # buy in very oversold conditions\n                            (\n                                    (dataframe['low'] < dataframe['bb_middleband'])\n                                    & (dataframe['cci'] < -200)\n                                    & (dataframe['rsi'] < 30)\n                                    & (dataframe['mfi'] < 30)\n                            )\n\n                    )\n                    # safeguard against down trending markets and a pump and dump\n                    &\n                    (\n                            (dataframe['volume'] < (dataframe['volume'].rolling(window=30).mean().shift(1) * 20)) &\n                            (dataframe['resample_sma'] < dataframe['close']) &\n                            (dataframe['resample_sma'].shift(1) < dataframe['resample_sma'])\n                    )\n            )\n            ,\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['close'] > dataframe['ema_{}'.format(self.EMA_SHORT_TERM)]) &\n                    (dataframe['close'] > dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)]) &\n                    (dataframe['close'] >= dataframe['max']) &\n                    (dataframe['close'] >= dataframe['bb_upperband']) &\n                    (dataframe['mfi'] > 80)\n            ) |\n\n            # always sell on eight green candles\n            # with a high rsi\n            (\n                    (dataframe['open'] < dataframe['close']) &\n                    (dataframe['open'].shift(1) < dataframe['close'].shift(1)) &\n                    (dataframe['open'].shift(2) < dataframe['close'].shift(2)) &\n                    (dataframe['open'].shift(3) < dataframe['close'].shift(3)) &\n                    (dataframe['open'].shift(4) < dataframe['close'].shift(4)) &\n                    (dataframe['open'].shift(5) < dataframe['close'].shift(5)) &\n                    (dataframe['open'].shift(6) < dataframe['close'].shift(6)) &\n                    (dataframe['open'].shift(7) < dataframe['close'].shift(7)) &\n                    (dataframe['rsi'] > 70)\n            )\n                    |\n                    # in case of very overbought market, like some one pumping\n                    # sell\n                    (\n                        (dataframe['cci'] > 200)\n                        & (dataframe['rsi'] > 70)\n                    )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n\n    def resample(self, dataframe, interval, factor):\n        # defines the reinforcement logic\n        # resampled dataframe to establish if we are in an uptrend, downtrend or sideways trend\n        df = dataframe.copy()\n        df = df.set_index(DatetimeIndex(df['date']))\n        ohlc_dict = {\n            'open': 'first',\n            'high': 'max',\n            'low': 'min',\n            'close': 'last'\n        }\n        df = df.resample(str(int(interval[:-1]) * factor) + 'min',\n                         label=\"right\").agg(ohlc_dict).dropna(how='any')\n        df['resample_sma'] = ta.SMA(df, timeperiod=25, price='close')\n        df = df.drop(columns=['open', 'high', 'low', 'close'])\n        df = df.resample(interval[:-1] + 'min')\n        df = df.interpolate(method='time')\n        df['date'] = df.index\n        df.index = range(len(df))\n        dataframe = merge(dataframe, df, on='date', how='left')\n        return dataframe\n"
  },
  {
    "path": "strategies/LookaheadStrategy/LookaheadStrategy.py",
    "content": "from functools import reduce\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n\nclass LookaheadStrategy(IStrategy):\n\n    INTERFACE_VERSION = 3\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fast\": 2,\n        \"buy_push\": 1.022,\n        \"buy_shift\": -8,\n        \"buy_slow\": 16,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fast\": 34,\n        \"sell_push\": 0.458,\n        \"sell_shift\": -8,\n        \"sell_slow\": 44,\n    }\n\n    # ROI table:\n    # fmt: off\n    minimal_roi = {\n        \"0\": 0.166,\n        \"44\": 0.012,\n        \"59\": 0\n        }\n    # fmt: on\n\n    # Stoploss:\n    stoploss = -0.194\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n    # Buy hypers\n    timeframe = \"5m\"\n    # #################### END OF RESULT PLACE ####################\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata[\"pair\"], timeframe=\"1h\")\n        # EMA\n        informative_1h[\"ema_50\"] = ta.EMA(informative_1h, timeperiod=50)\n\n        return informative_1h\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_1h, self.timeframe, \"1h\", ffill=True\n        )\n\n        dataframe[\"buy_ema_fast\"] = ta.SMA(dataframe, timeperiod=self.buy_params[\"buy_fast\"])\n        dataframe[\"buy_ema_slow\"] = ta.SMA(dataframe, timeperiod=self.buy_params[\"buy_slow\"])\n\n        dataframe[\"sell_ema_fast\"] = ta.SMA(dataframe, timeperiod=self.sell_params[\"sell_fast\"])\n        dataframe[\"sell_ema_slow\"] = ta.SMA(dataframe, timeperiod=self.sell_params[\"sell_slow\"])\n\n        return dataframe\n\n    def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            qtpylib.crossed_above(\n                dataframe[\"buy_ema_fast\"].shift(self.buy_params[\"buy_shift\"]),\n                dataframe[\"buy_ema_slow\"].shift(self.buy_params[\"buy_shift\"])\n                * self.buy_params[\"buy_push\"],\n            )\n            & (dataframe[\"close\"] > dataframe[\"ema_50_1h\"])\n        )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"enter_long\", \"enter_tag\"]] = (\n                1,\n                \"buy_reason\",\n            )\n\n        return dataframe\n\n    def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(\n            qtpylib.crossed_below(\n                dataframe[\"sell_ema_fast\"].shift(self.sell_params[\"sell_shift\"]),\n                dataframe[\"sell_ema_slow\"].shift(self.sell_params[\"sell_shift\"])\n                * self.sell_params[\"sell_push\"],\n            )\n        )\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"exit_long\", \"exit_tag\"]] = (\n                1,\n                \"some_exit_tag\",\n            )\n        return dataframe\n"
  },
  {
    "path": "strategies/Low_BB/Low_BB.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# import numpy as np # noqa\n\nclass Low_BB(IStrategy):\n    \"\"\"\n\n    author@: Thorsten\n\n    works on new objectify branch!\n\n    idea:\n        buy after crossing .98 * lower_bb and sell if trailing stop loss is hit\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.9,\n        \"1\": 0.05,\n        \"10\": 0.04,\n        \"15\": 0.5\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.015\n\n    # Optimal timeframe for the strategy\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ##################################################################################\n        # buy and sell indicators\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # dataframe['cci'] = ta.CCI(dataframe)\n        # dataframe['mfi'] = ta.MFI(dataframe)\n        # dataframe['rsi'] = ta.RSI(dataframe, timeperiod=7)\n\n        # dataframe['canbuy'] = np.NaN\n        # dataframe['canbuy2'] = np.NaN\n        # dataframe.loc[dataframe.close.rolling(49).min() <= 1.1 * dataframe.close, 'canbuy'] == 1\n        # dataframe.loc[dataframe.close.rolling(600).max() < 1.2 * dataframe.close, 'canbuy'] = 1\n        # dataframe.loc[dataframe.close.rolling(600).max() * 0.8 >  dataframe.close, 'canbuy2'] = 1\n        ##################################################################################\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n\n                (dataframe['close'] <= 0.98 * dataframe['bb_lowerband'])\n\n            )\n            ,\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/LuxOSC/LuxOSC.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n \ndef LUX_SuperTrendOscillator(dtloc, source = 'close', length = 6, mult = 9, smooth = 72):\n    \"\"\"\n    // This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) https://creativecommons.org/licenses/by-nc-sa/4.0/\n    // Â© LuxAlgo\n      https://www.tradingview.com/script/dVau7zqn-LUX-SuperTrend-Oscillator/\n     :return: List of tuples in the format (osc, signal, histogram)   \n     translated for freqtrade: viksal1982  viktors.s@gmail.com\n    \"\"\"\n    def_proc_name = '_LUX_SuperTrendOscillator'\n    atrcol        = 'atr'    + def_proc_name\n    hl2col        = 'hl2'    + def_proc_name\n    upcol         = 'up'     + def_proc_name\n    dncol         = 'dn'     + def_proc_name\n    uppercol      = 'upper'  + def_proc_name\n    lowercol      = 'lower'  + def_proc_name\n    trendcol      = 'trend'  + def_proc_name\n    sptcol        = 'spt'    + def_proc_name\n    osc1col       = 'osc1'   + def_proc_name\n    osc2col       = 'osc2'   + def_proc_name\n    osccol        = 'osc'    + def_proc_name\n    alphacol      = 'alpha'  + def_proc_name\n    amacol        = 'ama'    + def_proc_name\n    histcol       = 'hist'   + def_proc_name\n\n\n    dtS = dtloc.copy().fillna(0)\n    dtS[atrcol] = ta.ATR(dtloc, timeperiod = length) * mult\n    dtS[hl2col] =  (dtS['high'] + dtS['low'] )/2\n    dtS[upcol] =  dtS[hl2col] + dtS[atrcol]\n    dtS[dncol] =  dtS[hl2col] - dtS[atrcol]\n    def calc_upper(dfr, init=0):\n        global calc_Lux_STO_upper\n        global calc_Lux_STO_src\n        if init == 1:\n            calc_Lux_STO_upper = 0.0\n            calc_Lux_STO_src = 0.0\n            return\n        if calc_Lux_STO_src < calc_Lux_STO_upper:\n            calc_Lux_STO_upper = min(dfr[upcol], calc_Lux_STO_upper)\n        else:\n            calc_Lux_STO_upper = dfr[upcol]\n        calc_Lux_STO_src = dfr[source]\n        return calc_Lux_STO_upper\n    calc_upper(None, init=1)\n    dtS[uppercol] = dtS.apply(calc_upper, axis = 1)\n    def calc_lower(dfr, init=0):\n        global calc_Lux_STO_lower\n        global calc_Lux_STO_src\n        if init == 1:\n            calc_Lux_STO_lower = 0.0\n            calc_Lux_STO_src = 0.0\n            return\n        if calc_Lux_STO_src > calc_Lux_STO_lower:\n            calc_Lux_STO_lower= max(dfr[dncol], calc_Lux_STO_lower)\n        else:\n            calc_Lux_STO_lower = dfr[dncol]\n        calc_Lux_STO_src = dfr[source]\n        return calc_Lux_STO_lower\n    calc_lower(None, init=1)\n    dtS[lowercol] = dtS.apply(calc_lower, axis = 1)\n    def calc_trend(dfr, init=0):\n        global calc_Lux_STO_trend\n        global calc_Lux_STO_lower\n        global calc_Lux_STO_upper\n        if init == 1:\n            calc_Lux_STO_trend = 0.0\n            calc_Lux_STO_lower = 0.0\n            calc_Lux_STO_upper = 0.0\n            return\n        if dfr[source] > calc_Lux_STO_upper:\n            calc_Lux_STO_trend = 1\n        elif dfr[source] < calc_Lux_STO_lower:\n            calc_Lux_STO_trend = 0\n        calc_Lux_STO_upper = dfr[uppercol]\n        calc_Lux_STO_lower = dfr[lowercol]\n        return calc_Lux_STO_trend\n    calc_trend(None, init=1)\n    dtS[trendcol] = dtS.apply(calc_trend, axis = 1)\n    dtS[sptcol] = dtS[trendcol] * dtS[lowercol] + (1-dtS[trendcol] ) * dtS[uppercol]\n    dtS[osc1col] = (dtS[source] - dtS[sptcol]) / (dtS[uppercol] - dtS[lowercol])\n    dtS[osc2col] = np.where(dtS[osc1col] < 1, dtS[osc1col], 1 )\n    dtS[osccol] = np.where(dtS[osc2col] > -1, dtS[osc2col], -1)\n    dtS[alphacol] = dtS[osccol].pow(2)/length\n    def calc_ama(dfr, init=0):\n        global calc_Lux_STO_ama\n        if init == 1:\n            calc_Lux_STO_ama = 0.0\n            return\n        calc_Lux_STO_ama = calc_Lux_STO_ama + dfr[alphacol] * (dfr[osccol] - calc_Lux_STO_ama)\n        return calc_Lux_STO_ama\n    calc_ama(None, init=1)\n    dtS[amacol] = dtS.apply(calc_ama, axis = 1)\n    dtS[histcol] = ta.EMA((dtS[osccol]- dtS[amacol]),timeperiod = smooth)\n\n    return dtS[osccol] * 100,  dtS[amacol] * 100 , dtS[histcol]  * 100, dtS[sptcol]\n \nclass LuxOSC(IStrategy):\n\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"cross_buy\": -100,\n        \"length_buy\": 6,\n        \"mult_buy\": 9,\n        \"smooth_buy\": 72,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"cross_sell\": 50,\n    }\n    length_buy = IntParameter(2, 100, default= int(buy_params['length_buy']), space='buy')\n    mult_buy = IntParameter(2, 100, default= int(buy_params['mult_buy']), space='buy')\n    smooth_buy = IntParameter(2, 100, default= int(buy_params['smooth_buy']), space='buy')\n    cross_buy = IntParameter(-100, 100, default= int(buy_params['cross_buy']), space='buy')\n    cross_sell = IntParameter(-100, 100, default= int(sell_params['cross_sell']), space='sell')\n    \n    stoploss = -0.99\n\n    # Trailing stoploss\n    trailing_stop = False\n   \n\n    timeframe = '5m'\n    custom_info = {}\n  \n    process_only_new_candles = False\n\n  \n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n   \n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'supertrend': {'color': 'green'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"OSC\": {\n                'osc': {'color': 'blue'},\n                'signal': {'color': 'orange'},\n                'histogram': {'color': 'green'},\n            } \n        }\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe['osc'],  dataframe['signal'] , dataframe['histogram'], dataframe['supertrend'] = LUX_SuperTrendOscillator(dataframe, length = int(self.length_buy.value), mult = int(self.mult_buy.value), smooth = int(self.smooth_buy.value)) \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                \n                (qtpylib.crossed_above(dataframe['osc'], int(self.cross_buy.value))) &  \n                (dataframe['supertrend'] >  dataframe['close'] ) &\n                (dataframe['volume'] > 0)  \n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['osc'], int(self.cross_sell.value))) &  \n                (dataframe['volume'] > 0)  \n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/MAC/MAC.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport pandas_ta as pta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass MAC(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1d'\n\n    # Minimal ROI designed for the strategy.\n    # # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.15\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 50\n\n    # Strategy parameters\n    buy_rsi = IntParameter(10, 40, default=30, space=\"buy\")\n    sell_rsi = IntParameter(60, 90, default=70, space=\"sell\")\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    @property\n    def plot_config(self):\n        return {\n            # Main plot indicators (Moving averages, ...)\n            'main_plot': {\n                'ema50': {'color': 'blue'},\n                'ema200': {'color': 'orange'},\n            },\n            'subplots': {\n                # Subplots - each dict defines one additional plot\n            }\n        }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] < 30) &  \n                (dataframe['ema50'] > dataframe['ema200']) &  \n                (dataframe['ema50'].shift() < dataframe['ema200'].shift()) &  \n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] > 70) &\n                (dataframe['ema50'] < dataframe['ema200']) &  \n                (dataframe['ema50'].shift() > dataframe['ema200'].shift()) &  \n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/MACDCCI/MACDCCI.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n__author__      = \"Kevin OssenbrÃ¼ck\"\n__copyright__   = \"Free For Use\"\n__credits__     = [\"Bloom Trading, Mohsen Hassan\"]\n__license__     = \"MIT\"\n__version__     = \"1.0\"\n__maintainer__  = \"Kevin OssenbrÃ¼ck\"\n__email__       = \"kevin.ossenbrueck@pm.de\"\n__status__      = \"Live\"\n\nclass_name = 'MACDCCI'\nclass MACDCCI(IStrategy):\n\n    # Disable ROI\n    # Could be replaced with new ROI from hyperopt.\n    minimal_roi = {\n         \"0\":  100\n    }\n\n    stoploss = -0.30\n\n    ### Do extra hyperopt for trailing seperat. Use \"--spaces default\" and then \"--spaces trailing\".\n    ### See here for more information: https://www.freqtrade.io/en/latest/hyperopt\n    trailing_stop = False\n    trailing_stop_positive = 0.08\n    trailing_stop_positive_offset = 0.10\n    trailing_only_offset_is_reached = False\n\n    ticker_interval = '30m'\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe, fastperiod=12, slowperiod=26, signalperiod=9)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        ### Add timeperiod from hyperopt (replace xx with value):\n        ### \"xx\" must be replaced even before the first hyperopt is run,\n        ### else \"xx\" would be a syntax error because it must be a Integer value.\n        dataframe['cci-buy'] = ta.CCI(dataframe, timeperiod=35)\n        dataframe['cci-sell'] = ta.CCI(dataframe, timeperiod=62)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['macd'] > dataframe['macdsignal']) &\n                (dataframe['cci-buy'] <= -100.0) # Replace with value from hyperopt.\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['macd'] < dataframe['macdsignal']) &\n                (dataframe['cci-sell'] >= 200.0) # Replace with value from hyperopt.\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MACDRSI200/MACDRSI200.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\n\n\nclass MACDRSI200(IStrategy):\n\n    ticker_interval = '5m'\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.03024,\n        \"296\": 0.02924,\n        \"596\": 0.02545,\n        \"840\": 0.02444,\n        \"966\": 0.02096,\n        \"1258\": 0.01709,\n        \"1411\": 0.01598,\n        \"1702\": 0.0122,\n        \"1893\": 0.00732,\n        \"2053\": 0.00493,\n        \"2113\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.04032\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n        macd = ta.MACD(dataframe, fastperiod=24, slowperiod=56, signalperiod=6)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['sell-rsi'] = ta.RSI(dataframe)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'].rolling(8).min() < 41) &\n                    (dataframe['close'] > dataframe['ema200']) &\n                    (qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']))\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'].rolling(8).max() > 93) &\n                    (dataframe['macd'] > 0) &\n                    (qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']))\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MACDStrategy/MACDStrategy.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\n\n\nclass MACDStrategy(IStrategy):\n    \"\"\"\n    author@: Gert Wohlgemuth\n\n    idea:\n\n        uptrend definition:\n            MACD above MACD signal\n            and CCI < -50\n\n        downtrend definition:\n            MACD below MACD signal\n            and CCI > 100\n\n    freqtrade hyperopt --strategy MACDStrategy --hyperopt-loss <someLossFunction> --spaces buy sell\n\n    The idea is to optimize only the CCI value.\n    - Buy side: CCI between -700 and 0\n    - Sell side: CCI between 0 and 700\n\n    \"\"\"\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.3\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    buy_cci = IntParameter(low=-700, high=0, default=-50, space='buy', optimize=True)\n    sell_cci = IntParameter(low=0, high=700, default=100, space='sell', optimize=True)\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_cci\": -48,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_cci\": 687,\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['macd'] > dataframe['macdsignal']) &\n                (dataframe['cci'] <= self.buy_cci.value) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['macd'] < dataframe['macdsignal']) &\n                (dataframe['cci'] >= self.sell_cci.value) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MACDStrategy_crossed/MACDStrategy_crossed.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass MACDStrategy_crossed(IStrategy):\n    \"\"\"\n        buy:\n            MACD crosses MACD signal above\n            and CCI < -50\n        sell:\n            MACD crosses MACD signal below\n            and CCI > 100\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.3\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) &\n                (dataframe['cci'] <= -50.0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']) &\n                (dataframe['cci'] >= 100.0)\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MACD_EMA/MACD_EMA.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass MACD_EMA(IStrategy):\n   \n    EMA_LONG_TERM = 200\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # MACD \n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n       \n        # EMA 200 for trend indicator\n        dataframe['ema_{}'.format(self.EMA_LONG_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_LONG_TERM\n        )\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) &\n                ((dataframe['close'] > dataframe['ema_{}'.format(self.EMA_LONG_TERM)]))\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                     qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']) &\n                (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_LONG_TERM)])\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/MACD_TRIPLE_MA/MACD_TRIPLE_MA.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass MACD_TRIPLE_MA(IStrategy):\n   \n    \n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    \n    # Optimal stoploss designed for the strategy\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.15825,\n        \"28\": 0.08491,\n        \"45\": 0.04,\n        \"88\": 0.0194,\n        \"120\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.03\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.1455\n    trailing_stop_positive_offset = 0.15434\n    trailing_only_offset_is_reached = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 26\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        SMA6 = 6\n        SMA14 = 14\n        SMA26 =26\n        # MACD \n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n       \n        # SMA - Simple Moving Average\n        dataframe['sma6'] = ta.SMA(dataframe, timeperiod=SMA6)\n        dataframe['sma26'] = ta.SMA(dataframe, timeperiod=SMA26)\n        dataframe['sma14'] = ta.SMA(dataframe, timeperiod=SMA14)\n        \n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) &\n                qtpylib.crossed_above(dataframe['sma6'], dataframe['sma14']) &\n                (dataframe['sma26'] > dataframe['sma6']) \n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                     qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']) &\n                qtpylib.crossed_below(dataframe['sma6'], dataframe['sma14']) &\n                (dataframe['sma26'] < dataframe['sma6']) &\n                (dataframe['sma26'] < dataframe['sma14'])\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/MACD_TRI_EMA/MACD_TRI_EMA.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass MACD_TRI_EMA(IStrategy):\n    \"\"\"\n\n    \n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"120\": 0.0,\n        \"30\": 0.04,\n        \"15\": 0.06,\n        \"10\": 0.15,\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.03\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        \n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=13)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) &\n                    (dataframe['close'].shift(1) > dataframe['tema'].shift(1)) \n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                   qtpylib.crossed_above(dataframe['macdsignal'], dataframe['macd'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/MADisplaceV3/MADisplaceV3.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nimport pandas as pd\n\n# inspired by @tirail SMAOffset\n\nbuy_params = {\n    \"ma_lower_length\": 15,\n    \"ma_lower_offset\": 0.96,\n\n    \"informative_fast_length\": 20,\n    \"informative_slow_length\": 25,\n\n    \"rsi_fast_length\": 4,\n    \"rsi_fast_threshold\": 35,\n    \"rsi_slow_length\": 20,\n    \"rsi_slow_confirmation\": 1\n}\n\nsell_params = {\n    \"ma_middle_1_length\": 30,\n    \"ma_middle_1_offset\": 0.995,\n    \"ma_upper_length\": 20,\n    \"ma_upper_offset\": 1.01,\n}\n\n\nclass MADisplaceV3(IStrategy):\n\n    ma_lower_length = IntParameter(15, 25, default=buy_params['ma_lower_length'], space='buy')\n    ma_lower_offset = DecimalParameter(0.95, 0.97, default=buy_params['ma_lower_offset'], space='buy')\n\n    informative_fast_length = IntParameter(15, 35, default=buy_params['informative_fast_length'], space='disable')\n    informative_slow_length = IntParameter(20, 40, default=buy_params['informative_slow_length'], space='disable')\n\n    rsi_fast_length = IntParameter(2, 8, default=buy_params['rsi_fast_length'], space='disable')\n    rsi_fast_threshold = IntParameter(5, 35, default=buy_params['rsi_fast_threshold'], space='disable')\n    rsi_slow_length = IntParameter(10, 45, default=buy_params['rsi_slow_length'], space='disable')\n    rsi_slow_confirmation = IntParameter(1, 5, default=buy_params['rsi_slow_confirmation'], space='disable')\n\n    ma_middle_1_length = IntParameter(15, 35, default=sell_params['ma_middle_1_length'], space='sell')\n    ma_middle_1_offset = DecimalParameter(0.93, 1.005, default=sell_params['ma_middle_1_offset'], space='sell')\n    ma_upper_length = IntParameter(15, 25, default=sell_params['ma_upper_length'], space='sell')\n    ma_upper_offset = DecimalParameter(1.005, 1.025, default=sell_params['ma_upper_offset'], space='sell')\n\n    minimal_roi = {\"0\": 1}\n\n    stoploss = -0.2\n\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n    trailing_only_offset_is_reached = True\n\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n\n    process_only_new_candles = True\n\n    plot_config = {\n        'main_plot': {\n            'ma_lower': {'color': 'red'},\n            'ma_middle_1': {'color': 'green'},\n            'ma_upper': {'color': 'pink'},\n        },\n    }\n\n    use_custom_stoploss = True\n    startup_candle_count = 200\n\n    informative_timeframe = '1h'\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe = self.informative_dataframe.copy()\n        else:\n            dataframe = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        dataframe['ema_fast'] = ta.EMA(dataframe, timeperiod=int(self.informative_fast_length.value))\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=int(self.informative_slow_length.value))\n\n        dataframe['uptrend'] = (\n            (dataframe['ema_fast'] > dataframe['ema_slow'])\n        ).astype('int')\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if current_profit < -0.04 and current_time - timedelta(minutes=35) > trade.open_date_utc:\n            return -0.01\n\n        return -0.99\n\n    def get_main_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=int(self.rsi_fast_length.value))\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=int(self.rsi_slow_length.value))\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=int(self.ma_lower_length.value)) * self.ma_lower_offset.value\n        dataframe['ma_middle_1'] = ta.SMA(dataframe, timeperiod=int(self.ma_middle_1_length.value)) * self.ma_middle_1_offset.value\n        dataframe['ma_upper'] = ta.SMA(dataframe, timeperiod=int(self.ma_upper_length.value)) * self.ma_upper_offset.value\n\n        # drop NAN in hyperopt to fix \"'<' not supported between instances of 'str' and 'int' error\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe = dataframe.dropna()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if self.config['runmode'].value == 'hyperopt':\n\n            self.informative_dataframe = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        if self.config['runmode'].value != 'hyperopt':\n\n            informative = self.get_informative_indicators(metadata)\n            dataframe = self.merge_informative(informative, dataframe)\n            dataframe = self.get_main_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # calculate indicators with adjustable params for hyperopt\n        # it's calling multiple times and dataframe overrides same columns\n        # so check if any calculated column already exist\n\n        if self.config['runmode'].value == 'hyperopt' and 'uptrend' not in dataframe:\n            informative = self.get_informative_indicators(metadata)\n            dataframe = self.merge_informative(informative, dataframe)\n            dataframe = self.get_main_indicators(dataframe, metadata)\n            pd.options.mode.chained_assignment = None\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_slow_descending'].rolling(self.rsi_slow_confirmation.value).sum() == self.rsi_slow_confirmation.value)\n                &\n                (dataframe['rsi_fast'] < self.rsi_fast_threshold.value)\n                &\n                (dataframe['uptrend'] > 0)\n                &\n                (dataframe['close'] < dataframe['ma_lower'])\n                &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if self.config['runmode'].value == 'hyperopt' and 'uptrend' not in dataframe:\n            informative = self.get_informative_indicators(metadata)\n            dataframe = self.merge_informative(informative, dataframe)\n            dataframe = self.get_main_indicators(dataframe, metadata)\n            pd.options.mode.chained_assignment = None\n\n        dataframe.loc[\n            (\n                (\n                    (dataframe['uptrend'] == 0)\n                    |\n                    (dataframe['close'] > dataframe['ma_upper'])\n                    |\n                    (qtpylib.crossed_below(dataframe['close'], dataframe['ma_middle_1']))\n\n                )\n                &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n    def merge_informative(self, informative: DataFrame, dataframe: DataFrame) -> DataFrame:\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe,\n                                           ffill=True)\n\n        # don't overwrite the base dataframe's HLCV information\n        skip_columns = [(s + \"_\" + self.informative_timeframe) for s in\n                        ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.rename(\n            columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s,\n            inplace=True)\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MFI/MFI.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\n\n\nclass MFI(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/BbandRsi.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"1440\": 0.01,\n        \"80\": 0.02,\n        \"40\": 0.03,\n        \"20\": 0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strateg\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['MFI'] = ta.MFI(dataframe, timeperiod=14)\n\n\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n\n                (dataframe['MFI'].shift() <= 14)\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['MFI'] >= 75)\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Macd/Macd.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import timedelta, datetime, timezone\n\n# --------------------------------\n\n\nclass Macd(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n    https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AwesomeMacd.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.1\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    use_custom_stoploss = True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        \"\"\"\n        Custom stoploss logic, returning the new distance relative to current_rate (as ratio).\n        e.g. returning -0.05 would create a stoploss 5% below current_rate.\n        The custom stoploss can never be below self.stoploss, which serves as a hard maximum loss.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns the initial stoploss value\n        Only called when use_custom_stoploss is set to True.\n\n        :param pair: Pair that's currently analyzed\n        :param trade: trade object.\n        :param current_time: datetime object, containing the current datetime\n        :param current_rate: Rate, calculated based on pricing settings in ask_strategy.\n        :param current_profit: Current profit (as ratio), calculated based on current_rate.\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return float: New stoploss value, relative to the currentrate\n        \"\"\"\n        if current_profit > 0.3: \n            return -0.01 + current_profit\n        # if pair in ('ONE/USDT', 'MATIC/USDT', 'CHZ/USDT', 'ENJ/USDT'):\n        #     return -0.10\n        return 1\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        # get access to all 5mirs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1d') for pair in pairs]\n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        macd = ta.MACD(dataframe)\n\n        #---------------- INFORMATIVE ----------------\n        inf_tf2 = '1d'\n        # Get the informative pair\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf2)\n        # Get the 14 day rsi\n        #6, 25\n\n        macd1d = ta.MACD(informative, 12, 26, 9)\n        informative['macdhist'] = macd1d['macdhist']\n        informative['macd'] = macd1d['macd']\n        informative['macdsignal'] = macd1d['macdsignal']\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf2, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (\n                        dataframe['macdhist_1d'] > 0\n                         \n                    )\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['macdhist_1d'] < 0) \n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/MacheteV8b/MacheteV8b.py",
    "content": "\nfrom typing import Dict, List, Optional, Tuple\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom pandas import DataFrame, Series\nimport numpy as np\n\n## Indicator libs\nimport talib.abstract as ta\nfrom finta import TA as fta\nimport technical.indicators as ftt\nfrom technical.indicators import hull_moving_average\nfrom technical.indicators import PMAX, zema\nfrom technical.indicators import cmf\n\n## FT stuffs\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom skopt.space import Dimension\n\n\n\"\"\"\nNOTE:\ndocker-compose run --rm freqtrade hyperopt -c user_data/config-backtesting.json --strategy IchimokuHaulingV8a --hyperopt-loss SortinoHyperOptLossDaily --spaces roi buy sell --timerange=1624940400-1630447200 -j 4 -e 1000\n\"\"\"\nclass MacheteV8b(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_should_use_get_buy_signal_quickie\": True, #0/0/0\n        \"buy_should_use_get_buy_signal_scalp\": True, #2/0/0\n        \"buy_should_use_get_buy_signal_adx_smas\": True, #18/0/2\n        \"buy_should_use_get_buy_signal_awesome_macd\": True, #3/0/1\n        \"buy_should_use_get_buy_signal_gettin_moist\": True, #6/0/0\n        \"buy_should_use_get_buy_signal_hlhb\": True, #3/0/1\n\n        \"buy_should_use_get_buy_signal_adx_momentum\": False, #32/1/3\n        \"buy_should_use_get_buy_signal_asdts_rockwelltrading\": False, #24/0/3\n        \"buy_should_use_get_buy_signal_averages_strategy\": False, #2/0/2\n        \"buy_should_use_get_buy_signal_fisher_hull\": False, #7/0/4\n        \"buy_should_use_get_buy_signal_macd_strategy\": False, #2/0/0\n        \"buy_should_use_get_buy_signal_macd_strategy_crossed\": False, #0/0/0\n        \"buy_should_use_get_buy_signal_pmax\": False, #2/0/0\n        \"buy_should_use_get_buy_signal_simple\": False, #23/0/2\n        \"buy_should_use_get_buy_signal_strategy001\": False, #0/0/0\n        \"buy_should_use_get_buy_signal_technical_example_strategy\": False, #36/0/7\n        \"buy_should_use_get_buy_signal_tema_rsi_strategy\": False, #0/0/0\n\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"cstp_bail_how\": \"roc\",\n        \"cstp_bail_roc\": -0.032,\n        \"cstp_bail_time\": 1108,\n        \"cstp_bb_trailing_input\": \"bb_lowerband_neutral_inf\",\n        \"cstp_threshold\": -0.036,\n        \"cstp_trailing_max_stoploss\": 0.054,\n        \"cstp_trailing_only_offset_is_reached\": 0.06,\n        \"cstp_trailing_stop_profit_devider\": 2,\n        \"droi_pullback\": True,\n        \"droi_pullback_amount\": 0.005,\n        \"droi_pullback_respect_table\": False,\n        \"droi_trend_type\": \"any\",\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.279,\n        \"92\": 0.109,\n        \"245\": 0.059,\n        \"561\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.1#-0.046\n\n    # Trailing stop:\n    trailing_stop = False\n    #trailing_stop_positive = 0.0247\n    #trailing_stop_positive_offset = 0.0248\n    #trailing_only_offset_is_reached = True\n\n    use_custom_stoploss = True\n\n    # buy signal\n    buy_should_use_get_buy_signal_awesome_macd = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_awesome_macd'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_adx_momentum = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_adx_momentum'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_adx_smas = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_adx_smas'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_asdts_rockwelltrading = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_asdts_rockwelltrading'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_averages_strategy = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_averages_strategy'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_fisher_hull = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_fisher_hull'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_gettin_moist = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_gettin_moist'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_hlhb = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_hlhb'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_macd_strategy_crossed = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_macd_strategy_crossed'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_macd_strategy = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_macd_strategy'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_pmax = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_pmax'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_quickie = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_quickie'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_scalp = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_scalp'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_simple = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_simple'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_strategy001 = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_strategy001'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_technical_example_strategy = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_technical_example_strategy'], space='buy', optimize=True)\n    buy_should_use_get_buy_signal_tema_rsi_strategy = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_tema_rsi_strategy'], space='buy', optimize=True)\n\n    # Dynamic ROI\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default=sell_params['droi_trend_type'], space='sell', optimize=True)\n    droi_pullback = CategoricalParameter([True, False], default=sell_params['droi_pullback'], space='sell', optimize=True)\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=sell_params['droi_pullback_amount'], space='sell')\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=sell_params['droi_pullback_respect_table'], space='sell', optimize=True)\n\n    # Custom Stoploss\n    cstp_threshold = DecimalParameter(-0.05, 0, default=sell_params['cstp_threshold'], space='sell')\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default=sell_params['cstp_bail_how'], space='sell', optimize=True)\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=sell_params['cstp_bail_roc'], space='sell')\n    cstp_bail_time = IntParameter(720, 1440, default=sell_params['cstp_bail_time'], space='sell')\n    cstp_trailing_only_offset_is_reached = DecimalParameter(0.01, 0.06, default=sell_params['cstp_trailing_only_offset_is_reached'], space='sell')\n    cstp_trailing_stop_profit_devider = IntParameter(2, 4, default=sell_params['cstp_trailing_stop_profit_devider'], space='sell')\n    cstp_trailing_max_stoploss = DecimalParameter(0.02, 0.08, default=sell_params['cstp_trailing_max_stoploss'], space='sell')\n    cstp_bb_trailing_input = CategoricalParameter(['bb_lowerband_trend', 'bb_lowerband_trend_inf', 'bb_lowerband_neutral', 'bb_lowerband_neutral_inf', 'bb_upperband_neutral_inf'], default=sell_params['cstp_bb_trailing_input'], space='sell', optimize=True)\n\n    # nested hyperopt class\n    class HyperOpt:\n\n        # defining as dummy, so that no error is thrown about missing\n        # sell indicator space when hyperopting for all spaces\n        @staticmethod\n        def indicator_space() -> List[Dimension]:\n            return []\n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    startup_candle_count = 500#149\n\n    use_dynamic_roi = True\n\n    timeframe = '15m'\n    informative_timeframe = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    plot_config = {\n        'main_plot': {\n            'chikou_span_inf': {'color': 'green'},\n            'tenkan_sen_inf': {'color': 'blue'},\n            'kijun_sen_inf': {'color': 'red'},\n            'senkou_a_inf': {\n                'color': 'green',\n                'fill_to': 'senkou_b',\n                'fill_label': 'Kumo',\n                'fill_color': 'rgba(51, 255, 117, 0.2)',\n            },\n            'senkou_b_inf': {'color': 'red'},\n            'leading_senkou_span_a_inf': {'color': 'green'},\n            'leading_senkou_span_b_inf': {'color': 'red'},\n            'sslUp_inf': {'color': 'green'},\n            'sslDown_inf': {'color': 'red'}\n        },\n        'subplots': {\n            'summary': {\n                'cloud_green_inf': {},\n                'cloud_red_inf': {},\n                'future_green_inf': {},\n                'chikou_high_inf': {},\n                'go_long_inf': {}\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n\n    #\n    # Processing indicators\n    #\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n\n        if not self.dp:\n            return dataframe\n\n        dataframe = self.get_buy_signal_indicators(dataframe, metadata)\n\n        informative_tmp = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n        informative = self.get_market_condition_indicators(informative_tmp.copy(), metadata)\n        informative = self.get_custom_stoploss_indicators(informative, metadata)\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n\n        dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"_inf\"), inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc_inf'] = dataframe[['date', 'roc_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr_inf'] = dataframe[['date', 'atr_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc_inf'] = dataframe[['date', 'sroc_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir_inf'] = dataframe[['date', 'ssl-dir_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend_inf'] = dataframe[['date', 'rmi-up-trend_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend_inf'] = dataframe[['date', 'candle-up-trend_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_trend_inf'] = dataframe[['date', 'bb_lowerband_trend_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_trend_inf'] = dataframe[['date', 'bb_lowerband_trend_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_neutral_inf'] = dataframe[['date', 'bb_lowerband_neutral_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_neutral_inf'] = dataframe[['date', 'bb_lowerband_neutral_inf']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['bb_upperband_neutral_inf'] = dataframe[['date', 'bb_upperband_neutral_inf']].copy().set_index('date')\n\n        return dataframe\n\n    def get_buy_signal_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # get_buy_signal_awesome_macd\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # get_buy_signal_adx_momentum\n        #dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        # get_buy_signal_adx_smas\n        #dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['short'] = ta.SMA(dataframe, timeperiod=3)\n        dataframe['long'] = ta.SMA(dataframe, timeperiod=6)\n\n        # get_buy_signal_asdts_rockwelltrading\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n\n        # get_buy_signal_averages_strategy\n        dataframe['maShort'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['maMedium'] = ta.EMA(dataframe, timeperiod=21)\n\n        # get_buy_signal_fisher_hull\n        dataframe['hma'] = hull_moving_average(dataframe, 14, 'close')\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=14)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # get_buy_signal_gettin_moist\n        dataframe['color'] = dataframe['close'] > dataframe['open']\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n        dataframe['rsi_7'] = ta.RSI(dataframe, timeperiod=7)\n        dataframe['roc_6'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['primed'] = np.where(dataframe['color'].rolling(3).sum() == 3,1,0)\n        dataframe['in-the-mood'] = dataframe['rsi_7'] > dataframe['rsi_7'].rolling(12).mean()\n        dataframe['moist'] = qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal'])\n        dataframe['throbbing'] = dataframe['roc_6'] > dataframe['roc_6'].rolling(12).mean()\n        dataframe['ready-to-go'] = np.where(dataframe['close'] > dataframe['open'].rolling(12).mean(), 1,0)\n\n        # get_buy_signal_hlhb\n        dataframe['hl2'] = (dataframe[\"close\"] + dataframe[\"open\"]) / 2\n        dataframe['rsi_10'] = ta.RSI(dataframe, timeperiod=10, price='hl2')\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        #dataframe['adx'] = ta.ADX(dataframe)\n\n        # get_buy_signal_macd_strategy_crossed\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n        #dataframe['cci'] = ta.CCI(dataframe)\n\n        # get_buy_signal_macd_strategy\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n        #dataframe['cci'] = ta.CCI(dataframe)\n\n        # get_buy_signal_pmax\n        dataframe['ZLEMA'] = zema(dataframe, period=10)\n        dataframe = PMAX(dataframe, period=10, multiplier=3, length=10, MAtype=9, src=2)\n\n        # get_buy_signal_quickie\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n        dataframe['sma_50'] = ta.SMA(dataframe, timeperiod=200)\n        #dataframe['adx'] = ta.ADX(dataframe)\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # get_buy_signal_scalp\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        #dataframe['adx'] = ta.ADX(dataframe)\n\n        # get_buy_signal_simple\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n        #dataframe['rsi_7'] = ta.RSI(dataframe, timeperiod=7)\n        #bollinger = qtpylib.bollinger_bands(dataframe['close'], window=12, stds=2)\n        #dataframe['bb_lowerband'] = bollinger['lower']\n        #dataframe['bb_upperband'] = bollinger['upper']\n        #dataframe['bb_middleband'] = bollinger['mid']\n\n        # get_buy_signal_strategy001\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n\n        # get_buy_signal_technical_example_strategy\n        dataframe['cmf'] = cmf(dataframe, 21)\n\n        # get_buy_signal_tema_rsi_strategy\n        #dataframe['rsi'] = ta.RSI(dataframe)\n        #bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        #dataframe['bb_lowerband'] = bollinger['lower']\n        #dataframe['bb_middleband'] = bollinger['mid']\n        #dataframe['bb_upperband'] = bollinger['upper']\n        #dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        return dataframe\n\n    def get_market_condition_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        displacement = 30\n        ichimoku = ftt.ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=displacement)\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\n\n        ssl = SSLChannels_ATR(dataframe, 10)\n        dataframe['sslDown'] = ssl[0]\n        dataframe['sslUp'] = ssl[1]\n\n        #dataframe['vfi'] = fta.VFI(dataframe, period=14)\n\n        # Summary indicators\n        dataframe['future_green'] = ichimoku['cloud_green'].shift(displacement).fillna(0).astype('int') * 2\n        dataframe['chikou_high'] = ((dataframe['chikou_span'] > dataframe['senkou_a']) & (dataframe['chikou_span'] > dataframe['senkou_b'])).shift(displacement).fillna(0).astype('int')\n        dataframe['go_long'] = ((dataframe['tenkan_sen'] > dataframe['kijun_sen']) & (dataframe['close'] > dataframe['leading_senkou_span_a']) & (dataframe['close'] > dataframe['leading_senkou_span_b']) & (dataframe['future_green'] > 0) & (dataframe['chikou_high'] > 0)).fillna(0).astype('int') * 3\n        dataframe['max'] = dataframe['high'].rolling(3).max()\n        dataframe['min'] = dataframe['low'].rolling(6).min()\n        dataframe['upper'] = np.where(dataframe['max'] > dataframe['max'].shift(),1,0)\n        dataframe['lower'] = np.where(dataframe['min'] < dataframe['min'].shift(),1,0)\n        dataframe['up_trend'] = np.where(dataframe['upper'].rolling(5, min_periods=1).sum() != 0,1,0)\n        dataframe['dn_trend'] = np.where(dataframe['lower'].rolling(5, min_periods=1).sum() != 0,1,0)\n\n        return dataframe\n\n    def get_custom_stoploss_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger_neutral = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband_neutral'] = bollinger_neutral['lower']\n        dataframe['bb_middleband_neutral'] = bollinger_neutral['mid']\n        dataframe['bb_upperband_neutral'] = bollinger_neutral['upper']\n        bollinger_trend = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband_trend'] = bollinger_trend['lower']\n        dataframe['bb_middleband_trend'] = bollinger_trend['mid']\n        dataframe['bb_upperband_trend'] = bollinger_trend['upper']\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)\n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')\n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)\n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0)\n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)\n\n        return dataframe\n\n\n    #\n    # Processing buy signals\n    #\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (self.get_buy_signal_awesome_macd(dataframe) == True)\n                | (self.get_buy_signal_adx_momentum(dataframe) == True)\n                | (self.get_buy_signal_adx_smas(dataframe) == True)\n                | (self.get_buy_signal_asdts_rockwelltrading(dataframe) == True)\n                | (self.get_buy_signal_averages_strategy(dataframe) == True)\n                | (self.get_buy_signal_fisher_hull(dataframe) == True)\n                | (self.get_buy_signal_gettin_moist(dataframe) == True)\n                | (self.get_buy_signal_hlhb(dataframe) == True)\n                | (self.get_buy_signal_macd_strategy_crossed(dataframe) == True)\n                | (self.get_buy_signal_macd_strategy(dataframe) == True)\n                | (self.get_buy_signal_pmax(dataframe) == True)\n                | (self.get_buy_signal_quickie(dataframe) == True)\n                | (self.get_buy_signal_scalp(dataframe) == True)\n                | (self.get_buy_signal_simple(dataframe) == True)\n                | (self.get_buy_signal_strategy001(dataframe) == True)\n                | (self.get_buy_signal_technical_example_strategy(dataframe) == True)\n                | (self.get_buy_signal_tema_rsi_strategy(dataframe) == True)\n            ) &\n            (dataframe['sslUp_inf'] > dataframe['sslDown_inf']) &\n            (dataframe['up_trend_inf'] > 0) &\n            (dataframe['go_long_inf'] > 0)\n            # NOTE: I keep the volume checks of feels like it has not much benifit when trading leverage tokens, maybe im wrong!?\n            #(dataframe['vfi'] < 0.0) &\n            #(dataframe['volume'] > 0)\n        ,'buy'] = 1\n\n        return dataframe\n\n    def get_buy_signal_awesome_macd(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_awesome_macd.value == True) &\n            (dataframe['macd'] > 0) &\n            (dataframe['ao'] > 0) &\n            (dataframe['ao'].shift() < 0)\n        )\n        return signal\n\n    def get_buy_signal_adx_momentum(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_adx_momentum.value == True) &\n            (dataframe['adx'] > 25) &\n            (dataframe['mom'] > 0) &\n            (dataframe['plus_di'] > 25) &\n            (dataframe['plus_di'] > dataframe['minus_di'])\n        )\n        return signal\n\n    def get_buy_signal_adx_smas(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_adx_smas.value == True) &\n            (dataframe['adx'] > 25) &\n            (qtpylib.crossed_above(dataframe['short'], dataframe['long']))\n        )\n        return signal\n\n    def get_buy_signal_asdts_rockwelltrading(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_asdts_rockwelltrading.value == True) &\n            (dataframe['macd'] > 0) &\n            (dataframe['macdhist'].shift(1) < dataframe['macdhist']) &\n            (dataframe['macd'] > dataframe['macdsignal'])\n        )\n        return signal\n\n    def get_buy_signal_averages_strategy(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_averages_strategy.value == True) &\n            qtpylib.crossed_above(dataframe['maShort'], dataframe['maMedium'])\n        )\n        return signal\n\n    def get_buy_signal_fisher_hull(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_fisher_hull.value == True) &\n            (dataframe['hma'] < dataframe['hma'].shift()) &\n            (dataframe['cci'] <= -50.0) &\n            (dataframe['fisher_rsi'] < -0.5)\n        )\n        return signal\n\n    def get_buy_signal_gettin_moist(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_gettin_moist.value == True) &\n            (dataframe['primed']) &\n            (dataframe['moist']) &\n            (dataframe['throbbing']) &\n            (dataframe['ready-to-go'])\n        )\n        return signal\n\n    def get_buy_signal_hlhb(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_hlhb.value == True) &\n            (qtpylib.crossed_above(dataframe['rsi_10'], 50)) &\n            (qtpylib.crossed_above(dataframe['ema5'], dataframe['ema10'])) &\n            (dataframe['adx'] > 25)\n        )\n        return signal\n\n    def get_buy_signal_macd_strategy_crossed(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_macd_strategy_crossed.value == True) &\n            qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']) &\n            (dataframe['cci'] <= -50.0)\n        )\n        return signal\n\n    def get_buy_signal_macd_strategy(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_macd_strategy.value == True) &\n            (dataframe['macd'] > dataframe['macdsignal']) &\n            (dataframe['cci'] <= -50.0)\n        )\n        return signal\n\n    def get_buy_signal_pmax(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_pmax.value == True) &\n            (qtpylib.crossed_above(dataframe['ZLEMA'], dataframe['pm_10_3_10_9']))\n        )\n        return signal\n\n    def get_buy_signal_quickie(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_quickie.value == True) &\n            (dataframe['adx'] > 30) &\n            (dataframe['tema'] < dataframe['bb_middleband']) &\n            (dataframe['tema'] > dataframe['tema'].shift(1)) &\n            (dataframe['sma_200'] > dataframe['close'])\n        )\n        return signal\n\n    def get_buy_signal_scalp(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_scalp.value == True) &\n            (dataframe['open'] < dataframe['ema_low']) &\n            (dataframe['adx'] > 30) &\n            (\n                (dataframe['fastk'] < 30) &\n                (dataframe['fastd'] < 30) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n            )\n        )\n        return signal\n\n    def get_buy_signal_simple(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_simple.value == True) &\n            (dataframe['macd'] > 0)  # over 0\n            & (dataframe['macd'] > dataframe['macdsignal'])  # over signal\n            & (dataframe['bb_upperband'] > dataframe['bb_upperband'].shift(1))  # pointed up\n            & (dataframe['rsi_7'] > 70)  # optional filter, need to investigate\n\n        )\n        return signal\n\n    def get_buy_signal_strategy001(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_strategy001.value == True) &\n            qtpylib.crossed_above(dataframe['ema50'], dataframe['ema100']) &\n            (dataframe['ha_close'] < dataframe['ema20']) &\n            (dataframe['ha_open'] > dataframe['ha_close'])  # red bar\n        )\n        return signal\n\n    def get_buy_signal_technical_example_strategy(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_technical_example_strategy.value == True) &\n            (dataframe['cmf'] < 0)\n        )\n        return signal\n\n    def get_buy_signal_tema_rsi_strategy(self, dataframe: DataFrame):\n        signal = (\n            (self.buy_should_use_get_buy_signal_tema_rsi_strategy.value == True) &\n            (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30\n            (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n            (dataframe['tema'] > dataframe['tema'].shift(1))\n        )\n        return signal\n\n\n    #\n    # Processing sell signals\n    #\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (qtpylib.crossed_above(dataframe['sslDown_inf'], dataframe['sslUp_inf']))\n            & (\n                (qtpylib.crossed_below(dataframe['tenkan_sen_inf'], dataframe['kijun_sen_inf']))\n                |(qtpylib.crossed_below(dataframe['close_inf'], dataframe['kijun_sen_inf']))\n            ) #&\n\n            # NOTE: I keep the volume checks of feels like it has not much benifit when trading leverage tokens, maybe im wrong!?\n            #(dataframe['vfi'] < 0.0) &\n            #(dataframe['volume'] > 0)\n\n        ,'sell'] = 1\n\n        return dataframe\n\n\n    #\n    # Custom Stoploss\n    #\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc_inf'].iat[-1]\n            bb_trailing = dataframe[self.cstp_bb_trailing_input.value].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc_inf'].loc[current_time]['sroc_inf']\n            bb_trailing = self.custom_trade_info[trade.pair][self.cstp_bb_trailing_input.value].loc[current_time][self.cstp_bb_trailing_input.value]\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n\n        if current_profit < self.cstp_trailing_only_offset_is_reached.value:\n            if current_rate <= bb_trailing:\n                return 0.001\n            else:\n                return -1\n\n        desired_stoploss = current_profit / self.cstp_trailing_stop_profit_devider.value\n        return max(min(desired_stoploss, self.cstp_trailing_max_stoploss.value), 0.025)\n\n\n    #\n    # Dynamic ROI\n    #\n\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend_inf'].iat[-1]\n                candle_trend = dataframe['candle-up-trend_inf'].iat[-1]\n                ssl_dir = dataframe['ssl-dir_inf'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend_inf'].loc[current_time]['rmi-up-trend_inf']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend_inf'].loc[current_time]['candle-up-trend_inf']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir_inf'].loc[current_time]['ssl-dir_inf']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi\n\n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n\n    #\n    # Custom trade info\n    #\n\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n\n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n\n#\n# Custom indicators\n#\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc\n"
  },
  {
    "path": "strategies/MacheteV8bRallimod2/MacheteV8bRallimod2.py",
    "content": "\r\nfrom typing import Dict, List, Optional, Tuple\r\nfrom datetime import datetime, timedelta\r\nfrom cachetools import TTLCache\r\nfrom pandas import DataFrame, Series\r\nimport numpy as np\r\n\r\n## Indicator libs\r\nimport talib.abstract as ta\r\nfrom finta import TA as fta\r\nimport technical.indicators as ftt\r\nfrom technical.indicators import hull_moving_average\r\nfrom technical.indicators import PMAX, zema\r\nfrom technical.indicators import cmf\r\n\r\n## FT stuffs\r\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, stoploss_from_open, IntParameter, DecimalParameter, CategoricalParameter\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nfrom freqtrade.exchange import timeframe_to_minutes\r\nfrom freqtrade.persistence import Trade\r\nfrom skopt.space import Dimension\r\n\r\n###   @Rallipanos mod\r\n\"\"\"\r\nNOTE:\r\ndocker-compose run --rm freqtrade hyperopt -c user_data/config-backtesting.json --strategy IchimokuHaulingV8a --hyperopt-loss SortinoHyperOptLossDaily --spaces roi buy sell --timerange=1624940400-1630447200 -j 4 -e 1000\r\n\"\"\"\r\nclass MacheteV8bRallimod2(IStrategy):\r\n\r\n    # Buy hyperspace params:\r\n    buy_params = {\r\n        \"buy_should_use_get_buy_signal_offset_strategy\": True,\r\n        \"buy_should_use_get_buy_signal_bbrsi_strategy\": False,\r\n        \"ewo_high\": 2.327,\r\n        \"rsi_buy\": 45,\r\n        \"base_nb_candles_buy\": 14,\r\n        \"low_offset\": 0.965\r\n    }\r\n\r\n    # Sell hyperspace params:\r\n    sell_params = {\r\n        \"cstp_bail_how\": \"roc\",\r\n        \"cstp_bail_roc\": -0.032,\r\n        \"cstp_bail_time\": 1108,\r\n        \"cstp_bb_trailing_input\": \"bb_lowerband_neutral_inf\",\r\n        \"cstp_threshold\": -0.036,\r\n        \"cstp_trailing_max_stoploss\": 0.054,\r\n        \"cstp_trailing_only_offset_is_reached\": 0.09,\r\n        \"cstp_trailing_stop_profit_devider\": 2,\r\n        \"droi_pullback\": True,\r\n        \"droi_pullback_amount\": 0.01,\r\n        \"droi_pullback_respect_table\": False,\r\n        \"droi_trend_type\": \"any\",\r\n        \"base_nb_candles_sell\": 24,\r\n        \"high_offset\": 0.991,\r\n        \"high_offset_2\": 0.995\r\n    }\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.279,\r\n        \"92\": 0.109,\r\n        \"245\": 0.059,\r\n        \"561\": 0.02\r\n    }\r\n\r\n    # Stoploss:\r\n    stoploss = -0.05#-0.046\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    #trailing_stop_positive = 0.0247\r\n    #trailing_stop_positive_offset = 0.0248\r\n    #trailing_only_offset_is_reached = True\r\n\r\n    use_custom_stoploss = False\r\n\r\n    # buy signal\r\n\r\n    buy_should_use_get_buy_signal_offset_strategy = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_offset_strategy'], space='buy', optimize=True)\r\n    buy_should_use_get_buy_signal_bbrsi_strategy = CategoricalParameter([True, False], default=buy_params['buy_should_use_get_buy_signal_bbrsi_strategy'], space='buy', optimize=True)\r\n\r\n    # Dynamic ROI\r\n    droi_trend_type = CategoricalParameter(['rmi', 'ssl', 'candle', 'any'], default=sell_params['droi_trend_type'], space='sell', optimize=True)\r\n    droi_pullback = CategoricalParameter([True, False], default=sell_params['droi_pullback'], space='sell', optimize=True)\r\n    droi_pullback_amount = DecimalParameter(0.005, 0.02, default=sell_params['droi_pullback_amount'], space='sell')\r\n    droi_pullback_respect_table = CategoricalParameter([True, False], default=sell_params['droi_pullback_respect_table'], space='sell', optimize=True)\r\n\r\n    # Custom Stoploss\r\n    cstp_threshold = DecimalParameter(-0.05, 0, default=sell_params['cstp_threshold'], space='sell')\r\n    cstp_bail_how = CategoricalParameter(['roc', 'time', 'any'], default=sell_params['cstp_bail_how'], space='sell', optimize=True)\r\n    cstp_bail_roc = DecimalParameter(-0.05, -0.01, default=sell_params['cstp_bail_roc'], space='sell')\r\n    cstp_bail_time = IntParameter(720, 1440, default=sell_params['cstp_bail_time'], space='sell')\r\n    cstp_trailing_only_offset_is_reached = DecimalParameter(0.01, 0.06, default=sell_params['cstp_trailing_only_offset_is_reached'], space='sell')\r\n    cstp_trailing_stop_profit_devider = IntParameter(2, 4, default=sell_params['cstp_trailing_stop_profit_devider'], space='sell')\r\n    cstp_trailing_max_stoploss = DecimalParameter(0.02, 0.08, default=sell_params['cstp_trailing_max_stoploss'], space='sell')\r\n    cstp_bb_trailing_input = CategoricalParameter(['bb_lowerband_trend', 'bb_lowerband_trend_inf', 'bb_lowerband_neutral', 'bb_lowerband_neutral_inf', 'bb_upperband_neutral_inf'], default=sell_params['cstp_bb_trailing_input'], space='sell', optimize=True)\r\n\r\n    fast_ewo = 50\r\n    slow_ewo = 200\r\n    ewo_high = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\r\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\r\n    base_nb_candles_buy = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\r\n\r\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\r\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\r\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\r\n    # nested hyperopt class\r\n    class HyperOpt:\r\n\r\n        # defining as dummy, so that no error is thrown about missing\r\n        # sell indicator space when hyperopting for all spaces\r\n        @staticmethod\r\n        def indicator_space() -> List[Dimension]:\r\n            return []\r\n\r\n    custom_trade_info = {}\r\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\r\n\r\n    # run \"populate_indicators\" only for new candle\r\n    process_only_new_candles = False\r\n\r\n    # Experimental settings (configuration will overide these if set)\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n    startup_candle_count = 200#149\r\n\r\n    use_dynamic_roi = True\r\n\r\n    timeframe = '5m'\r\n    informative_timeframe = '1h'\r\n\r\n    # Optional order type mapping\r\n    order_types = {\r\n        'buy': 'limit',\r\n        'sell': 'limit',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False\r\n    }\r\n\r\n\r\n\r\n    def informative_pairs(self):\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\r\n        return informative_pairs\r\n\r\n\r\n    #\r\n    # Processing indicators\r\n    #\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\r\n\r\n        if not self.dp:\r\n            return dataframe\r\n\r\n        dataframe = self.get_buy_signal_indicators(dataframe, metadata)\r\n\r\n        informative_tmp = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\r\n        informative = self.get_market_condition_indicators(informative_tmp.copy(), metadata)\r\n        informative = self.get_custom_stoploss_indicators(informative, metadata)\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\r\n\r\n        dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"_inf\"), inplace=True)\r\n\r\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\r\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\r\n            self.custom_trade_info[metadata['pair']]['roc_inf'] = dataframe[['date', 'roc_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['atr_inf'] = dataframe[['date', 'atr_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['sroc_inf'] = dataframe[['date', 'sroc_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['ssl-dir_inf'] = dataframe[['date', 'ssl-dir_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend_inf'] = dataframe[['date', 'rmi-up-trend_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['candle-up-trend_inf'] = dataframe[['date', 'candle-up-trend_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_trend_inf'] = dataframe[['date', 'bb_lowerband_trend_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_trend_inf'] = dataframe[['date', 'bb_lowerband_trend_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_neutral_inf'] = dataframe[['date', 'bb_lowerband_neutral_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['bb_lowerband_neutral_inf'] = dataframe[['date', 'bb_lowerband_neutral_inf']].copy().set_index('date')\r\n            self.custom_trade_info[metadata['pair']]['bb_upperband_neutral_inf'] = dataframe[['date', 'bb_upperband_neutral_inf']].copy().set_index('date')\r\n\r\n        return dataframe\r\n\r\n    def get_buy_signal_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)  \r\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\r\n        \r\n        for val in self.base_nb_candles_buy.range:\r\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        for val in self.base_nb_candles_sell.range:\r\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)            \r\n\r\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n\r\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\r\n\r\n        dataframe['bb_lowerband'] = bollinger['lower']\r\n        dataframe['hma_5'] = hull_moving_average(dataframe, 5, 'close')\r\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\r\n        dataframe['ema_60'] = ta.EMA(dataframe, timeperiod=60)\r\n        dataframe['uptrend_5m'] = dataframe['ema_25'] > dataframe['ema_60']\r\n\r\n        return dataframe\r\n\r\n    def get_market_condition_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        displacement = 30\r\n        ichimoku = ftt.ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=displacement)\r\n        dataframe['chikou_span'] = ichimoku['chikou_span']\r\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\r\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\r\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\r\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\r\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\r\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\r\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\r\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\r\n\r\n        ssl = SSLChannels_ATR(dataframe, 10)\r\n        dataframe['sslDown'] = ssl[0]\r\n        dataframe['sslUp'] = ssl[1]\r\n\r\n        #dataframe['vfi'] = fta.VFI(dataframe, period=14)\r\n\r\n        # Summary indicators\r\n        dataframe['future_green'] = ichimoku['cloud_green'].shift(displacement).fillna(0).astype('int') * 2\r\n        dataframe['chikou_high'] = ((dataframe['chikou_span'] > dataframe['senkou_a']) & (dataframe['chikou_span'] > dataframe['senkou_b'])).shift(displacement).fillna(0).astype('int')\r\n        dataframe['go_long'] = ((dataframe['tenkan_sen'] > dataframe['kijun_sen']) & (dataframe['close'] > dataframe['leading_senkou_span_a']) & (dataframe['close'] > dataframe['leading_senkou_span_b']) & (dataframe['future_green'] > 0) & (dataframe['chikou_high'] > 0)).fillna(0).astype('int') * 3\r\n        dataframe['max'] = dataframe['high'].rolling(3).max()\r\n        dataframe['min'] = dataframe['low'].rolling(6).min()\r\n        dataframe['upper'] = np.where(dataframe['max'] > dataframe['max'].shift(),1,0)\r\n        dataframe['lower'] = np.where(dataframe['min'] < dataframe['min'].shift(),1,0)\r\n        dataframe['up_trend'] = np.where(dataframe['upper'].rolling(5, min_periods=1).sum() != 0,1,0)\r\n        dataframe['dn_trend'] = np.where(dataframe['lower'].rolling(5, min_periods=1).sum() != 0,1,0)\r\n\r\n        return dataframe\r\n\r\n    def get_custom_stoploss_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        bollinger_neutral = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\r\n        dataframe['bb_lowerband_neutral'] = bollinger_neutral['lower']\r\n        dataframe['bb_middleband_neutral'] = bollinger_neutral['mid']\r\n        dataframe['bb_upperband_neutral'] = bollinger_neutral['upper']\r\n        bollinger_trend = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\r\n        dataframe['bb_lowerband_trend'] = bollinger_trend['lower']\r\n        dataframe['bb_middleband_trend'] = bollinger_trend['mid']\r\n        dataframe['bb_upperband_trend'] = bollinger_trend['upper']\r\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\r\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)\r\n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\r\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\r\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\r\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')\r\n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)\r\n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0)\r\n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\r\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)\r\n\r\n        return dataframe\r\n\r\n\r\n    #\r\n    # Processing buy signals\r\n    #\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe.loc[\r\n            (\r\n                (self.get_buy_signal_offset_strategy(dataframe) == True)\r\n                |\r\n                (self.get_buy_signal_bbrsi_strategy(dataframe) == True)\r\n            )\r\n            #(dataframe['sslUp_inf'] > dataframe['sslDown_inf'])\r\n        ,'buy'] = 1\r\n\r\n        return dataframe\r\n\r\n    def get_buy_signal_offset_strategy(self, dataframe: DataFrame):\r\n        signal = (\r\n            \r\n            \r\n            (self.buy_should_use_get_buy_signal_offset_strategy.value == True) &\r\n            (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n            (dataframe['rsi_fast']< dataframe['rsi_slow'])&\r\n            (dataframe['rsi_fast'] <35)&\r\n            (dataframe['rsi_fast'] >4)&\r\n            (dataframe['EWO'] > self.ewo_high.value) &\r\n            (dataframe['close'] < ta.EMA(dataframe['close'], timeperiod = 14) * 0.970) &\r\n            (dataframe['rsi'] < self.rsi_buy.value) &\r\n            (dataframe['volume'] > 0)\r\n        )\r\n        return signal\r\n    \r\n    \r\n    def get_buy_signal_bbrsi_strategy(self, dataframe: DataFrame):\r\n        signal = (\r\n            \r\n            \r\n            (self.buy_should_use_get_buy_signal_bbrsi_strategy.value == True) &\r\n            (dataframe['sslUp_inf'] > dataframe['sslDown_inf'])&\r\n            (dataframe['uptrend_5m'] == 0)&\r\n            (dataframe['rsi'] < 40) &\r\n            (dataframe['rsi_fast']< dataframe['rsi_slow'])&\r\n            (dataframe['close'].shift(1) < dataframe['bb_lowerband']*1)&\r\n            (dataframe['EWO'] > self.ewo_high.value) &\r\n            (dataframe['volume'] > 0)\r\n        )\r\n        return signal\r\n       \r\n    #\r\n    # Processing sell signals\r\n    #\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe.loc[\r\n            (qtpylib.crossed_above(dataframe['sslDown_inf'], dataframe['sslUp_inf']))\r\n            & (\r\n                (qtpylib.crossed_below(dataframe['tenkan_sen_inf'], dataframe['kijun_sen_inf']))\r\n                |(qtpylib.crossed_below(dataframe['close_inf'], dataframe['kijun_sen_inf']))|\r\n           \r\n              \r\n            (   \r\n                \r\n                (dataframe['close']>dataframe['sma_9'])&\r\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\r\n                #(dataframe['rsi']>150)&\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\r\n            )\r\n            \r\n            ) #&\r\n\r\n            # NOTE: I keep the volume checks of feels like it has not much benifit when trading leverage tokens, maybe im wrong!?\r\n            #(dataframe['vfi'] < 0.0) &\r\n            #(dataframe['volume'] > 0)\r\n\r\n        ,'sell'] = 1\r\n\r\n        return dataframe\r\n\r\n\r\n    #\r\n    # Custom Stoploss\r\n    #\r\n\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\r\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\r\n\r\n        if self.config['runmode'].value in ('live', 'dry_run'):\r\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\r\n            sroc = dataframe['sroc_inf'].iat[-1]\r\n            bb_trailing = dataframe[self.cstp_bb_trailing_input.value].iat[-1]\r\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\r\n        else:\r\n            sroc = self.custom_trade_info[trade.pair]['sroc_inf'].loc[current_time]['sroc_inf']\r\n            bb_trailing = self.custom_trade_info[trade.pair][self.cstp_bb_trailing_input.value].loc[current_time][self.cstp_bb_trailing_input.value]\r\n\r\n        if current_profit < self.cstp_threshold.value:\r\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\r\n                # Dynamic bailout based on rate of change\r\n                if (sroc/100) <= self.cstp_bail_roc.value:\r\n                    return 0.001\r\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\r\n                # Dynamic bailout based on time\r\n                if trade_dur > self.cstp_bail_time.value:\r\n                    return 0.001\r\n\r\n        if current_profit < self.cstp_trailing_only_offset_is_reached.value:\r\n            if current_rate <= bb_trailing:\r\n                return 0.001\r\n            else:\r\n                return -1\r\n\r\n        desired_stoploss = current_profit / self.cstp_trailing_stop_profit_devider.value\r\n        return max(min(desired_stoploss, self.cstp_trailing_max_stoploss.value), 0.025)\r\n\r\n\r\n    #\r\n    # Dynamic ROI\r\n    #\r\n\r\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\r\n\r\n        minimal_roi = self.minimal_roi\r\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\r\n\r\n        # see if we have the data we need to do this, otherwise fall back to the standard table\r\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\r\n            if self.config['runmode'].value in ('live', 'dry_run'):\r\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\r\n                rmi_trend = dataframe['rmi-up-trend_inf'].iat[-1]\r\n                candle_trend = dataframe['candle-up-trend_inf'].iat[-1]\r\n                ssl_dir = dataframe['ssl-dir_inf'].iat[-1]\r\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\r\n            else:\r\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend_inf'].loc[current_time]['rmi-up-trend_inf']\r\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend_inf'].loc[current_time]['candle-up-trend_inf']\r\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir_inf'].loc[current_time]['ssl-dir_inf']\r\n\r\n            min_roi = table_roi\r\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\r\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\r\n            in_trend = False\r\n\r\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\r\n                if rmi_trend == 1:\r\n                    in_trend = True\r\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\r\n                if ssl_dir == 'up':\r\n                    in_trend = True\r\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\r\n                if candle_trend == 1:\r\n                    in_trend = True\r\n\r\n            # Force the ROI value high if in trend\r\n            if (in_trend == True):\r\n                min_roi = 100\r\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\r\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\r\n                    if self.droi_pullback_respect_table.value == True:\r\n                        min_roi = table_roi\r\n                    else:\r\n                        min_roi = current_profit / 1.5\r\n\r\n        else:\r\n            min_roi = table_roi\r\n\r\n        return trade_dur, min_roi\r\n\r\n    # Change here to allow loading of the dynamic_roi settings\r\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:\r\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 120)\r\n\r\n        if self.use_dynamic_roi:\r\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\r\n        else:\r\n            _, roi = self.min_roi_reached_entry(trade_dur)\r\n        if roi is None:\r\n            return False\r\n        else:\r\n            return current_profit > roi\r\n\r\n    # Get the current price from the exchange (or local cache)\r\n    def get_current_price(self, pair: str, refresh: bool) -> float:\r\n        if not refresh:\r\n            rate = self.custom_current_price_cache.get(pair)\r\n            # Check if cache has been invalidated\r\n            if rate:\r\n                return rate\r\n\r\n        ask_strategy = self.config.get('ask_strategy', {})\r\n        if ask_strategy.get('use_order_book', False):\r\n            ob = self.dp.orderbook(pair, 1)\r\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\r\n        else:\r\n            ticker = self.dp.ticker(pair)\r\n            rate = ticker['last']\r\n\r\n        self.custom_current_price_cache[pair] = rate\r\n        return rate\r\n\r\n\r\n    #\r\n    # Custom trade info\r\n    #\r\n\r\n    def populate_trades(self, pair: str) -> dict:\r\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\r\n        if not pair in self.custom_trade_info:\r\n            self.custom_trade_info[pair] = {}\r\n\r\n        # init the temp dicts and set the trade stuff to false\r\n        trade_data = {}\r\n        trade_data['active_trade'] = False\r\n\r\n        # active trade stuff only works in live and dry, not backtest\r\n        if self.config['runmode'].value in ('live', 'dry_run'):\r\n\r\n            # find out if we have an open trade for this pair\r\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\r\n\r\n            # if so, get some information\r\n            if active_trade:\r\n                # get current price and update the min/max rate\r\n                current_rate = self.get_current_price(pair, True)\r\n                active_trade[0].adjust_min_max_rates(current_rate, current_rate)\r\n\r\n        return trade_data\r\n\r\n\r\n#\r\n# Custom indicators\r\n#\r\n\r\ndef RMI(dataframe, *, length=20, mom=5):\r\n    \"\"\"\r\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\r\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\r\n\r\n    df.fillna(0, inplace=True)\r\n\r\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\r\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\r\n\r\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\r\n\r\n    return df[\"RMI\"]\r\n\r\ndef SSLChannels_ATR(dataframe, length=7):\r\n    \"\"\"\r\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\r\n    Credit to @JimmyNixx for python\r\n    \"\"\"\r\n    df = dataframe.copy()\r\n\r\n    df['ATR'] = ta.ATR(df, timeperiod=14)\r\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\r\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\r\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\r\n    df['hlv'] = df['hlv'].ffill()\r\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\r\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\r\n\r\n    return df['sslDown'], df['sslUp']\r\n\r\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\r\n    df = dataframe.copy()\r\n\r\n    roc = ta.ROC(df, timeperiod=roclen)\r\n    ema = ta.EMA(df, timeperiod=emalen)\r\n    sroc = ta.ROC(ema, timeperiod=smooth)\r\n\r\n    return sroc\r\n\r\ndef EWO(dataframe, ema_length=5, ema2_length=35):\r\n    df = dataframe.copy()\r\n    ema1 = ta.EMA(df, timeperiod=ema_length)\r\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\r\n    emadif = (ema1 - ema2) / df['low'] * 100\r\n    return emadif   "
  },
  {
    "path": "strategies/MarketChyperHyperStrategy/MarketChyperHyperStrategy.py",
    "content": "# --- Do not remove these libs ----------------------------------------------------------------------\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nimport talib.abstract as ta\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy.hyper import (CategoricalParameter, DecimalParameter, IntParameter,\n                                      RealParameter)\n\n# ^ TA-Lib Autofill mostly broken in JetBrains Products,\n# ta._ta_lib.<function_name> can temporarily be used while writing as a workaround\n# Then change back to ta.<function_name> so IDE won't nag about accessing a protected member of TA-Lib\n# ----------------------------------------------------------------------------------------------------\n# podriamos ver la tendencia y calcular cada valor por tendencia como hace manigomoney\n\n\nclass MarketChyperHyperStrategy(IStrategy):\n\n    # If enabled all Weighted Signal results will be added to the dataframe for easy debugging with BreakPoints\n    # Warning: Disable this for anything else then debugging in an IDE! (Integrated Development Environment)\n    debuggable_weighted_signal_dataframe = False\n\n    # Ps: Documentation has been moved to the Buy/Sell HyperOpt Space Parameters sections below this copy-paste section\n    ####################################################################################################################\n    #                                    START OF HYPEROPT RESULTS COPY-PASTE SECTION                                  #\n    ####################################################################################################################\n\n    # Buy hyperspace params:\n    buy_params = {\n        'buy_downtrend_oslevel': -37,\n        'buy_downtrend_rsi_div_value': 79,\n        'buy_downtrend_rsi_divergence_weight': 50,\n        'buy_downtrend_total_signal_needed': 70,\n        'buy_downtrend_wavetrend_weight': 96,\n        'buy_sideways_oslevel': -28,\n        'buy_sideways_rsi_div_value': 45,\n        'buy_sideways_rsi_divergence_weight': 35,\n        'buy_sideways_total_signal_needed': 80,\n        'buy_sideways_wavetrend_weight': 5,\n        'buy_uptrend_oslevel': -43,\n        'buy_uptrend_rsi_div_value': 93,\n        'buy_uptrend_rsi_divergence_weight': 84,\n        'buy_uptrend_total_signal_needed': 25,\n        'buy_uptrend_wavetrend_weight': 91\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell_downtrend_oblevel': 75.67481,\n        'sell_downtrend_rsi_divergence_weight': 90,\n        'sell_downtrend_total_signal_needed': 51,\n        'sell_downtrend_wavetrend_weight': 30,\n        'sell_sideways_oblevel': 1.93351,\n        'sell_sideways_rsi_divergence_weight': 59,\n        'sell_sideways_total_signal_needed': 36,\n        'sell_sideways_wavetrend_weight': 83,\n        'sell_uptrend_oblevel': 37.98512,\n        'sell_uptrend_rsi_divergence_weight': 99,\n        'sell_uptrend_total_signal_needed': 93,\n        'sell_uptrend_wavetrend_weight': 43\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.23733,\n        \"238\": 0.20624,\n        \"846\": 0.08939,\n        \"1834\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.12447\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01658\n    trailing_stop_positive_offset = 0.10224\n    trailing_only_offset_is_reached = True\n\n\n\n    ####################################################################################################################\n    #                                     END OF HYPEROPT RESULTS COPY-PASTE SECTION                                   #\n    ####################################################################################################################\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n    # SMA200 needs 200 candles before producing valid signals\n    # EMA200 needs an extra 200 candles of SMA200 before producing valid signals\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n\n\n    # Uptrend Trend Buy\n    # -------------------\n    # Total Buy Signal Percentage needed for a signal to be positive\n    # im testing number of signals * 50 / 2\n    buy___trades_when_downwards = \\\n        CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy___trades_when_sideways = \\\n        CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy___trades_when_upwards = \\\n        CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_uptrend_total_signal_needed = IntParameter(0, 100, default=65, space='buy', optimize=True, load=True)\n    #wave trend\n    buy_uptrend_wavetrend_weight = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n    #rsi divs\n    buy_uptrend_rsi_divergence_weight = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n\n    # buy_rsi_div_value (rsi used in condition of bullish div)\n    buy_uptrend_rsi_div_value = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n\n    buy_uptrend_oslevel = \\\n        IntParameter(-100, 0, default=0, space='buy', optimize=True, load=True)\n\n\n    # Sideways Trend Buy\n    # -------------------\n    buy_sideways_total_signal_needed = IntParameter(0, 100, default=65, space='buy', optimize=True, load=True)\n    #wave trend\n    buy_sideways_wavetrend_weight = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n    #rsi divs\n    buy_sideways_rsi_divergence_weight = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n\n    # buy_rsi_div_value (rsi used in condition of bullish div)\n    buy_sideways_rsi_div_value = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n\n    buy_sideways_oslevel = \\\n        IntParameter(-100, 0, default=0, space='buy', optimize=True, load=True)\n\n\n    # Downtrend Trend Buy\n    # -------------------\n    buy_downtrend_total_signal_needed = IntParameter(0, 100, default=65, space='buy', optimize=True, load=True)\n    #wave trend\n    buy_downtrend_wavetrend_weight = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n    #rsi divs\n    buy_downtrend_rsi_divergence_weight = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n\n    # buy_rsi_div_value (rsi used in condition of bullish div)\n    buy_downtrend_rsi_div_value = \\\n        IntParameter(0, 100, default=0, space='buy', optimize=True, load=True)\n\n    buy_downtrend_oslevel = \\\n        IntParameter(-100, 0, default=0, space='buy', optimize=True, load=True)\n\n\n\n    #sell??\n    sell___trades_when_downwards = \\\n        CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell___trades_when_sideways = \\\n        CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell___trades_when_upwards = \\\n        CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    # Uptrend Trend Sell\n    # --------------------\n\n    # Total Sell Signal Percentage needed for a signal to be positive\n    sell_uptrend_total_signal_needed = IntParameter(0, 100, default=65, space='sell', optimize=True, load=True)\n    #wave trend\n    sell_uptrend_wavetrend_weight = \\\n        IntParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n    #rsi divs\n    sell_uptrend_rsi_divergence_weight = \\\n        IntParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n\n    sell_uptrend_oblevel = \\\n        RealParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n\n\n    # Sidewyas Trend Sell\n    # --------------------\n\n    # Total Sell Signal Percentage needed for a signal to be positive\n    sell_sideways_total_signal_needed = IntParameter(0, 100, default=65, space='sell', optimize=True, load=True)\n    #wave trend\n    sell_sideways_wavetrend_weight = \\\n        IntParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n    #rsi divs\n    sell_sideways_rsi_divergence_weight = \\\n        IntParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n\n    sell_sideways_oblevel = \\\n        RealParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n\n\n    # Downtrend Trend Sell\n    # --------------------\n    sell_downtrend_total_signal_needed = IntParameter(0, 100, default=65, space='sell', optimize=True, load=True)\n    #wave trend\n    sell_downtrend_wavetrend_weight = \\\n        IntParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n    #rsi divs\n    sell_downtrend_rsi_divergence_weight = \\\n        IntParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n\n    sell_downtrend_oblevel = \\\n        RealParameter(0, 100, default=0, space='sell', optimize=True, load=True)\n\n\n    # ---------------------------------------------------------------- #\n    #                 Custom HyperOpt Space Parameters                 #\n    # ---------------------------------------------------------------- #\n\n    # class HyperOpt:\n    #     # Define a custom stoploss space.\n    #     @staticmethod\n    #     def stoploss_space():\n    #         return [Real(-0.01, -0.35, name='stoploss')]\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n\n      # Momentum Indicators (timeperiod is expressed in candles)\n        # -------------------\n\n        # ADX - Average Directional Index (The Trend Strength Indicator)\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)  # 14 timeperiods is usually used for ADX\n\n        # +DM (Positive Directional Indicator) = current high - previous high\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        # -DM (Negative Directional Indicator) = previous low - current low\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n\n        # RSI - Relative Strength Index (Under bought / Over sold & Over bought / Under sold indicator Indicator)\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # MACD - Moving Average Convergence Divergence\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']  # MACD - Blue TradingView Line (Bullish if on top)\n        dataframe['macdsignal'] = macd['macdsignal']  # Signal - Orange TradingView Line (Bearish if on top)\n\n        # Initialize total signal variables (should be 0 = false by default)\n        dataframe['total_buy_signal_strength'] = dataframe['total_sell_signal_strength'] = 0\n\n\n        #divergences\n        dataframe = self.divergences(dataframe)\n\n        #get trend\n        dataframe.loc[(dataframe['adx'] > 20) & (dataframe['plus_di'] < dataframe['minus_di']), 'trend'] = 'downwards'\n        dataframe.loc[dataframe['adx'] < 20, 'trend'] = 'sideways'\n        dataframe.loc[(dataframe['adx'] > 20) & (dataframe['plus_di'] > dataframe['minus_di']), 'trend'] = 'upwards'\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe = self.market_cipher(dataframe)\n\n        #CALCULATE WT OVERSOLD\n        dataframe.loc[(dataframe['trend'] == 'downwards'),\n                        'wtOversold'] =  (dataframe['wt2'] <= self.buy_downtrend_oslevel.value)\n        dataframe.loc[(dataframe['trend'] == 'sideways'),\n                        'wtOversold'] = (dataframe['wt2'] <= self.buy_sideways_oslevel.value)\n        dataframe.loc[(dataframe['trend'] == 'upwards'),\n                        'wtOversold'] = (dataframe['wt2'] <= self.buy_uptrend_oslevel.value)\n\n\n        #SUM\n        dataframe.loc[(dataframe['trend'] == 'downwards') & (dataframe['wtCrossUp'] & dataframe['wtOversold']),\n                        'buy_wavetrend_weight'] = self.buy_downtrend_wavetrend_weight.value\n        dataframe.loc[(dataframe['trend'] == 'sideways') & (dataframe['wtCrossUp'] & dataframe['wtOversold']),\n                        'buy_wavetrend_weight'] = self.buy_sideways_wavetrend_weight.value\n        dataframe.loc[(dataframe['trend'] == 'upwards') & (dataframe['wtCrossUp'] & dataframe['wtOversold']),\n                        'buy_wavetrend_weight'] = self.buy_uptrend_wavetrend_weight.value\n\n        dataframe['total_buy_signal_strength'] += dataframe['buy_wavetrend_weight']\n\n        #rsi div and rsi vaÃ±ur buy_rsi_div buy_rsi_div_weight\n        dataframe.loc[(dataframe['trend'] == 'downwards') & (dataframe['bullish_div'] & (dataframe['rsi'] <= self.buy_downtrend_rsi_div_value.value)),\n                        'buy_rsi_divergence_weight'] = self.buy_downtrend_rsi_divergence_weight.value\n        dataframe.loc[(dataframe['trend'] == 'sideways') & (dataframe['bullish_div'] & (dataframe['rsi'] <= self.buy_sideways_rsi_div_value.value)),\n                        'buy_rsi_divergence_weight'] = self.buy_sideways_rsi_divergence_weight.value\n        dataframe.loc[(dataframe['trend'] == 'upwards') & (dataframe['bullish_div'] & (dataframe['rsi'] <= self.buy_uptrend_rsi_div_value.value)),\n                        'buy_rsi_divergence_weight'] = self.buy_uptrend_rsi_divergence_weight.value\n\n        dataframe['total_buy_signal_strength'] += dataframe['buy_rsi_divergence_weight']\n\n        # Check if buy signal should be sent depending on the current trend\n        # Check if buy signal should be sent depending on the current trend\n        dataframe.loc[\n            (\n                    (dataframe['trend'] == 'downwards') &\n                    (dataframe['total_buy_signal_strength'] >= self.buy_downtrend_total_signal_needed.value)\n            ) | (\n                    (dataframe['trend'] == 'sideways') &\n                    (dataframe['total_buy_signal_strength'] >= self.buy_sideways_total_signal_needed.value)\n            ) | (\n                    (dataframe['trend'] == 'upwards') &\n                    (dataframe['total_buy_signal_strength'] >= self.buy_uptrend_total_signal_needed.value)\n            ), 'buy'] = 1\n\n        # Override Buy Signal: When configured buy signals can be completely turned off for each kind of trend\n        if not self.buy___trades_when_downwards.value:\n            dataframe.loc[dataframe['trend'] == 'downwards', 'buy'] = 0\n        if not self.buy___trades_when_sideways.value:\n            dataframe.loc[dataframe['trend'] == 'sideways', 'buy'] = 0\n        if not self.buy___trades_when_upwards.value:\n            dataframe.loc[dataframe['trend'] == 'upwards', 'buy'] = 0\n\n        return dataframe\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = self.market_cipher(dataframe)\n\n       #CALCULATE WT OVERSOLD\n        dataframe.loc[(dataframe['trend'] == 'downwards'),\n                        'wtOverbought'] =  (dataframe['wt2'] >= self.sell_downtrend_oblevel.value)\n        dataframe.loc[(dataframe['trend'] == 'sideways'),\n                        'wtOverbought'] = (dataframe['wt2'] >= self.sell_sideways_oblevel.value)\n        dataframe.loc[(dataframe['trend'] == 'upwards'),\n                        'wtOverbought'] = (dataframe['wt2'] >= self.sell_uptrend_oblevel.value)\n\n\n        #SUM\n        dataframe.loc[(dataframe['trend'] == 'downwards') & (dataframe['wtCrossDown'] & dataframe['wtOverbought']),\n                        'sell_wavetrend_weight'] = self.sell_downtrend_wavetrend_weight.value\n        dataframe.loc[(dataframe['trend'] == 'sideways') & (dataframe['wtCrossDown'] & dataframe['wtOverbought']),\n                        'sell_wavetrend_weight'] = self.sell_sideways_wavetrend_weight.value\n        dataframe.loc[(dataframe['trend'] == 'upwards') & (dataframe['wtCrossDown'] & dataframe['wtOverbought']),\n                        'sell_wavetrend_weight'] = self.sell_uptrend_wavetrend_weight.value\n\n        dataframe['total_sell_signal_strength'] += dataframe['sell_wavetrend_weight']\n\n        #rsi div and rsi vaÃ±ur buy_rsi_div buy_rsi_div_weight\n        dataframe.loc[(dataframe['trend'] == 'downwards') & (dataframe['bearish_div']),\n                        'sell_rsi_divergence_weight'] = self.sell_downtrend_rsi_divergence_weight.value\n        dataframe.loc[(dataframe['trend'] == 'sideways') & (dataframe['bearish_div']),\n                        'sell_rsi_divergence_weight'] = self.sell_sideways_rsi_divergence_weight.value\n        dataframe.loc[(dataframe['trend'] == 'upwards') & (dataframe['bearish_div']),\n                        'sell_rsi_divergence_weight'] = self.sell_uptrend_rsi_divergence_weight.value\n\n        dataframe['total_sell_signal_strength'] += dataframe['sell_rsi_divergence_weight']\n\n        # Check if buy signal should be sent depending on the current trend\n        # Check if buy signal should be sent depending on the current trend\n        dataframe.loc[\n            (\n                    (dataframe['trend'] == 'downwards') &\n                    (dataframe['total_sell_signal_strength'] >= self.sell_downtrend_total_signal_needed.value)\n            ) | (\n                    (dataframe['trend'] == 'sideways') &\n                    (dataframe['total_sell_signal_strength'] >= self.sell_sideways_total_signal_needed.value)\n            ) | (\n                    (dataframe['trend'] == 'upwards') &\n                    (dataframe['total_sell_signal_strength'] >= self.sell_uptrend_total_signal_needed.value)\n            ), 'sell'] = 1\n\n\n        return dataframe\n\n    #wavetrend, market cypher\n    def market_cipher(self, dataframe) -> DataFrame:\n            self.n1 = 10 #WT Channel Length\n            self.n2 = 21 #WT Average Length\n\n            dataframe['ap'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n            dataframe['esa'] = ta.EMA(dataframe['ap'], self.n1)\n            dataframe['d'] = ta.EMA((dataframe['ap']-dataframe['esa']).abs(), self.n1)\n            dataframe['ci'] = ( dataframe['ap']-dataframe['esa'] ) / (0.015 * dataframe['d'])\n            dataframe['tci'] = ta.EMA(dataframe['ci'], self.n2)\n\n            dataframe['wt1'] = dataframe['tci']\n            dataframe['wt2'] = ta.SMA(dataframe['wt1'],4)\n\n            dataframe['wtVwap'] = dataframe['wt1'] - dataframe['wt2']\n\n\n            dataframe['wtCrossUp'] = dataframe['wt2'] - dataframe['wt1'] <= 0\n            dataframe['wtCrossDown'] = dataframe['wt2'] - dataframe['wt1'] >= 0\n            dataframe['crossed_above'] = qtpylib.crossed_above(dataframe['wt2'], dataframe['wt1'])\n            dataframe['crossed_below'] = qtpylib.crossed_below(dataframe['wt2'], dataframe['wt1'])\n\n            return dataframe\n\n\n    #rsi divergences  dataframe['bullish_div'] dataframe['bearish_div']\n    def divergences(self,dataframe) -> DataFrame:\n            dataframe['bullish_div'] = (\n                                        ( dataframe['close'].shift(4) > dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(3) > dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(2) < dataframe['close'].shift(1) ) &\n                                        ( dataframe['close'].shift(2) < dataframe['close'] )\n                                    )\n\n            dataframe['bearish_div'] = (\n                                        ( dataframe['close'].shift(4) < dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(3) < dataframe['close'].shift(2) ) &\n                                        ( dataframe['close'].shift(2) > dataframe['close'].shift(1) ) &\n                                        ( dataframe['close'].shift(2) > dataframe['close'] )\n                                        )\n\n            return dataframe\n"
  },
  {
    "path": "strategies/Maro4hMacdSd/Maro4hMacdSd.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport datetime\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np # noqa\n\n\nclass Maro4hMacdSd(IStrategy):\n\n    max_open_trades = 1\n    stake_amount = 500\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n\n    stoploss = -0.21611\n\n    minimal_roi = {\n        \"0\": 0.24627,\n        \"24\": 0.06484,\n        \"38\": 0.02921,\n        \"145\": 0\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.1\n    trailing_stop_positive_offset = 0.2\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = True\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    \n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n        # MACD\n        macd = ta.MACD(dataframe,fastperiod=12, slowperiod=26, signalperiod=9)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = 100*macd['macdhist']/dataframe['close']\n\n        dataframe['corr'] = ta.STDDEV(dataframe, timeperiod=28)\n        dataframe['corr_mean'] = ta.MA(dataframe['corr'], timeperiod=28)\n\n        dataframe['corr_sell'] = ta.STDDEV(dataframe, timeperiod=28)\n        dataframe['corr_mean_sell'] = ta.MA(dataframe['corr'], timeperiod=28)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n\n        dataframe.loc[\n            (\n            (dataframe['macdhist'] < 0) &\n            (dataframe['macdhist'].shift(2) > dataframe['macdhist'].shift(1))\n            & (dataframe['macdhist'] > dataframe['macdhist'].shift(2))\n            &\n            (dataframe['corr'] > dataframe['corr_mean'])\n            ),'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n            (dataframe['macdhist'] > 0) &\n            (dataframe['macdhist'].shift(2) < dataframe['macdhist'].shift(1))\n            &(dataframe['macdhist'] < dataframe['macdhist'].shift(2)) &\n            (dataframe['corr_sell'] < dataframe['corr_mean_sell'])\n            ),'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/Martin/Martin.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Martin(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\"60\": 0.01, \"30\": 0.02, \"0\": 0.04}\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = \"5m\"\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        \"buy\": \"limit\",\n        \"sell\": \"limit\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": False,\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\"buy\": \"gtc\", \"sell\": \"gtc\"}\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        \"main_plot\": {\n            \"tema\": {},\n            \"sar\": {\"color\": \"white\"},\n        },\n        \"subplots\": {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                \"macd\": {\"color\": \"blue\"},\n                \"macdsignal\": {\"color\": \"orange\"},\n            },\n            \"RSI\": {\n                \"rsi\": {\"color\": \"red\"},\n            },\n        },\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        # dataframe[\"adx\"] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        # stoch_fast = ta.STOCHF(dataframe)\n        # dataframe[\"fastd\"] = stoch_fast[\"fastd\"]\n        # dataframe[\"fastk\"] = stoch_fast[\"fastk\"]\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe[\"macd\"] = macd[\"macd\"]\n        dataframe[\"macdsignal\"] = macd[\"macdsignal\"]\n        dataframe[\"macdhist\"] = macd[\"macdhist\"]\n\n        # MFI\n        dataframe[\"mfi\"] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe[\"bb_lowerband\"] = bollinger[\"lower\"]\n        dataframe[\"bb_middleband\"] = bollinger[\"mid\"]\n        dataframe[\"bb_upperband\"] = bollinger[\"upper\"]\n        dataframe[\"bb_percent\"] = (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) / (\n            dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]\n        )\n        dataframe[\"bb_width\"] = (\n            dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]\n        ) / dataframe[\"bb_middleband\"]\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe[\"sar\"] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe[\"tema\"] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe[\"htsine\"] = hilbert[\"sine\"]\n        dataframe[\"htleadsine\"] = hilbert[\"leadsine\"]\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe[\"rsi\"], 30))\n                & (dataframe[\"tema\"] <= dataframe[\"bb_middleband\"])\n                & (dataframe[\"tema\"] > dataframe[\"tema\"].shift(1))\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"buy\",\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe[\"rsi\"], 70))\n                & (dataframe[\"tema\"] > dataframe[\"bb_middleband\"])\n                & (dataframe[\"tema\"] < dataframe[\"tema\"].shift(1))\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"sell\",\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/MiniLambo/MiniLambo.py",
    "content": "from skopt.space import Dimension, Integer\n\nimport logging\nimport logging\nfrom datetime import datetime, timezone\nfrom functools import reduce\nfrom typing import List\n\nimport numpy as np\nimport pandas_ta as pta\nimport talib.abstract as ta\nimport technical.indicators as ftt\nfrom pandas import DataFrame, Series\nfrom skopt.space import Dimension, Integer\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import (BooleanParameter, DecimalParameter,\n                                IntParameter, merge_informative_pair)\nfrom freqtrade.strategy.interface import IStrategy\n\nlogger = logging.getLogger(__name__)\n\n# ###############################################################################\n# ###############################################################################\n# @Farhad#0318 ( https://github.com/farfary/freqtrade_strategies )\n#\n# Based on buy signal from Al (alb#1349)\n# ###############################################################################\n# ###############################################################################\n\n\nclass MiniLambo(IStrategy):\n    # Protection hyperspace params:\n    protection_params = {\n        \"protection_cooldown_period\": 2,\n        \"protection_maxdrawdown_lookback_period_candles\": 35,\n        \"protection_maxdrawdown_max_allowed_drawdown\": 0.097,\n        \"protection_maxdrawdown_stop_duration_candles\": 1,\n        \"protection_maxdrawdown_trade_limit\": 6,\n        \"protection_stoplossguard_lookback_period_candles\": 16,\n        \"protection_stoplossguard_stop_duration_candles\": 29,\n        \"protection_stoplossguard_trade_limit\": 3,\n    }\n\n    protection_cooldown_period = IntParameter(low=1, high=48, default=1, space=\"protection\", optimize=True)\n\n    protection_maxdrawdown_lookback_period_candles = IntParameter(low=1, high=48, default=1, space=\"protection\", optimize=True)\n    protection_maxdrawdown_trade_limit = IntParameter(low=1, high=8, default=4, space=\"protection\", optimize=True)\n    protection_maxdrawdown_stop_duration_candles = IntParameter(low=1, high=48, default=1, space=\"protection\", optimize=True)\n    protection_maxdrawdown_max_allowed_drawdown = DecimalParameter(low=0.01, high=0.20, default=0.1, space=\"protection\", optimize=True)\n\n    protection_stoplossguard_lookback_period_candles = IntParameter(low=1, high=48, default=1, space=\"protection\", optimize=True)\n    protection_stoplossguard_trade_limit = IntParameter(low=1, high=8, default=4, space=\"protection\", optimize=True)\n    protection_stoplossguard_stop_duration_candles = IntParameter(low=1, high=48, default=1, space=\"protection\", optimize=True)\n\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration_candles\": self.protection_cooldown_period.value\n            },\n            {\n                \"method\": \"MaxDrawdown\",\n                \"lookback_period_candles\": self.protection_maxdrawdown_lookback_period_candles.value,\n                \"trade_limit\": self.protection_maxdrawdown_trade_limit.value,\n                \"stop_duration_candles\": self.protection_maxdrawdown_stop_duration_candles.value,\n                \"max_allowed_drawdown\": self.protection_maxdrawdown_max_allowed_drawdown.value\n            },\n            {\n                \"method\": \"StoplossGuard\",\n                \"lookback_period_candles\": self.protection_stoplossguard_lookback_period_candles.value,\n                \"trade_limit\": self.protection_stoplossguard_trade_limit.value,\n                \"stop_duration_candles\": self.protection_stoplossguard_stop_duration_candles.value,\n                \"only_per_pair\": False\n            }\n        ]\n\n    class HyperOpt:\n        @staticmethod\n        def generate_roi_table(params: dict):\n            \"\"\"\n            Generate the ROI table that will be used by Hyperopt\n            This implementation generates the default legacy Freqtrade ROI tables.\n            Change it if you need different number of steps in the generated\n            ROI tables or other structure of the ROI tables.\n            Please keep it aligned with parameters in the 'roi' optimization\n            hyperspace defined by the roi_space method.\n            \"\"\"\n            roi_table = {}\n            roi_table[0] = 0.05\n            roi_table[params['roi_t6']] = 0.04\n            roi_table[params['roi_t5']] = 0.03\n            roi_table[params['roi_t4']] = 0.02\n            roi_table[params['roi_t3']] = 0.01\n            roi_table[params['roi_t2']] = 0.0001\n            roi_table[params['roi_t1']] = -10\n\n            return roi_table\n\n        @staticmethod\n        def roi_space() -> List[Dimension]:\n            \"\"\"\n            Values to search for each ROI steps\n            Override it if you need some different ranges for the parameters in the\n            'roi' optimization hyperspace.\n            Please keep it aligned with the implementation of the\n            generate_roi_table method.\n            \"\"\"\n            return [\n                Integer(240, 720, name='roi_t1'),\n                Integer(120, 240, name='roi_t2'),\n                Integer(90, 120, name='roi_t3'),\n                Integer(60, 90, name='roi_t4'),\n                Integer(30, 60, name='roi_t5'),\n                Integer(1, 30, name='roi_t6'),\n            ]\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.05,\n        \"15\": 0.04,\n        \"51\": 0.03,\n        \"81\": 0.02,\n        \"112\": 0.01,\n        \"154\": 0.0001,\n        \"400\": -10\n    }\n\n    # Stoploss:\n    stoploss = -0.10\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.3207\n    trailing_stop_positive_offset = 0.3849\n    trailing_only_offset_is_reached = False\n\n    timeframe = '1m'\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    use_custom_stoploss = True\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        \"main_plot\": {\n            \"ema_14\": {\n                \"color\": \"#888b48\",\n                \"type\": \"line\"\n            },\n            \"buy_sell\": {\n                \"sell_tag\": {\"color\": \"red\"},\n                \"buy_tag\": {\"color\": \"blue\"},\n            },\n        },\n        \"subplots\": {\n            \"rsi4\": {\n                \"rsi_4\": {\n                    \"color\": \"#888b48\",\n                    \"type\": \"line\"\n                }\n            },\n            \"rsi14\": {\n                \"rsi_14\": {\n                    \"color\": \"#888b48\",\n                    \"type\": \"line\"\n                }\n            },\n            \"cti\": {\n                \"cti\": {\n                    \"color\": \"#573892\",\n                    \"type\": \"line\"\n                }\n            },\n            \"ewo\": {\n                \"EWO\": {\n                    \"color\": \"#573892\",\n                    \"type\": \"line\"\n                }\n            },\n            \"pct_change\": {\n                \"pct_change\": {\n                    \"color\": \"#26782f\",\n                    \"type\": \"line\"\n                }\n            }\n        }\n    }\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"lambo2_pct_change_high_period\": 109,\n        \"lambo2_pct_change_high_ratio\": -0.235,\n        \"lambo2_pct_change_low_period\": 20,\n        \"lambo2_pct_change_low_ratio\": -0.06,\n        \"lambo2_ema_14_factor\": 0.981,\n        \"lambo2_rsi_14_limit\": 39,\n        \"lambo2_rsi_21_limit\": 39,\n        \"lambo2_rsi_4_limit\": 44,\n    }\n\n    # lambo2\n    lambo2_ema_14_factor = DecimalParameter(0.8, 1.2, decimals=3, default=buy_params['lambo2_ema_14_factor'], space='buy', optimize=False)\n    lambo2_rsi_4_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_4_limit'], space='buy', optimize=False)\n    lambo2_rsi_14_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_14_limit'], space='buy', optimize=False)\n    lambo2_rsi_21_limit = IntParameter(5, 60, default=buy_params['lambo2_rsi_21_limit'], space='buy', optimize=False)\n\n    lambo2_pct_change_low_period = IntParameter(1, 60, default=buy_params['lambo2_pct_change_low_period'], space='buy', optimize=True)\n    lambo2_pct_change_low_ratio = DecimalParameter(low=-0.20, high=-0.01, decimals=3, default=buy_params['lambo2_pct_change_low_ratio'], space='buy', optimize=True)\n\n    lambo2_pct_change_high_period = IntParameter(1, 180, default=buy_params['lambo2_pct_change_high_period'], space='buy', optimize=True)\n    lambo2_pct_change_high_ratio = DecimalParameter(low=-0.30, high=-0.01, decimals=3, default=buy_params['lambo2_pct_change_high_ratio'], space='buy', optimize=True)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n\n        return informative_pairs\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n        elif (current_profit > 0.015):\n            sl_new = 0.0075\n\n        return sl_new\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_21'] = ta.RSI(dataframe, timeperiod=21)\n        dataframe['rsi_100'] = ta.RSI(dataframe, timeperiod=100)\n\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        lambo2 = (\n                (dataframe['close'] < (dataframe['ema_14'] * self.lambo2_ema_14_factor.value))\n                & (dataframe['rsi_4'] < int(self.lambo2_rsi_4_limit.value))\n                & (dataframe['rsi_14'] < int(self.lambo2_rsi_14_limit.value))\n                # & (dataframe['rsi_21'] > int(self.lambo2_rsi_21_limit.value))\n                & (dataframe['close'].pct_change(periods=self.lambo2_pct_change_low_period.value) < float(self.lambo2_pct_change_low_ratio.value))\n                & (dataframe['close'].pct_change(periods=self.lambo2_pct_change_high_period.value) > float(self.lambo2_pct_change_high_ratio.value))\n        )\n        dataframe.loc[lambo2, 'buy_tag'] += 'lambo2 '\n        conditions.append(lambo2)\n\n        dataframe.loc[reduce(lambda x, y: x | y, conditions), 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n        trade.sell_reason = f'{sell_reason} ({trade.buy_tag})'\n        return True\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n\ndef pct_change(a, b):\n    return (b - a) / a\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass MiniLambo_TBS(MiniLambo):\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]:\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price) * 100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price return None to stop\n        # trailing buy (will start again at next buy signal) return 'forcebuy' to force immediate buy (example with\n        # 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (\n        # no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt = abs((last_candle['perc_norm']))\n        default_offset = 0.004 * (1 + adapt)  # NOTE: default_offset 0.003 <--> 0.006\n        # default_offset = adapt*0.01\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if (current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (\n                trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (\n                      current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str,\n                            **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n\n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if (len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1):\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n\n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(\n                                    f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(\n                                    current_price * (1 + trailing_buy_offset),\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(\n                                    f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (\n                                    trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(\n                                    f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (\n                                    trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(\n                                    f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n\n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:, 'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Minmax/Minmax.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom scipy.signal import argrelextrema\nimport numpy as np\n\n\nclass Minmax(IStrategy):\n\n    minimal_roi = {\n        \"0\":  10\n    }\n\n    stoploss = -0.05\n\n    timeframe = '1h'\n\n    trailing_stop = False\n\n    process_only_new_candles = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe_copy = dataframe.copy()\n        frame_size = 500\n        len_df = len(dataframe)\n        dataframe['buy_signal'] = False\n        dataframe['sell_signal'] = False\n        lookback_size = 100\n        # Let's calculate argrelextrema on separated data slices and get only last result to avoid lookahead bias!\n        for i in range(len_df):\n            if i + frame_size < len_df:\n                slice = dataframe_copy[i : i+frame_size]\n                min_peaks = argrelextrema(slice['close'].values, np.less, order=lookback_size)\n                max_peaks = argrelextrema(slice['close'].values, np.greater, order=lookback_size)\n                # Somehow we never getting last index of a frame as min or max. What a surprise :)\n                # So lets take penultimate result and use it as a signal to buy/sell.\n                if len(min_peaks[0]) and min_peaks[0][-1] == frame_size - 2:\n                    # signal that penultimate candle is min\n                    # lets buy here\n                    dataframe.at[i + frame_size,'buy_signal'] = True\n                if len(max_peaks[0]) and max_peaks[0][-1] == frame_size - 2:\n                    # oh it seams that penultimate candle is max\n                    # lets sell ASAP\n                    dataframe.at[i + frame_size, 'sell_signal'] = True\n\n                if i + frame_size == len_df - 1:\n                    print(min_peaks)\n\n        #                                                                               A\n        # Wow what a pathetic results!!!Where is my Trillions of BTC?!?!?!              |\n        # Let's make it in a lookahead way to make more numbers in backtesting!!        |\n        #                                                                               |\n        #                                                                               |\n        # Comment this section!!  ------------------------------------------------------|\n        # Uncomment this section ASAP!\n        #           |\n        #           |\n        #           |\n        #           |\n        #           V\n\n        # min_peaks = argrelextrema(dataframe['close'].values, np.less, order=loockback_size)\n        # max_peaks = argrelextrema(dataframe['close'].values, np.greater, order=loockback_size)\n        #\n        #\n        # for mp in min_peaks[0]:\n        #     dataframe.at[mp, 'buy_signal'] = True\n        #\n        # for mp in max_peaks[0]:\n        #     dataframe.at[mp, 'sell_signal'] = True\n\n        # Uhhh that's better! Ordering Lambo now!\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        print(dataframe.tail(30))\n\n\n        dataframe.loc[\n            (\n                dataframe['buy_signal']\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        dataframe.loc[\n            (\n                dataframe['sell_signal']\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/MomStrategy/MomStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nimport numpy\nimport tabulate\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass MomStrategy(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -1\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 0\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            # 'tema': {},\n            # 'sar': {'color': 'black'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MOM\": {\n                'mom': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # momentum\n        dataframe['mom'] = ta.MOM(dataframe['close'].values, 10)\n        dataframe['signal'] = 0\n        dataframe.loc[\n            (\n                    (dataframe['mom'] > 0) &\n                    (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'signal'] = 1\n        dataframe['signal'] = dataframe['signal'].diff()\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        #dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        #stoch_fast = ta.STOCHF(dataframe)\n        #dataframe['fastd'] = stoch_fast['fastd']\n        #dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        #macd = ta.MACD(dataframe)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        #dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        #bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        #dataframe['bb_lowerband'] = bollinger['lower']\n        #dataframe['bb_middleband'] = bollinger['mid']\n        #dataframe['bb_upperband'] = bollinger['upper']\n        #dataframe[\"bb_percent\"] = (\n        #    (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n        #    (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        #)\n        #dataframe[\"bb_width\"] = (\n        #    (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        #)\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        #dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        #dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        #hilbert = ta.HT_SINE(dataframe)\n        #dataframe['htsine'] = hilbert['sine']\n        #dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                dataframe['signal'] == 1\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                dataframe['signal'] == -1\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Momentumv2/Momentumv2.py",
    "content": "from pandas import DataFrame\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import (IntParameter, DecimalParameter)\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Momentumv2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.22,\n        \"1260\": 0.17,\n        \"1944\": 0.09,\n        \"7200\": 0\n    }\n\n    stoploss = -0.08\n    use_custom_stoploss = True\n    trailing_stop = False\n    timeframe = '4h'\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    startup_candle_count: int = 100\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': True\n    }\n\n    # Buy Parameters\n    buy_ema = IntParameter(10, 100, default=30, space='buy', optimize=True, load=True)\n\n    # Sell Parameters\n    sell_rsi = DecimalParameter(70, 99, default=80, space='sell', optimize=True, load=True)\n\n    # Stoploss Parameters\n    atr_timeperiod = IntParameter(5, 21, default=7, space='sell')\n    atr_multiplier = DecimalParameter(2.5, 3.5, default=2.5, space='sell')\n\n    buy_params = {\n        \"buy_ema\": 80\n    }\n\n    sell_params = {\n        \"sell_rsi\": 90,\n        \"atr_multiplier\": 2.6,\n        \"atr_timeperiod\": 12,\n    }\n\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration_candles\": 6\n            }\n        ]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # EMA\n        dataframe['ema'] = ta.EMA(dataframe, timeperiod=self.buy_ema.value)\n\n        # Average True Index Trailing Stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=self.atr_timeperiod.value)\n        dataframe['atr_trailing'] = dataframe['close'] - \\\n            (dataframe['atr'] * self.atr_multiplier.value)\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        stoploss_price = last_candle['atr_trailing']\n\n        if stoploss_price < current_rate:\n            return (stoploss_price / current_rate) - 1\n\n        return 1\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']))\n        conditions.append(dataframe['close'] > dataframe['ema'])\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']) | (\n            qtpylib.crossed_below(dataframe['rsi'], self.sell_rsi.value)))\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/MontrealStrategy/MontrealStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass MontrealStrategy(IStrategy):\n    \"\"\"\n    Strategy developed in udemy course, really sucks actually\n    \"\"\"\n\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\"0\": 0.31651, \"79\": 0.07068, \"147\": 0.04049, \"345\": 0}\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.28646\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = \"15m\"\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        \"buy\": \"limit\",\n        \"sell\": \"limit\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": True,\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\"buy\": \"gtc\", \"sell\": \"gtc\"}\n\n    plot_config = {\n        \"main_plot\": {},\n        \"subplots\": {\n            \"RSI\": {\n                \"rsi\": {\"color\": \"red\"},\n            },\n        },\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),(\"BTC/USDT\", \"15m\")]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=1\n        )\n        dataframe[\"bb1_lowerband\"] = bollinger1[\"lower\"]\n        dataframe[\"bb1_middleband\"] = bollinger1[\"mid\"]\n        dataframe[\"bb1_upperband\"] = bollinger1[\"upper\"]\n\n        bollinger2 = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe[\"bb2_lowerband\"] = bollinger2[\"lower\"]\n        dataframe[\"bb2_middleband\"] = bollinger2[\"mid\"]\n        dataframe[\"bb2_upperband\"] = bollinger2[\"upper\"]\n\n        bollinger4 = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=4\n        )\n        dataframe[\"bb4_lowerband\"] = bollinger4[\"lower\"]\n        dataframe[\"bb4_middleband\"] = bollinger4[\"mid\"]\n        dataframe[\"bb4_upperband\"] = bollinger4[\"upper\"]\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe[\"rsi\"] > 30)\n                & (dataframe[\"close\"] < dataframe[\"bb2_lowerband\"])\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"buy\",\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe[\"close\"] > dataframe[\"bb2_upperband\"])\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"sell\",\n        ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MostOfAll/MostOfAll.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\nimport numpy as np\nfrom functools import reduce\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.hyper import DecimalParameter\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\nfrom freqtrade.strategy import stoploss_from_open\n\n\ndef MOST(dataframe, length=8, percent=2, MAtype=1):\n    \"\"\"Partial implementation of MOST indicator.\"\"\"\n\n    data = dataframe.copy()\n\n    # Compute basic upper and lower bands\n    if MAtype==1:\n        data['exma']=ta.EMA(data, timeperiod = length)\n    elif MAtype==2:\n        data['exma']=ta.DEMA(data, timeperiod = length)\n    elif MAtype==3:\n        data['exma']=ta.T3(data, timeperiod = length)\n\n    data['basic_ub'] = data['exma'] * (1+percent/100)\n    data['basic_lb'] = data['exma'] * (1-percent/100)\n\n    # Compute final upper and lower bands\n    data['final_ub'] = 0.00\n    data['final_lb'] = 0.00\n    for i in range(length, len(data)):\n        data['final_ub'].iat[i] = data['basic_ub'].iat[i] if data['basic_ub'].iat[i] < data['final_ub'].iat[i - 1] or data['exma'].iat[i - 1] > data['final_ub'].iat[i - 1] else data['final_ub'].iat[i - 1]\n        data['final_lb'].iat[i] = data['basic_lb'].iat[i] if data['basic_lb'].iat[i] > data['final_lb'].iat[i - 1] or data['exma'].iat[i - 1] < data['final_lb'].iat[i - 1] else data['final_lb'].iat[i - 1]\n\n    # Set the MOST value\n    data['most'] = 0.00\n    for i in range(length, len(data)):\n        data['most'].iat[i] = data['final_ub'].iat[i] if data['most'].iat[i - 1] == data['final_ub'].iat[i - 1] and data['exma'].iat[i] <= data['final_ub'].iat[i] else \\\n                        data['final_lb'].iat[i] if data['most'].iat[i - 1] == data['final_ub'].iat[i - 1] and data['exma'].iat[i] >  data['final_ub'].iat[i] else \\\n                        data['final_lb'].iat[i] if data['most'].iat[i - 1] == data['final_lb'].iat[i - 1] and data['exma'].iat[i] >= data['final_lb'].iat[i] else \\\n                        data['final_ub'].iat[i] if data['most'].iat[i - 1] == data['final_lb'].iat[i - 1] and data['exma'].iat[i] <  data['final_lb'].iat[i] else 0.00\n\n    # Mark the trend direction up/down\n    data['trend'] = np.where((data['most'] > 0.00), np.where((data['exma'] < data['most']), 0, 1), np.NaN)\n\n    # Remove basic and final bands from the columns\n    data.drop(['basic_ub', 'basic_lb', 'final_ub', 'final_lb'], inplace=True, axis=1)\n    data.fillna(0, inplace=True)\n\n    return data\n\n\nclass MostOfAll(IStrategy):\n    \"\"\"\n        My second humble strategy using a MOST alike indicator\n        Changelog:\n            0.9 Initial version, improvements needed\n\n        https://github.com/cyberjunky/freqtrade-strategies\n        https://www.tradingview.com/scripts/most/\n\n    \"\"\"\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.2\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.015\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.08,\n        \"36\": 0.031,\n        \"50\": 0.021,\n        \"60\": 0.01,\n        \"70\": 0\n    }\n\n    @property\n    def plot_config(self):\n        \"\"\"Buildin plot config.\"\"\"\n        return {\n            # Main plot indicators (Moving averages, ...)\n            'main_plot': {\n                    'most': {'color': 'darkpurple'},\n                    'exma': {'color': 'green'}\n            },\n            'subplots': {\n                # Subplots - each dict defines one additional plot\n                \"trend\": {\n                    'trend': {'color': 'blue'}\n                }\n            }\n        }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.99, decimals=3, space='sell', load=True)\n\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.009, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.040, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.020, decimals=3, space='sell', load=True)\n\n    # Custom stoploss\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        \"\"\"Custom stoploss calculation with thresholds and based on linear curve.\"\"\"\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if current_profit > PF_2:\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif current_profit > PF_1:\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if sl_profit >= current_profit:\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # MOST\n        most_df = MOST(dataframe, length=14)\n        dataframe['most'] = most_df['most']\n        dataframe['exma'] = most_df['exma']\n        dataframe['trend'] = most_df['trend']\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        If the bullish fractal is active and below the teeth of the gator -> buy\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        conditions = []\n        conditions.append(\n            (\n                (qtpylib.crossed_above(dataframe['most'], dataframe['exma'])) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        If the bearish fractal is active and above the teeth of the gator -> sell\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        conditions = []\n        conditions.append(\n            (\n                (qtpylib.crossed_above(dataframe['exma'], dataframe['most'])) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MultiMA_TSL/MultiMA_TSL.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, BooleanParameter, CategoricalParameter, stoploss_from_open)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom technical.indicators import zema\n\n###########################################################################################################\n##    MultiMA_TSL, modded by stash86, based on SMAOffsetProtectOptV1 (modded by Perkmeister)             ##\n##    Based on @Lamborghini Store's SMAOffsetProtect strat, heavily based on @tirail's original SMAOffset##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n\n# I hope you do enough testing before proceeding, either backtesting and/or dry run.\n# Any profits and losses are all your responsibility\n\nclass MultiMA_TSL(IStrategy):\n    INTERFACE_VERSION = 2\n\n    buy_params = {\n        \"base_nb_candles_buy_ema\": 50,\n        \"low_offset_ema\": 1.061,\n\n        \"base_nb_candles_buy_zema\": 30,\n        \"low_offset_zema\": 0.963,\n        \"rsi_buy_zema\": 50,\n\n        \"base_nb_candles_buy_trima\": 14,\n        \"low_offset_trima\": 0.963,\n        \"rsi_buy_trima\": 50,\n\n        \"buy_roc_max\": 45,\n\n        \"buy_condition_trima_enable\": True,\n        \"buy_condition_zema_enable\": True,\n    }\n\n    sell_params = {\n        \"base_nb_candles_sell\": 32,\n        \"high_offset_ema\": 1.002,\n\n        \"base_nb_candles_sell_trima\": 48,\n        \"high_offset_trima\": 1.085,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -0.15\n\n    # Multi Offset\n    base_nb_candles_sell = IntParameter(5, 80, default=20, space='sell', optimize=False)\n    base_nb_candles_sell_trima = IntParameter(5, 80, default=20, space='sell', optimize=False)\n    high_offset_trima = DecimalParameter(0.99, 1.1, default=1.012, space='sell', optimize=False)\n\n    base_nb_candles_buy_ema = IntParameter(5, 80, default=20, space='buy', optimize=False)\n    low_offset_ema = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=False)\n    high_offset_ema = DecimalParameter(0.99, 1.1, default=1.012, space='sell', optimize=False)\n    rsi_buy_ema = IntParameter(30, 70, default=61, space='buy', optimize=False)\n\n    base_nb_candles_buy_trima = IntParameter(5, 80, default=20, space='buy', optimize=False)\n    low_offset_trima = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=False)\n    rsi_buy_trima = IntParameter(30, 70, default=61, space='buy', optimize=False)\n\n    base_nb_candles_buy_zema = IntParameter(5, 80, default=20, space='buy', optimize=False)\n    low_offset_zema = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=False)\n    rsi_buy_zema = IntParameter(30, 70, default=61, space='buy', optimize=False)\n\n    buy_condition_enable_optimize = True\n    buy_condition_trima_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n    buy_condition_zema_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n\n    # Protection1\n    ewo_low = DecimalParameter(-20.0, -8.0, default=-20.0, space='buy', optimize=False)\n    ewo_high = DecimalParameter(2.0, 12.0, default=6.0, space='buy', optimize=False)\n    fast_ewo = IntParameter(10, 50, default=50, space='buy', optimize=False)\n    slow_ewo = IntParameter(100, 200, default=200, space='buy', optimize=False)\n    buy_roc_max = DecimalParameter(20, 70, default=55, space='buy', optimize=False)\n    buy_peak_max = DecimalParameter(1, 1.1, default=1.03, decimals=3, space='buy', optimize=False)\n    buy_rsi_fast = IntParameter(0, 50, default=35, space='buy', optimize=False)\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.018\n\n    use_custom_stoploss = True\n\n    # Protection hyperspace params:\n    protection_params = {\n        \"low_profit_lookback\": 60,\n        \"low_profit_min_req\": 0.03,\n        \"low_profit_stop_duration\": 29,\n\n        \"cooldown_lookback\": 2,  # value loaded from strategy\n        \"stoploss_lookback\": 72,  # value loaded from strategy\n        \"stoploss_stop_duration\": 20,  # value loaded from strategy\n    }\n\n    cooldown_lookback = IntParameter(2, 48, default=2, space=\"protection\", optimize=False)\n\n    low_profit_lookback = IntParameter(2, 60, default=20, space=\"protection\", optimize=False)\n    low_profit_stop_duration = IntParameter(12, 200, default=20, space=\"protection\", optimize=False)\n    low_profit_min_req = DecimalParameter(-0.05, 0.05, default=-0.05, space=\"protection\", decimals=2, optimize=False)\n\n    @property\n    def protections(self):\n        prot = []\n\n        prot.append({\n            \"method\": \"CooldownPeriod\",\n            \"stop_duration_candles\": self.cooldown_lookback.value\n        })\n        prot.append({\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": self.low_profit_lookback.value,\n            \"trade_limit\": 1,\n            \"stop_duration\": int(self.low_profit_stop_duration.value),\n            \"required_profit\": self.low_profit_min_req.value\n        })\n\n        return prot\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    #credit to Perkmeister for this custom stoploss to help the strategy ride a green candle when the sell signal triggered\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if not self.config['runmode'].value in ('backtest', 'hyperopt'):\n            dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n            if(len(dataframe) >= 1):\n                last_candle = dataframe.iloc[-1]\n                if((last_candle['sell_copy'] == 1) & (last_candle['buy_copy'] == 0)):\n                    sl_new = 0.001\n\n        return sl_new\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n\n        dataframe[\"roc_max\"] = dataframe[\"close\"].pct_change(48).rolling(12).max() * 100\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        dataframe['ema_offset_buy'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema.value)) *self.low_offset_ema.value\n        dataframe['zema_offset_buy'] = zema(dataframe, int(self.base_nb_candles_buy_zema.value)) *self.low_offset_zema.value\n        dataframe['trima_offset_buy'] = ta.TRIMA(dataframe, int(self.base_nb_candles_buy_trima.value)) *self.low_offset_trima.value\n        \n        dataframe.loc[:, 'buy_tag'] = ''\n        dataframe.loc[:, 'buy_copy'] = 0\n        dataframe.loc[:, 'buy'] = 0\n\n        buy_offset_trima = (\n            self.buy_condition_trima_enable.value &\n            (dataframe['close'] < dataframe['trima_offset_buy']) &\n            (\n                (dataframe['ewo'] < self.ewo_low.value)\n                |\n                (\n                    (dataframe['ewo'] > self.ewo_high.value)\n                    &\n                    (dataframe['rsi'] < self.rsi_buy_trima.value)\n                )\n            )\n        )\n        dataframe.loc[buy_offset_trima, 'buy_tag'] += 'trima '\n        conditions.append(buy_offset_trima)\n\n        buy_offset_zema = (\n            self.buy_condition_zema_enable.value &\n            (dataframe['close'] < dataframe['zema_offset_buy']) &\n            (\n                (dataframe['ewo'] < self.ewo_low.value)\n                |\n                (\n                    (dataframe['ewo'] > self.ewo_high.value)\n                    &\n                    (dataframe['rsi'] < self.rsi_buy_zema.value)\n                )\n            )\n        )\n        dataframe.loc[buy_offset_zema, 'buy_tag'] += 'zema '\n        conditions.append(buy_offset_zema)\n\n        add_check = (\n            (dataframe['rsi_fast'] < self.buy_rsi_fast.value)\n            &\n            (dataframe['close'] < dataframe['ema_offset_buy'])\n            &\n            (dataframe['volume'] > 0)\n        )\n        \n        if conditions:\n            dataframe.loc[\n                (add_check & reduce(lambda x, y: x | y, conditions)),\n                ['buy_copy','buy']\n            ]=(1,1)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell_copy'] = 0\n\n        dataframe['ema_offset_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_sell.value)) *self.high_offset_ema.value\n        dataframe['trima_offset_sell'] = ta.TRIMA(dataframe, int(self.base_nb_candles_sell_trima.value)) *self.high_offset_trima.value\n\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['ema_offset_sell']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['trima_offset_sell']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                ['sell_copy', 'sell']\n            ]=(1,1)\n\n        if not self.config['runmode'].value in ('backtest', 'hyperopt'):\n            dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/MultiMA_TSL3/MultiMA_TSL3.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, BooleanParameter, timeframe_to_minutes, stoploss_from_open)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom technical.indicators import zema, VIDYA\n\n\n###########################################################################################################\n##    MultiMA_TSL, modded by stash86, based on SMAOffsetProtectOptV1 (modded by Perkmeister)             ##\n##    Based on @Lamborghini Store's SMAOffsetProtect strat, heavily based on @tirail's original SMAOffset##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n##    Thanks to                                                                                          ##\n##    - Perkmeister, for their snippets for the sell signals and decaying EMA sell                       ##\n##    - ChangeToTower, for the PMax idea                                                                 ##\n##    - JimmyNixx, for their snippet to limit close value from the peak (that I modify into 5m tf check) ##\n##    - froggleston, for the Heikinashi check snippet from Cryptofrog                                    ##\n##    - Uzirox, for their pump detection code                                                            ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n\n# I hope you do enough testing before proceeding, either backtesting and/or dry run.\n# Any profits and losses are all your responsibility\n\nclass MultiMA_TSL3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    DATESTAMP = 0\n    SELLMA = 1\n    SELL_TRIGGER = 2\n\n    buy_params = {\n        \"base_nb_candles_buy_trima\": 15,\n        \"base_nb_candles_buy_trima2\": 38,\n        \"low_offset_trima\": 0.959,\n        \"low_offset_trima2\": 0.949,\n\n        \"base_nb_candles_buy_ema\": 9,\n        \"base_nb_candles_buy_ema2\": 75,\n        \"low_offset_ema\": 1.067,\n        \"low_offset_ema2\": 0.973,\n\n        \"base_nb_candles_buy_zema\": 25,\n        \"base_nb_candles_buy_zema2\": 53,\n        \"low_offset_zema\": 0.958,\n        \"low_offset_zema2\": 0.961,\n\n        \"base_nb_candles_buy_hma\": 70,\n        \"base_nb_candles_buy_hma2\": 12,\n        \"low_offset_hma\": 0.948,\n        \"low_offset_hma2\": 0.941,\n\n        \"ewo_high\": 2.615,\n        \"ewo_high2\": 2.188,\n        \"ewo_low\": -19.632,\n        \"ewo_low2\": -19.955,\n        \"rsi_buy\": 60,\n        \"rsi_buy2\": 45,\n\n    }\n\n    sell_params = {\n        \"base_nb_candles_ema_sell\": 5,\n        \"high_offset_sell_ema\": 0.994,\n        # custom stoploss params, come from BB_RPB_TSL\n        \"pHSL\": -0.32,\n        \"pPF_1\": 0.02,\n        \"pPF_2\": 0.047,\n        \"pSL_1\": 0.02,\n        \"pSL_2\": 0.046,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -0.15\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    optimize_sell_ema = True\n    base_nb_candles_ema_sell = IntParameter(5, 80, default=20, space='sell', optimize=True)\n    high_offset_sell_ema = DecimalParameter(0.99, 1.1, default=1.012, space='sell', optimize=True)\n    base_nb_candles_ema_sell2 = IntParameter(5, 80, default=20, space='sell', optimize=True)\n\n    # Multi Offset\n    optimize_buy_ema = True\n    base_nb_candles_buy_ema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n    base_nb_candles_buy_ema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema2 = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n\n    optimize_buy_trima = True\n    base_nb_candles_buy_trima = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n    base_nb_candles_buy_trima2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n\n    optimize_buy_zema = True\n    base_nb_candles_buy_zema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n    base_nb_candles_buy_zema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n\n    optimize_buy_hma = True\n    base_nb_candles_buy_hma = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n    base_nb_candles_buy_hma2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n\n    buy_condition_enable_optimize = True\n    buy_condition_trima_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n    buy_condition_zema_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n    buy_condition_hma_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n\n    # Protection\n    ewo_check_optimize = True\n    ewo_low = DecimalParameter(-20.0, -8.0, default=-20.0, space='buy', optimize=ewo_check_optimize)\n    ewo_high = DecimalParameter(2.0, 12.0, default=6.0, space='buy', optimize=ewo_check_optimize)\n    ewo_low2 = DecimalParameter(-20.0, -8.0, default=-20.0, space='buy', optimize=ewo_check_optimize)\n    ewo_high2 = DecimalParameter(2.0, 12.0, default=6.0, space='buy', optimize=ewo_check_optimize)\n\n    rsi_buy_optimize = True\n    rsi_buy = IntParameter(30, 70, default=50, space='buy', optimize=rsi_buy_optimize)\n    rsi_buy2 = IntParameter(30, 70, default=50, space='buy', optimize=rsi_buy_optimize)\n    buy_rsi_fast = IntParameter(0, 50, default=35, space='buy', optimize=True)\n\n    fast_ewo = IntParameter(10, 50, default=50, space='buy', optimize=True)\n    slow_ewo = IntParameter(100, 200, default=200, space='buy', optimize=True)\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.018\n\n    use_custom_stoploss = True\n\n    # Protection hyperspace params:\n    protection_params = {\n        \"low_profit_lookback\": 48,\n        \"low_profit_min_req\": 0.04,\n        \"low_profit_stop_duration\": 14,\n\n        \"cooldown_lookback\": 2,  # value loaded from strategy\n        \"stoploss_lookback\": 72,  # value loaded from strategy\n        \"stoploss_stop_duration\": 20,  # value loaded from strategy\n    }\n\n    cooldown_lookback = IntParameter(2, 48, default=2, space=\"protection\", optimize=True)\n\n    low_profit_optimize = True\n    low_profit_lookback = IntParameter(2, 60, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_stop_duration = IntParameter(12, 200, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_min_req = DecimalParameter(-0.05, 0.05, default=-0.05, space=\"protection\", decimals=2,\n                                          optimize=low_profit_optimize)\n\n    @property\n    def protections(self):\n        prot = []\n\n        prot.append({\n            \"method\": \"CooldownPeriod\",\n            \"stop_duration_candles\": self.cooldown_lookback.value\n        })\n        prot.append({\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": self.low_profit_lookback.value,\n            \"trade_limit\": 1,\n            \"stop_duration\": int(self.low_profit_stop_duration.value),\n            \"required_profit\": self.low_profit_min_req.value\n        })\n\n        return prot\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # storage dict for custom info\n    custom_info = {}\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        if (len(dataframe) < 1):\n            return False\n        last_candle = dataframe.iloc[-1]\n\n        if (self.custom_info[pair][self.DATESTAMP] != last_candle['date']):\n            # new candle, update EMA and check sell\n\n            # smoothing coefficients\n            sell_ema = self.custom_info[pair][self.SELLMA]\n            if (sell_ema == 0):\n                sell_ema = last_candle['ema_sell']\n            emaLength = 32\n            alpha = 2 / (1 + emaLength)\n\n            # update sell_ema\n            sell_ema = (alpha * last_candle['close']) + ((1 - alpha) * sell_ema)\n            self.custom_info[pair][self.SELLMA] = sell_ema\n            self.custom_info[pair][self.DATESTAMP] = last_candle['date']\n\n            if ((last_candle['close'] > (sell_ema * self.high_offset_sell_ema.value)) & (last_candle['buy_copy'] == 0)):\n                if self.config['runmode'].value in ('live', 'dry_run'):\n                    self.custom_info[pair][self.SELL_TRIGGER] = 1\n                    return False\n\n                buy_tag = 'empty'\n\n                if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n                    buy_tag = trade.buy_tag\n                else:\n                    trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n                    buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n                    if not buy_signal.empty:\n                        buy_signal_candle = buy_signal.iloc[-1]\n                        buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n\n                return f'New Sell Signal ({buy_tag})'\n\n        return False\n\n    # credit to Perkmeister for this custom stoploss to help the strategy ride a green candle when the sell signal triggered\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str,\n                            **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        if (len(dataframe) < 1):\n            return False\n        last_candle = dataframe.iloc[-1].squeeze()\n        if ((rate > last_candle['close'])):\n            return False\n\n        self.custom_info[pair][self.DATESTAMP] = last_candle['date']\n        self.custom_info[pair][self.SELLMA] = last_candle['ema_sell']\n\n        return True\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        self.custom_info[pair][self.SELL_TRIGGER] = 0\n        return True\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close']) / 4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe = HA(dataframe, 4)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n        else:\n            dataframe['live_data_ok'] = True\n\n        # Check if the entry already exists\n        if not metadata[\"pair\"] in self.custom_info:\n            # Create empty entry for this pair {datestamp, sellma, sell_trigger}\n            self.custom_info[metadata[\"pair\"]] = ['', 0, 0]\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe['ema_offset_buy'] = ta.EMA(dataframe,\n                                             int(self.base_nb_candles_buy_ema.value)) * self.low_offset_ema.value\n        dataframe['ema_offset_buy2'] = ta.EMA(dataframe,\n                                              int(self.base_nb_candles_buy_ema2.value)) * self.low_offset_ema2.value\n        dataframe['ema_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_ema_sell.value))\n\n        dataframe.loc[:, 'buy_tag'] = ''\n        dataframe.loc[:, 'buy_copy'] = 0\n        dataframe.loc[:, 'buy'] = 0\n\n        if (self.buy_condition_trima_enable.value):\n            dataframe['trima_offset_buy'] = ta.TRIMA(dataframe,\n                                                     int(self.base_nb_candles_buy_trima.value)) * self.low_offset_trima.value\n            dataframe['trima_offset_buy2'] = ta.TRIMA(dataframe,\n                                                      int(self.base_nb_candles_buy_trima2.value)) * self.low_offset_trima2.value\n\n            buy_offset_trima = (\n                    (\n                            (dataframe['close'] < dataframe['trima_offset_buy'])\n                            &\n                            (dataframe['pm'] <= dataframe['pmax_thresh'])\n                    )\n                    |\n                    (\n                            (dataframe['close'] < dataframe['trima_offset_buy2'])\n                            &\n                            (dataframe['pm'] > dataframe['pmax_thresh'])\n                    )\n            )\n            dataframe.loc[buy_offset_trima, 'buy_tag'] += 'trima '\n            conditions.append(buy_offset_trima)\n\n        if (self.buy_condition_zema_enable.value):\n            dataframe['zema_offset_buy'] = zema(dataframe,\n                                                int(self.base_nb_candles_buy_zema.value)) * self.low_offset_zema.value\n            dataframe['zema_offset_buy2'] = zema(dataframe,\n                                                 int(self.base_nb_candles_buy_zema2.value)) * self.low_offset_zema2.value\n            buy_offset_zema = (\n                    (\n                            (dataframe['close'] < dataframe['zema_offset_buy'])\n                            &\n                            (dataframe['pm'] <= dataframe['pmax_thresh'])\n                    )\n                    |\n                    (\n                            (dataframe['close'] < dataframe['zema_offset_buy2'])\n                            &\n                            (dataframe['pm'] > dataframe['pmax_thresh'])\n                    )\n            )\n            dataframe.loc[buy_offset_zema, 'buy_tag'] += 'zema '\n            conditions.append(buy_offset_zema)\n\n        if (self.buy_condition_hma_enable.value):\n            dataframe['hma_offset_buy'] = qtpylib.hull_moving_average(dataframe['close'], window=int(\n                self.base_nb_candles_buy_hma.value)) * self.low_offset_hma.value\n            dataframe['hma_offset_buy2'] = qtpylib.hull_moving_average(dataframe['close'], window=int(\n                self.base_nb_candles_buy_hma2.value)) * self.low_offset_hma2.value\n            buy_offset_hma = (\n                    (\n                            (\n                                    (dataframe['close'] < dataframe['hma_offset_buy'])\n                                    &\n                                    (dataframe['pm'] <= dataframe['pmax_thresh'])\n                                    &\n                                    (dataframe['rsi'] < 35)\n\n                            )\n                            |\n                            (\n                                    (dataframe['close'] < dataframe['hma_offset_buy2'])\n                                    &\n                                    (dataframe['pm'] > dataframe['pmax_thresh'])\n                                    &\n                                    (dataframe['rsi'] < 30)\n                            )\n                    )\n                    &\n                    (dataframe['rsi_fast'] < 30)\n\n            )\n            dataframe.loc[buy_offset_hma, 'buy_tag'] += 'hma '\n            conditions.append(buy_offset_hma)\n\n        add_check = (\n                (dataframe['live_data_ok'])\n                &\n                (dataframe['close'] < dataframe['Smooth_HA_L'])\n                &\n                (dataframe['close'] < (dataframe['ema_sell'] * self.high_offset_sell_ema.value))\n                &\n                (dataframe['close'].rolling(288).max() >= (dataframe['close'] * 1.10))\n                &\n                (dataframe['Smooth_HA_O'].shift(1) < dataframe['Smooth_HA_H'].shift(1))\n                &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value)\n                &\n                (dataframe['rsi_84'] < 60)\n                &\n                (dataframe['rsi_112'] < 60)\n                &\n                (\n                        (\n                                (dataframe['close'] < dataframe['ema_offset_buy'])\n                                &\n                                (dataframe['pm'] <= dataframe['pmax_thresh'])\n                                &\n                                (\n                                        (dataframe['ewo'] < self.ewo_low.value)\n                                        |\n                                        (\n                                                (dataframe['ewo'] > self.ewo_high.value)\n                                                &\n                                                (dataframe['rsi'] < self.rsi_buy.value)\n                                        )\n                                )\n                        )\n                        |\n                        (\n                                (dataframe['close'] < dataframe['ema_offset_buy2'])\n                                &\n                                (dataframe['pm'] > dataframe['pmax_thresh'])\n                                &\n                                (\n                                        (dataframe['ewo'] < self.ewo_low2.value)\n                                        |\n                                        (\n                                                (dataframe['ewo'] > self.ewo_high2.value)\n                                                &\n                                                (dataframe['rsi'] < self.rsi_buy2.value)\n                                        )\n                                )\n                        )\n                )\n                &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                (add_check & reduce(lambda x, y: x | y, conditions)),\n                ['buy_copy', 'buy']\n            ] = (1, 1)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n\nclass MultiMA_TSL3a(MultiMA_TSL3):\n    informative_timeframe = '1h'\n    timeframe_15m = '15m'\n\n    min_rsi_sell = 50\n    min_rsi_sell_15m = 70\n\n    max_change_pump = 35\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        informative_pairs.extend([(pair, self.timeframe_15m) for pair in pairs])\n        return informative_pairs\n\n    def get_informative_15m_indicators(self, metadata: dict):\n        dataframe = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.timeframe_15m)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        informative_15m = self.get_informative_15m_indicators(metadata)\n        dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.timeframe_15m, ffill=True)\n        drop_columns = [(s + \"_\" + self.timeframe_15m) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close']) / 4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe = HA(dataframe, 4)\n\n        # pump detector\n        dataframe['pump'] = pump_warning(dataframe, perc=int(self.max_change_pump))  # 25% di pump\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n        else:\n            dataframe['live_data_ok'] = True\n\n        # Check if the entry already exists\n        if not metadata[\"pair\"] in self.custom_info:\n            # Create empty entry for this pair {datestamp, sellma, sell_trigger}\n            self.custom_info[metadata[\"pair\"]] = ['', 0, 0]\n\n        return dataframe\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        if (len(dataframe) < 1):\n            return False\n        last_candle = dataframe.iloc[-1]\n\n        if (self.custom_info[pair][self.DATESTAMP] != last_candle['date']):\n            # new candle, update EMA and check sell\n\n            # smoothing coefficients\n            sell_ema = self.custom_info[pair][self.SELLMA]\n            if (sell_ema == 0):\n                sell_ema = last_candle['ema_sell']\n            emaLength = 32\n            alpha = 2 / (1 + emaLength)\n\n            # update sell_ema\n            sell_ema = (alpha * last_candle['close']) + ((1 - alpha) * sell_ema)\n            self.custom_info[pair][self.SELLMA] = sell_ema\n            self.custom_info[pair][self.DATESTAMP] = last_candle['date']\n\n            sell_tag = ''\n\n            if (\n                    (last_candle['close'] > (sell_ema * self.high_offset_sell_ema.value))\n                    &\n                    (last_candle['buy_copy'] == 0)\n                    &\n                    (last_candle['rsi'] > self.min_rsi_sell)\n            ):\n                if self.config['runmode'].value in ('live', 'dry_run'):\n                    self.custom_info[pair][self.SELL_TRIGGER] = 1\n                    return False\n\n                sell_tag = 'Decaying EMA'\n\n            if (\n                    (last_candle['rsi_fast_15m'] > self.min_rsi_sell_15m)\n                    &\n                    (last_candle['buy_copy'] == 0)\n                    &\n                    (last_candle['rsi'] > self.min_rsi_sell)\n            ):\n                if self.config['runmode'].value in ('live', 'dry_run'):\n                    self.custom_info[pair][self.SELL_TRIGGER] = 1\n                    return False\n\n                sell_tag = 'RSI 15m Overbought'\n\n            if not (sell_tag == ''):\n                buy_tag = 'empty'\n\n                if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n                    buy_tag = trade.buy_tag\n                else:\n                    trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n                    buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n                    if not buy_signal.empty:\n                        buy_signal_candle = buy_signal.iloc[-1]\n                        buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n\n                return f'{sell_tag} ({buy_tag})'\n\n        return False\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe['ema_offset_buy'] = ta.EMA(dataframe,\n                                             int(self.base_nb_candles_buy_ema.value)) * self.low_offset_ema.value\n        dataframe['ema_offset_buy2'] = ta.EMA(dataframe,\n                                              int(self.base_nb_candles_buy_ema2.value)) * self.low_offset_ema2.value\n        dataframe['ema_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_ema_sell.value))\n\n        dataframe.loc[:, 'buy_tag'] = ''\n        dataframe.loc[:, 'buy_copy'] = 0\n        dataframe.loc[:, 'buy'] = 0\n\n        if (self.buy_condition_trima_enable.value):\n            dataframe['trima_offset_buy'] = ta.TRIMA(dataframe,\n                                                     int(self.base_nb_candles_buy_trima.value)) * self.low_offset_trima.value\n            dataframe['trima_offset_buy2'] = ta.TRIMA(dataframe,\n                                                      int(self.base_nb_candles_buy_trima2.value)) * self.low_offset_trima2.value\n\n            buy_offset_trima = (\n                    (\n                            (dataframe['close'] < dataframe['trima_offset_buy'])\n                            &\n                            (dataframe['pm'] <= dataframe['pmax_thresh'])\n                    )\n                    |\n                    (\n                            (dataframe['close'] < dataframe['trima_offset_buy2'])\n                            &\n                            (dataframe['pm'] > dataframe['pmax_thresh'])\n                    )\n            )\n            dataframe.loc[buy_offset_trima, 'buy_tag'] += 'trima '\n            conditions.append(buy_offset_trima)\n\n        if (self.buy_condition_zema_enable.value):\n            dataframe['zema_offset_buy'] = zema(dataframe,\n                                                int(self.base_nb_candles_buy_zema.value)) * self.low_offset_zema.value\n            dataframe['zema_offset_buy2'] = zema(dataframe,\n                                                 int(self.base_nb_candles_buy_zema2.value)) * self.low_offset_zema2.value\n            buy_offset_zema = (\n                    (\n                            (dataframe['close'] < dataframe['zema_offset_buy'])\n                            &\n                            (dataframe['pm'] <= dataframe['pmax_thresh'])\n                    )\n                    |\n                    (\n                            (dataframe['close'] < dataframe['zema_offset_buy2'])\n                            &\n                            (dataframe['pm'] > dataframe['pmax_thresh'])\n                    )\n            )\n            dataframe.loc[buy_offset_zema, 'buy_tag'] += 'zema '\n            conditions.append(buy_offset_zema)\n\n        if (self.buy_condition_hma_enable.value):\n            dataframe['hma_offset_buy'] = qtpylib.hull_moving_average(dataframe['close'], window=int(\n                self.base_nb_candles_buy_hma.value)) * self.low_offset_hma.value\n            dataframe['hma_offset_buy2'] = qtpylib.hull_moving_average(dataframe['close'], window=int(\n                self.base_nb_candles_buy_hma2.value)) * self.low_offset_hma2.value\n            buy_offset_hma = (\n                    (\n                            (\n                                    (dataframe['close'] < dataframe['hma_offset_buy'])\n                                    &\n                                    (dataframe['pm'] <= dataframe['pmax_thresh'])\n                                    &\n                                    (dataframe['rsi'] < 35)\n\n                            )\n                            |\n                            (\n                                    (dataframe['close'] < dataframe['hma_offset_buy2'])\n                                    &\n                                    (dataframe['pm'] > dataframe['pmax_thresh'])\n                                    &\n                                    (dataframe['rsi'] < 30)\n                            )\n                    )\n                    &\n                    (dataframe['rsi_fast'] < 30)\n\n            )\n            dataframe.loc[buy_offset_hma, 'buy_tag'] += 'hma '\n            conditions.append(buy_offset_hma)\n\n        add_check = (\n                (dataframe['live_data_ok'])\n                &\n                (dataframe['close'] < dataframe['Smooth_HA_L'])\n                &\n                (dataframe['close'] < (dataframe['ema_sell'] * self.high_offset_sell_ema.value))\n                &\n                (dataframe['close'].rolling(288).max() >= (dataframe['close'] * 1.10))\n                &\n                (dataframe['Smooth_HA_O'].shift(1) < dataframe['Smooth_HA_H'].shift(1))\n                &\n                (dataframe['rsi_fast'] < self.buy_rsi_fast.value)\n                &\n                (dataframe['rsi_84'] < 60)\n                &\n                (dataframe['rsi_112'] < 60)\n                &\n                (dataframe['pump'].rolling(20).max() < 1)\n                &\n                (\n                        (\n                                (dataframe['close'] < dataframe['ema_offset_buy'])\n                                &\n                                (dataframe['pm'] <= dataframe['pmax_thresh'])\n                                &\n                                (\n                                        (dataframe['ewo'] < self.ewo_low.value)\n                                        |\n                                        (\n                                                (dataframe['ewo'] > self.ewo_high.value)\n                                                &\n                                                (dataframe['rsi'] < self.rsi_buy.value)\n                                        )\n                                )\n                        )\n                        |\n                        (\n                                (dataframe['close'] < dataframe['ema_offset_buy2'])\n                                &\n                                (dataframe['pm'] > dataframe['pmax_thresh'])\n                                &\n                                (\n                                        (dataframe['ewo'] < self.ewo_low2.value)\n                                        |\n                                        (\n                                                (dataframe['ewo'] > self.ewo_high2.value)\n                                                &\n                                                (dataframe['rsi'] < self.rsi_buy2.value)\n                                        )\n                                )\n                        )\n                )\n                &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                (add_check & reduce(lambda x, y: x | y, conditions)),\n                ['buy_copy', 'buy']\n            ] = (1, 1)\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier / 10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier / 10) * df[atr])\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n                basic_ub[i] < final_ub[i - 1]\n                or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n                basic_lb[i] > final_lb[i - 1]\n                or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                            and mavalue[i] <= final_ub[i])\n            else final_lb[i] if (\n                    pm_arr[i - 1] == final_ub[i - 1]\n                    and mavalue[i] > final_ub[i]) else final_lb[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] >= final_lb[i]) else final_ub[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down', 'up'), np.NaN)\n\n    return pm, pmx\n\n\n# smoothed Heiken Ashi\ndef HA(dataframe, smoothing=None):\n    df = dataframe.copy()\n\n    df['HA_Close'] = (df['open'] + df['high'] + df['low'] + df['close']) / 4\n\n    df.reset_index(inplace=True)\n\n    ha_open = [(df['open'][0] + df['close'][0]) / 2]\n    [ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df) - 1)]\n    df['HA_Open'] = ha_open\n\n    df.set_index('index', inplace=True)\n\n    df['HA_High'] = df[['HA_Open', 'HA_Close', 'high']].max(axis=1)\n    df['HA_Low'] = df[['HA_Open', 'HA_Close', 'low']].min(axis=1)\n\n    if smoothing is not None:\n        sml = abs(int(smoothing))\n        if sml > 0:\n            df['Smooth_HA_O'] = ta.EMA(df['HA_Open'], sml)\n            df['Smooth_HA_C'] = ta.EMA(df['HA_Close'], sml)\n            df['Smooth_HA_H'] = ta.EMA(df['HA_High'], sml)\n            df['Smooth_HA_L'] = ta.EMA(df['HA_Low'], sml)\n\n    return df\n\n\ndef pump_warning(dataframe, perc=15):\n    # NOTE: segna \"1\" se c'è un pump\n    df = dataframe.copy()\n    df[\"change\"] = df[\"high\"] - df[\"low\"]\n    df[\"test1\"] = (df[\"close\"] > df[\"open\"])\n    df[\"test2\"] = ((df[\"change\"] / df[\"low\"]) > (perc / 100))\n    df[\"result\"] = (df[\"test1\"] & df[\"test2\"]).astype('int')\n    return df['result']"
  },
  {
    "path": "strategies/MultiMA_TSL3_Mod/MultiMA_TSL3_Mod.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, RealParameter,BooleanParameter, timeframe_to_minutes)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom technical.indicators import zema, VIDYA\n\n###########################################################################################################\n##    MultiMA_TSL, modded by stash86, based on SMAOffsetProtectOptV1 (modded by Perkmeister)             ##\n##    Based on @Lamborghini Store's SMAOffsetProtect strat, heavily based on @tirail's original SMAOffset##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n##    Thanks to                                                                                          ##\n##    - Perkmeister, for their snippets for the sell signals and decaying EMA sell                       ##\n##    - ChangeToTower, for the PMax idea                                                                 ##\n##    - JimmyNixx, for their snippet to limit close value from the peak (that I modify into 5m tf check) ##\n##    - froggleston, for the Heikinashi check snippet from Cryptofrog                                    ##\n##    - Uzirox, for their pump detection code                                                            ##\n##                                                                                                       ##\n##                                                                                                       ##\n###########################################################################################################\n\n# I hope you do enough testing before proceeding, either backtesting and/or dry run.\n# Any profits and losses are all your responsibility\n\nclass MultiMA_TSL3_Mod(IStrategy):\n    INTERFACE_VERSION = 2\n\n    DATESTAMP = 0\n    SELLMA = 1\n    SELL_TRIGGER=2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_rsi_fast_max\": 98,\n        \"buy_rsi_fast_min\": 36,\n        \"buy_rsi_max\": 79,\n        \"buy_rsi_min\": 24,\n        \"ewo_high\": 0.546,\n        \"ewo_high2\": 8.497,\n        \"ewo_low\": -14.239,\n        \"ewo_low2\": -15.614,\n        \"fast_ewo\": 12,\n        \"pmax_pct_max\": 83.754,\n        \"pmax_pct_min\": 20.09,\n        \"slow_ewo\": 150,\n        \"volume_pct_max\": 8.721,\n        \"volume_pct_min\": 0.247,\n        \"buy_condition_ema_enable\": True,  # value loaded from strategy\n        \"close_pct_max\": 0.06785,\n        \"close_pct_min\": 0.01121,\n\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_ema_sell\": 65,\n        \"base_nb_candles_ema_sell2\": 49,\n        \"high_offset_sell_ema\": 1.074,\n    }\n\n    # Protection hyperspace params:\n    protection_params = {\n        \"cooldown_lookback\": 39,\n        \"low_profit_lookback\": 29,\n        \"low_profit_min_req\": -0.03,\n        \"low_profit_stop_duration\": 52,\n    }\n\n\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -0.15\n    use_custom_stoploss = True\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.018\n\n    # Buy hyperspace params:\n    \"\"\"optimize_buy_ema = False # Not used\n    base_nb_candles_buy_ema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n    base_nb_candles_buy_ema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_ema)\n    low_offset_ema2 = DecimalParameter(0.9, 1.1, default=0.958, space='buy', optimize=optimize_buy_ema)\n\n    optimize_buy_trima = False # Not used\n    base_nb_candles_buy_trima = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n    base_nb_candles_buy_trima2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_trima)\n    low_offset_trima2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_trima)\n    \n    optimize_buy_zema = False # Not used\n    base_nb_candles_buy_zema = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n    base_nb_candles_buy_zema2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_zema)\n    low_offset_zema2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_zema)\n\n    optimize_buy_hma = False # Not used\n    base_nb_candles_buy_hma = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\n    base_nb_candles_buy_hma2 = IntParameter(5, 80, default=20, space='buy', optimize=optimize_buy_hma)\n    low_offset_hma2 = DecimalParameter(0.9, 0.99, default=0.958, space='buy', optimize=optimize_buy_hma)\"\"\"\n\n    buy_condition_enable_optimize = False # Not used\n    buy_condition_ema_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n    \"\"\"buy_condition_trima_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n    buy_condition_zema_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\n    buy_condition_hma_enable = BooleanParameter(default=True, space='buy', optimize=buy_condition_enable_optimize)\"\"\"\n\n    ewo_check_optimize = True\n    ewo_low = DecimalParameter(-20.0, -8.0, default=-20.0, space='buy', optimize=ewo_check_optimize)\n    ewo_high = DecimalParameter(0.0, 12.0, default=6.0, space='buy', optimize=ewo_check_optimize)\n    ewo_low2 = DecimalParameter(-20.0, -8.0, default=-20.0, space='buy', optimize=ewo_check_optimize)\n    ewo_high2 = DecimalParameter(2.0, 12.0, default=6.0, space='buy', optimize=ewo_check_optimize)\n    fast_ewo = IntParameter(10, 50, default=50, space='buy', optimize=True)\n    slow_ewo = IntParameter(100, 200, default=200, space='buy', optimize=True)\n    \n    pct_optimize = True\n    pmax_pct_min = DecimalParameter(1.00, 100.00, default=1, space='buy', optimize=pct_optimize)\n    pmax_pct_max = DecimalParameter(1.00, 100.00, default=1, space='buy', optimize=pct_optimize)\n    volume_pct_min = DecimalParameter(0.01, 20, default=0.01, space='buy', optimize=pct_optimize)\n    volume_pct_max = DecimalParameter(0.01, 20, default=0.01, space='buy', optimize=pct_optimize)\n\n    high_precision_pct_optimize = False # Optimise this setting individually\n    close_pct_min = RealParameter(0.0001, 0.1, default=0.01, space='buy', optimize=high_precision_pct_optimize)\n    close_pct_max = RealParameter(0.0001, 0.1, default=0.01, space='buy', optimize=high_precision_pct_optimize)\n    \n    buy_rsi_optimize = True\n    buy_rsi_min = IntParameter(0, 100, default=1, space='buy', optimize=buy_rsi_optimize)\n    buy_rsi_max = IntParameter(0, 100, default=100, space='buy', optimize=buy_rsi_optimize)\n    buy_rsi_fast_min = IntParameter(0, 100, default=1, space='buy', optimize=buy_rsi_optimize)\n    buy_rsi_fast_max = IntParameter(0, 100, default=100, space='buy', optimize=buy_rsi_optimize)\n    \n    # Sell hyperspace params:\n\n    optimize_sell_ema = True\n    base_nb_candles_ema_sell = IntParameter(5, 80, default=20, space='sell', optimize=True)\n    high_offset_sell_ema = DecimalParameter(0.99, 1.1, default=1.012, space='sell', optimize=True)\n    base_nb_candles_ema_sell2 = IntParameter(5, 80, default=20, space='sell', optimize=True)\n\n    # Protection hyperspace params:\n\n    cooldown_lookback = IntParameter(2, 48, default=2, space=\"protection\", optimize=True)\n\n    low_profit_optimize = True\n    low_profit_lookback = IntParameter(2, 60, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_stop_duration = IntParameter(12, 200, default=20, space=\"protection\", optimize=low_profit_optimize)\n    low_profit_min_req = DecimalParameter(-0.05, 0.05, default=-0.05, space=\"protection\", decimals=2, optimize=low_profit_optimize)\n\n    \n    \n    @property\n    def protections(self):\n        prot = []\n\n        prot.append({\n            \"method\": \"CooldownPeriod\",\n            \"stop_duration_candles\": self.cooldown_lookback.value\n        })\n        prot.append({\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": self.low_profit_lookback.value,\n            \"trade_limit\": 1,\n            \"stop_duration\": int(self.low_profit_stop_duration.value),\n            \"required_profit\": self.low_profit_min_req.value\n        })\n\n        return prot\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # storage dict for custom info\n    custom_info = { }\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n       \n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        if(len(dataframe) < 1):\n            return False\n        last_candle = dataframe.iloc[-1]\n\n        if(self.custom_info[pair][self.DATESTAMP] != last_candle['date']):\n            # new candle, update EMA and check sell\n\n            # smoothing coefficients\n            sell_ema = self.custom_info[pair][self.SELLMA]\n            if(sell_ema == 0):\n                sell_ema = last_candle['ema_sell'] \n            emaLength = 32\n            alpha = 2 /(1 + emaLength) \n\n            # update sell_ema\n            sell_ema = (alpha * last_candle['close']) + ((1 - alpha) * sell_ema)\n            self.custom_info[pair][self.SELLMA] = sell_ema\n            self.custom_info[pair][self.DATESTAMP] = last_candle['date']\n\n            if((last_candle['close'] > (sell_ema * self.high_offset_sell_ema.value)) & (last_candle['buy_copy'] == 0)):\n                if self.config['runmode'].value in ('live', 'dry_run'):\n                    self.custom_info[pair][self.SELL_TRIGGER] = 1\n                    return False\n\n                buy_tag = 'empty'\n\n                if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n                    buy_tag = trade.buy_tag\n                else:\n                    trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n                    buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n                    if not buy_signal.empty:\n                        buy_signal_candle = buy_signal.iloc[-1]\n                        buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n\n                return f'New Sell Signal ({buy_tag})'\n        \n        return False\n\n    #credit to Perkmeister for this custom stoploss to help the strategy ride a green candle when the sell signal triggered\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if(self.custom_info[pair][self.SELL_TRIGGER] == 1):\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                sl_new = 0.001\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.01\n\n        return sl_new\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        if(len(dataframe) < 1):\n            return False\n        last_candle = dataframe.iloc[-1].squeeze()\n        if ((rate > last_candle['close'])) : \n            return False\n\n        self.custom_info[pair][self.DATESTAMP] = last_candle['date']\n        self.custom_info[pair][self.SELLMA] = last_candle['ema_sell']\n\n        return True\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        self.custom_info[pair][self.SELL_TRIGGER] = 0\n        return True\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # EWO\n        #dataframe['ema_delta'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema2.value)) - ta.EMA(dataframe, int(self.base_nb_candles_buy_ema.value)) *self.low_offset_ema.value # EWO delta? Not used anyway\n        \n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        dataframe['ha_up'] = (heikinashi['close'] > heikinashi['open']).astype('int')\n        dataframe['ha_down'] = (heikinashi['open'] > heikinashi['close']).astype('int')\n        \n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe = HA(dataframe, 4)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n        else:\n            dataframe['live_data_ok'] = True\n\n        # Check if the entry already exists\n        if not metadata[\"pair\"] in self.custom_info:\n            # Create empty entry for this pair {datestamp, sellma, sell_trigger}\n            self.custom_info[metadata[\"pair\"]] = ['', 0, 0]\n\n        dataframe['24hr_high'] = (dataframe['high'].rolling(window=288, min_periods= 288).max())\n        dataframe['smooth_high'] =ta.EMA(dataframe['24hr_high'], timeperiod=2)\n        dataframe['high_rising'] = (dataframe['smooth_high'] > dataframe['smooth_high'].shift()).astype('int')\n        dataframe['high_falling'] = (dataframe['smooth_high'] < dataframe['smooth_high'].shift()).astype('int')\n        \n        dataframe['24hr_low'] = (dataframe['low'].rolling(window=288, min_periods= 288).min())\n        dataframe['smooth_low'] =ta.EMA(dataframe['24hr_low'], timeperiod=2)\n        dataframe['low_rising'] = (dataframe['smooth_low'] > dataframe['smooth_low'].shift()).astype('int')\n        dataframe['low_falling'] = (dataframe['smooth_low'] < dataframe['smooth_low'].shift()).astype('int')\n        \n        dataframe['24hr_delta'] = (dataframe['24hr_high'] - dataframe['24hr_low'])\n        dataframe['smooth_delta'] =ta.EMA(dataframe['24hr_delta'], timeperiod=2)\n        dataframe['delta_rising'] = (dataframe['smooth_delta'] > dataframe['smooth_delta'].shift()).astype('int')\n\n        dataframe['pmax_high_delta'] = (dataframe['24hr_high'] - dataframe['pmax_thresh'])\n        dataframe['smooth_pmax_high'] =ta.EMA(dataframe['pmax_high_delta'], timeperiod=2)\n        dataframe['pmax_low_delta'] = (dataframe['pmax_thresh'] - dataframe['24hr_low'])\n        dataframe['smooth_pmax_low'] =ta.EMA(dataframe['pmax_low_delta'], timeperiod=2)\n\n        dataframe['pmax_pct'] = (dataframe['pmax_thresh'] - dataframe['24hr_low']) / (dataframe['24hr_high'] - dataframe['24hr_low']) * 100\n        dataframe['pmax_pct_rising'] = (dataframe['pmax_pct'] > dataframe['pmax_pct'].shift()).astype('int')\n\n        dataframe['smooth_volume'] =ta.EMA(dataframe['volume'], timeperiod=2)\n        dataframe['smooth_volume_slow'] =ta.EMA(dataframe['volume'], timeperiod=12)\n        dataframe['volume_pct'] =(dataframe['volume']).pct_change()\n        dataframe['smooth_volume_pct'] =ta.EMA(dataframe['volume_pct'], timeperiod=2)\n        dataframe['volume_pct_rising'] = (dataframe['volume_pct'] > dataframe['volume_pct'].shift()).astype('int')\n        dataframe['smooth_volume_pct_rising'] =ta.EMA(dataframe['volume_pct_rising'], timeperiod=2)\n\n        dataframe['close_pct'] =(dataframe['close']).pct_change()\n\n    \n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        \"\"\"dataframe['ema_offset_buy'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema.value)) *self.low_offset_ema.value\n        dataframe['ema_offset_buy2'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema2.value)) *self.low_offset_ema2.value\"\"\"\n        dataframe['ema_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_ema_sell.value))   \n        \n        dataframe.loc[:, 'buy_tag'] = ''\n        dataframe.loc[:, 'buy_copy'] = 0\n        dataframe.loc[:, 'buy'] = 0\n\n        if (self.buy_condition_ema_enable.value):\n\n            buy_offset_ema = (\n                ( \n                    #(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    #&\n                    #(dataframe['ha_up'].rolling(self.ha_rolling_up.value).sum() == self.ha_rolling_up.value)\n                    #&\n                    #(qtpylib.crossed_above(dataframe['HA_Close'].shift(self.ha_rolling_up.value -1 ), dataframe['HA_Open'].shift(self.ha_rolling_up.value + 1)))\n                    #&\n                    #(dataframe['ha_down'].shift(self.ha_rolling_up.value).rolling(self.ha_rolling_down.value).sum() == self.ha_rolling_down.value)\n                    #&\n                    (qtpylib.crossed_below(dataframe['sar'], dataframe['pmax_thresh']))\n                    &\n                    (dataframe['pmax_thresh'] > dataframe['pm'])\n                    &\n                    (dataframe['pmax_thresh'] > dataframe['sar'])\n                    #&\n                    #(dataframe['high_rising'] == 1)\n                )\n            )\n            dataframe.loc[buy_offset_ema, 'buy_tag'] += 'ema '\n            conditions.append(buy_offset_ema)\n\n        \"\"\"if (self.buy_condition_zema_enable.value):\n            dataframe['zema_offset_buy'] = zema(dataframe, int(self.base_nb_candles_buy_zema.value)) *self.low_offset_zema.value\n            dataframe['zema_offset_buy2'] = zema(dataframe, int(self.base_nb_candles_buy_zema2.value)) *self.low_offset_zema2.value\n            buy_offset_zema = (\n                (\n                    (dataframe['close'] < dataframe['zema_offset_buy'])\n                    &\n                    (dataframe['pm'] <= dataframe['pmax_thresh'])\n                )\n                |\n                (\n                    (dataframe['close'] < dataframe['zema_offset_buy2'])\n                    &\n                    (dataframe['pm'] > dataframe['pmax_thresh'])\n                )\n            )\n            dataframe.loc[buy_offset_zema, 'buy_tag'] += 'zema '\n            conditions.append(buy_offset_zema)\n\n        if (self.buy_condition_hma_enable.value):\n            dataframe['hma_offset_buy'] = qtpylib.hull_moving_average(dataframe['close'], window=int(self.base_nb_candles_buy_hma.value)) *self.low_offset_hma.value\n            dataframe['hma_offset_buy2'] = qtpylib.hull_moving_average(dataframe['close'], window=int(self.base_nb_candles_buy_hma2.value)) *self.low_offset_hma2.value\n            buy_offset_hma = (\n                (\n                    (\n                        (dataframe['close'] < dataframe['hma_offset_buy'])\n                        &\n                        (dataframe['pm'] <= dataframe['pmax_thresh'])\n                        &\n                        (dataframe['rsi'] < 35)\n    \n                    )\n                    |\n                    (\n                        (dataframe['close'] < dataframe['hma_offset_buy2'])\n                        &\n                        (dataframe['pm'] > dataframe['pmax_thresh'])\n                        &\n                        (dataframe['rsi'] < 30)\n                    )\n                )\n                &\n                (dataframe['rsi_fast'] < 30)\n                \n            )\n            dataframe.loc[buy_offset_hma, 'buy_tag'] += 'hma '\n            conditions.append(buy_offset_hma)\"\"\"\n\n        add_check = (\n            (dataframe['live_data_ok'])\n            &\n            (dataframe['pmax_pct'] > self.pmax_pct_min.value)\n            &\n            (dataframe['volume_pct'] > self.volume_pct_min.value)   \n            &\n            (dataframe['close_pct'] > self.close_pct_min.value)\n            &\n            (dataframe['rsi'] > self.buy_rsi_min.value)\n            &\n            (dataframe['rsi_fast'] > self.buy_rsi_fast_min.value)\n            &\n            (dataframe['pmax_pct'] < self.pmax_pct_max.value)\n            &\n            (dataframe['volume_pct'] < self.volume_pct_max.value)\n            &\n            (dataframe['close_pct'] < self.close_pct_max.value)\n            &\n            (dataframe['rsi'] < self.buy_rsi_max.value)\n            &\n            (dataframe['rsi_fast'] < self.buy_rsi_fast_max.value)\n            &\n            (dataframe['ewo'] > self.ewo_high.value)\n            &\n            \n            #(dataframe['open'] < dataframe['ema_offset_buy'])\n            #&\n            #(dataframe['buy_low_rolling'].shift().rolling(self.buy_smooth_ha_rolling.value).sum() == self.buy_low_rolling.value)\n            #&\n            #(dataframe['delta_rising'].rolling(5).sum() == self.buy_smooth_ha_rolling.value)\n            #&\n            #(dataframe['close'] > (dataframe['ema_sell'] * self.high_offset_sell_ema.value))\n            #&\n            #(dataframe['close'].rolling(288).max() < (dataframe['close'] * 1.10 ))\n            #&\n            #(dataframe['Smooth_HA_O'].shift(1) < dataframe['Smooth_HA_H'].shift(1))\n            #&\n            #(dataframe['rsi_fast'] > self.buy_rsi_fast.value)\n            #&\n            #(dataframe['rsi_84'] > 60)\n            #&\n            #(dataframe['rsi_112'] > 60)\n            #&\n            #(dataframe['ewo'] > self.ewo_high.value)\n            #&\n            #(\n            #    (\n            #        (dataframe['close'] > dataframe['pmax_thresh'])\n            #        &\n            #        (dataframe['pm'] > dataframe['pmax_thresh'])\n            #        &\n            #        (\n            #            (dataframe['ewo'] < self.ewo_low.value)\n            #            |\n            #            (\n            #                (dataframe['ewo'] > self.ewo_high.value)\n            #                &\n            #                (dataframe['rsi'] < self.rsi_buy.value)\n            #            )\n            #        )\n            #    )\n            #    |\n            #    (\n            #        (dataframe['close'] > dataframe['pmax_thresh'])\n            #        &\n            #        (dataframe['pm'] > dataframe['pmax_thresh'])\n            #        &\n            #        (\n            #            (dataframe['ewo'] < self.ewo_low2.value)\n            #            |\n            #            (\n            #                (dataframe['ewo'] > self.ewo_high2.value)\n            #                &\n            #                (dataframe['rsi'] < self.rsi_buy2.value)\n            #            )\n            #        )\n            #    )\n            #)\n            #&\n            (dataframe['volume'] > 0)\n        )\n        \n        if conditions:\n            dataframe.loc[\n                (add_check & reduce(lambda x, y: x | y, conditions)),\n                ['buy_copy','buy']\n            ]=(1,1)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# smoothed Heiken Ashi\ndef HA(dataframe, smoothing=None):\n    df = dataframe.copy()\n\n    df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    df.reset_index(inplace=True)\n\n    ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n    [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n    df['HA_Open'] = ha_open\n\n    df.set_index('index', inplace=True)\n\n    df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n    df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n    if smoothing is not None:\n        sml = abs(int(smoothing))\n        if sml > 0:\n            df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n            df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n            df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n            df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n            \n    return df\n\ndef pump_warning(dataframe, perc=15):\n    df = dataframe.copy()    \n    df[\"change\"] = df[\"high\"] - df[\"low\"]\n    df[\"test1\"] = (df[\"close\"] > df[\"open\"])\n    df[\"test2\"] = ((df[\"change\"]/df[\"low\"]) > (perc/100))\n    df[\"result\"] = (df[\"test1\"] & df[\"test2\"]).astype('int')\n    return df['result']\n"
  },
  {
    "path": "strategies/MultiMa/MultiMa.py",
    "content": "# MultiMa Strategy V2\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.hyper import IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# --------------------------------\n\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\n\n\nclass MultiMa(IStrategy):\n    # 111/2000:     18 trades. 12/4/2 Wins/Draws/Losses. Avg profit   9.72%. Median profit   3.01%. Total profit  733.01234143 USDT (  73.30%). Avg duration 2 days, 18:40:00 min. Objective: 1.67048\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_ma_count\": 4,\n        \"buy_ma_gap\": 15,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_ma_count\": 12,\n        \"sell_ma_gap\": 68,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.523,\n        \"1553\": 0.123,\n        \"2332\": 0.076,\n        \"3169\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.345\n\n    # Trailing stop:\n    trailing_stop = False  # value loaded from strategy\n    trailing_stop_positive = None  # value loaded from strategy\n    trailing_stop_positive_offset = 0.0  # value loaded from strategy\n    trailing_only_offset_is_reached = False  # value loaded from strategy\n\n    # Opimal Timeframe\n    timeframe = \"4h\"\n\n    count_max = 20\n    gap_max = 100\n\n    buy_ma_count = IntParameter(1, count_max, default=7, space=\"buy\")\n    buy_ma_gap = IntParameter(1, gap_max, default=7, space=\"buy\")\n\n    sell_ma_count = IntParameter(1, count_max, default=7, space=\"sell\")\n    sell_ma_gap = IntParameter(1, gap_max, default=94, space=\"sell\")\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        for count in range(self.count_max):\n            for gap in range(self.gap_max):\n                if count*gap > 1 and count*gap not in dataframe.keys():\n                    dataframe[count*gap] = ta.TEMA(\n                        dataframe, timeperiod=int(count*gap)\n                    )\n        print(\" \", metadata['pair'], end=\"\\t\\r\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # I used range(self.buy_ma_count.value) instade of self.buy_ma_count.range\n        # Cuz it returns range(7,8) but we need range(8) for all modes hyperopt, backtest and etc\n\n        for ma_count in range(self.buy_ma_count.value):\n            key = ma_count*self.buy_ma_gap.value\n            past_key = (ma_count-1)*self.buy_ma_gap.value\n            if past_key > 1 and key in dataframe.keys() and past_key in dataframe.keys():\n                conditions.append(dataframe[key] < dataframe[past_key])\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"buy\"] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        for ma_count in range(self.sell_ma_count.value):\n            key = ma_count*self.sell_ma_gap.value\n            past_key = (ma_count-1)*self.sell_ma_gap.value\n            if past_key > 1 and key in dataframe.keys() and past_key in dataframe.keys():\n                conditions.append(dataframe[key] > dataframe[past_key])\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x | y, conditions), \"sell\"] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/MultiOffsetLamboV0/MultiOffsetLamboV0.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# - Credits -\n# tirail: SMAOffset idea\n# rextea: EWO idea\n# Lambo\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass MultiOffsetLamboV0(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Hyperopt Result\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 16,\n        \"ewo_high\": 5.638,\n        \"ewo_low\": -19.993\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 49\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Stoploss:\n    stoploss = -0.50\n\n    # Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    use_sell_signal = True\n    sell_profit_only = False\n\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        for i in self.ma_types:\n            conditions.append(\n                (dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['EWO'] < self.ewo_low.value) |\n                    (dataframe['EWO'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n            )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n            )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/MultiRSI/MultiRSI.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nfrom technical.util import resample_to_interval, resampled_merge\n\n\nclass MultiRSI(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    based on work from Creslin\n\n    \"\"\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma200'] = ta.SMA(dataframe, timeperiod=200)\n\n        # resample our dataframes\n        dataframe_short = resample_to_interval(dataframe, self.get_ticker_indicator() * 2)\n        dataframe_long = resample_to_interval(dataframe, self.get_ticker_indicator() * 8)\n\n        # compute our RSI's\n        dataframe_short['rsi'] = ta.RSI(dataframe_short, timeperiod=14)\n        dataframe_long['rsi'] = ta.RSI(dataframe_long, timeperiod=14)\n\n        # merge dataframe back together\n        dataframe = resampled_merge(dataframe, dataframe_short)\n        dataframe = resampled_merge(dataframe, dataframe_long)\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        dataframe.fillna(method='ffill', inplace=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # must be bearish\n                (dataframe['sma5'] >= dataframe['sma200']) &\n                (dataframe['rsi'] < (dataframe['resample_{}_rsi'.format(self.get_ticker_indicator() * 8)] - 20))\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > dataframe['resample_{}_rsi'.format(self.get_ticker_indicator()*2)]) &\n                (dataframe['rsi'] > dataframe['resample_{}_rsi'.format(self.get_ticker_indicator()*8)])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/NASOSRv6_private_Reinuvader_20211121/NASOSRv6_private_Reinuvader_20211121.py",
    "content": "# THIS STRATEGY IS PRIVATE. DO NOT SHARE.\n# Heavily borrowed code from MultiMA_TSL3, ClucHAnix_BB_RPB.\n# Big thanks to all the giants whose shoulders this strat is standing on:\n# @stash86\n# @Al\n# @Rallipanos\n# @pluxury\n\nfrom logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, Series\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_minutes\nimport technical.indicators as ftt\nfrom technical.indicators import zema\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 17,\n    \"ewo_high\": 3.33,\n    \"ewo_high_2\": -0.444,\n    \"ewo_low\": -12.788,\n    \"lookback_candles\": 1,\n    \"low_offset\": 0.985,\n    \"low_offset_2\": 0.935,\n    \"profit_threshold\": 1.016,\n    \"clucha_rocr_1h\": 0.47782,\n    \"clucha_bbdelta_close\": 0.02206,\n    \"clucha_bbdelta_tail\": 1.02515,\n    \"clucha_close_bblower\": 0.03669,\n    \"clucha_closedelta_close\": 0.04401,\n    \"base_nb_candles_buy_zema\": 25,\n    \"base_nb_candles_buy_zema2\": 53,\n    \"low_offset_zema\": 0.958,\n    \"low_offset_zema2\": 0.961,\n    \"base_nb_candles_buy_ema\": 9,\n    \"base_nb_candles_buy_ema2\": 75,\n    \"low_offset_ema\": 1.067,\n    \"low_offset_ema2\": 0.973,\n    \"high_offset_sell_ema\": 0.994,\n    \"rsi_buy\": 71\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 8,\n    \"high_offset\": 1.01,\n    \"high_offset_2\": 1.406,\n    \"ProfitLoss1\": 0.005,\n    \"ProfitLoss2\": 0.021,\n    \"ProfitMargin1\": 0.018,\n    \"ProfitMargin2\": 0.051,\n    \"pHSL\": -0.15,\n}\n\n\nclass NASOSRv6_private_Reinuvader_20211121(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    # Stoploss:\n    stoploss = -0.15\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(2, 26, default=buy_params['base_nb_candles_buy'], space='buy', optimize=False)\n    base_nb_candles_sell = IntParameter(2, 20, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False)\n    low_offset = DecimalParameter(0.85, 0.99, default=buy_params['low_offset'], space='buy', optimize=False)\n    low_offset_2 = DecimalParameter(0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=False)\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=False)\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=False)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(1, 36, default=buy_params['lookback_candles'], space='buy', optimize=False)\n    profit_threshold = DecimalParameter(1.0, 1.08, default=buy_params['profit_threshold'], space='buy', optimize=False)\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=False)\n    ewo_high = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=False)\n    ewo_high_2 = DecimalParameter(-6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=False)\n    rsi_buy = IntParameter(60, 82, default=buy_params['rsi_buy'], space='buy', optimize=False)\n\n    # trailing stoploss hyperopt parameters\n    pHSL = DecimalParameter(-0.15, -0.08, default=sell_params['pHSL'], decimals=3, space='sell', optimize=True)\n    ProfitMargin1 = DecimalParameter(0.009, 0.019, default=sell_params['ProfitMargin1'], decimals=3, space='sell', optimize=True)\n    ProfitLoss1 = DecimalParameter(0.005, 0.012, default=sell_params['ProfitLoss1'], decimals=3, space='sell', optimize=True)\n    ProfitMargin2 = DecimalParameter(0.033, 0.099, default=sell_params['ProfitMargin2'], decimals=3, space='sell', optimize=True)\n    ProfitLoss2 = DecimalParameter(0.010, 0.025, default=sell_params['ProfitLoss2'], decimals=3, space='sell', optimize=True)\n\n    # ClucHA\n    clucha_bbdelta_close = DecimalParameter(0.01,0.05, default=buy_params['clucha_bbdelta_close'], decimals=5, space='buy', optimize=False)\n    clucha_bbdelta_tail = DecimalParameter(0.7, 1.2, default=buy_params['clucha_bbdelta_tail'], decimals=5, space='buy', optimize=False)\n    clucha_close_bblower = DecimalParameter(0.001, 0.05, default=buy_params['clucha_close_bblower'], decimals=5, space='buy', optimize=False)\n    clucha_closedelta_close = DecimalParameter(0.001, 0.05, default=buy_params['clucha_closedelta_close'], decimals=5, space='buy', optimize=False)\n    clucha_rocr_1h = DecimalParameter(0.1, 1.0, default=buy_params['clucha_rocr_1h'], decimals=5, space='buy', optimize=False)\n\n    # Zema\n    base_nb_candles_buy_zema = IntParameter(5, 80, default=buy_params['base_nb_candles_buy_zema'], space='buy', optimize=False)\n    low_offset_zema = DecimalParameter(0.9, 0.99, default=buy_params['low_offset_zema'], space='buy', optimize=False)\n    base_nb_candles_buy_zema2 = IntParameter(5, 80, default=buy_params['base_nb_candles_buy_zema2'], space='buy', optimize=False)\n    low_offset_zema2 = DecimalParameter(0.9, 0.99, default=buy_params['low_offset_zema2'], space='buy', optimize=False)\n    high_offset_sell_ema = DecimalParameter(0.99, 1.1, default=buy_params['high_offset_sell_ema'], space='buy', optimize=False)\n    base_nb_candles_buy_ema = IntParameter(5, 80, default=buy_params['base_nb_candles_buy_ema'], space='buy', optimize=False)\n    low_offset_ema = DecimalParameter(0.9, 1.1, default=buy_params['low_offset_ema'], space='buy', optimize=False)\n    base_nb_candles_buy_ema2 = IntParameter(5, 80, default=buy_params['base_nb_candles_buy_ema2'], space='buy', optimize=False)\n    low_offset_ema2 = DecimalParameter(0.9, 1.1, default=buy_params['low_offset_ema2'], space='buy', optimize=False)\n\n    # Trailing stop:\n    trailing_stop = False\n    #trailing_stop_positive = 0.001\n    #trailing_stop_positive_offset = 0.016\n    #trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    #sell_profit_only = False\n    #sell_profit_offset = -0.0001\n    #ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n    timeframe_minutes = timeframe_to_minutes(timeframe)\n\n    timeperiods = [\n        # 50 // timeframe_minutes,\n        # 85 // timeframe_minutes,\n        180 // timeframe_minutes,\n        360 // timeframe_minutes,\n        420 // timeframe_minutes,\n        560 // timeframe_minutes,\n    ]\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n    use_custom_stoploss = True\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):\n        if ((current_time - trade.open_date_utc).seconds / 60 > 1440):\n            return 'unclog'\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        HSL = self.pHSL.value\n        if (current_profit > self.ProfitMargin2.value):\n            sl_profit = self.ProfitLoss2.value\n        elif (current_profit > self.ProfitMargin1.value):\n            sl_profit = self.ProfitLoss1.value + ((current_profit - self.ProfitMargin1.value) * (self.ProfitLoss2.value - self.ProfitLoss1.value) / (self.ProfitMargin2.value - self.ProfitMargin1.value))\n        else:\n            sl_profit = HSL\n\n        return sl_profit\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        if hasattr(last_candle, 'sell_tag') and str(last_candle.sell_tag) != \"nan\":\n            if (sell_reason == \"sell_signal\"):\n                sell_reason = last_candle.sell_tag\n            else:\n                sell_reason += last_candle.sell_tag\n\n        trade.sell_reason = f\"{trade.buy_tag}->{sell_reason}\"\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n                btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n          btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        inf_heikinashi = qtpylib.heikinashi(informative)\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n        return informative\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        df36h = dataframe.copy().shift( 432 ) # TODO FIXME: This assumes 5m timeframe\n        df24h = dataframe.copy().shift( 288 ) # TODO FIXME: This assumes 5m timeframe\n        dataframe['long_term_price_warning'] = np.where(\n            (\n                # 15% drop in 8h\n                    (\n                            dataframe['close'].rolling(96).max() * 0.85 > dataframe['close'].rolling(6).mean()\n                    ) |\n                    # 20% drop in 12h\n                    (\n                            dataframe['close'].rolling(144).max() * 0.8 > dataframe['close'].rolling(8).mean()\n                    ) |\n                    # 25% drop in 24h\n                    (\n                            dataframe['close'].rolling(288).max() * 0.75 > dataframe['close'].rolling(12).mean()\n                    ) |\n                    # 30% drop in 36h\n                    (\n                            dataframe['close'].rolling(432).max() * 0.7 > dataframe['close'].rolling(24).mean()\n                    ) |\n                    # over 35% increase in the past 24h and 36h\n                    (\n                            (df24h['close'].rolling(24).mean() * 1.42 < dataframe['close'].rolling(18).mean()) &\n                            (df36h['close'].rolling(24).mean() * 1.42 < dataframe['close'].rolling(18).mean())\n                    )\n            ), 1, 0)\n\n        for period in self.timeperiods:\n            dataframe[f'rsi_{period}'] = normalize(ta.RSI(dataframe, timeperiod=period), 0, 100)\n            dataframe[f'linangle_{period}'] = normalize(ta.LINEARREG_ANGLE(dataframe, timeperiod=period), -35, 35)\n\n        # MACD\n        dataframe['close_min'] = dataframe['close'].rolling(window=960 // self.timeframe_minutes).min()\n        dataframe['close_max'] = dataframe['close'].rolling(window=960 // self.timeframe_minutes).max()\n        dataframe['relative_price'] = normalize(dataframe['close'], dataframe['close_min'], dataframe['close_max'])\n\n        #macd = ta.MACD(dataframe)\n        dataframe['macd'], dataframe['macdsignal'], dataframe['macdhist'] = ta.MACD(dataframe['close'], fastperiod=21, slowperiod=45, signalperiod=16)\n        dataframe['macdmin'] = dataframe['macd'].rolling(window=360 // self.timeframe_minutes).min()\n        dataframe['macdmax'] = dataframe['macd'].rolling(window=360 // self.timeframe_minutes).max()\n        dataframe['macd_norm'] = np.where(dataframe['macdmin'] == dataframe['macdmax'], 0, (2.0*(dataframe['macd']-dataframe['macdmin'])/(dataframe['macdmax']-dataframe['macdmin'])-1.0))\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['ema_fast'] = ta.EMA(dataframe, timeperiod=45 // self.timeframe_minutes)\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=60 // self.timeframe_minutes)\n        dataframe['uptrend'] = (dataframe['ema_fast'] > dataframe['ema_slow']).astype('int')\n        dataframe['trendline'] = dataframe['linangle_72'] / dataframe['linangle_72'].shift(12)\n\n        # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe = HA(dataframe, 4)\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n\n        # # ClucHA\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['hema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        btc_df = self.dp.get_pair_dataframe(pair=btc_info_pair, timeframe=self.timeframe)\n        dataframe['btc_rsi'] = normalize(ta.RSI(btc_df, timeperiod=14), 0, 100)\n        dataframe['btc_ema_45'] = ta.TEMA(btc_df, timeperiod=45 // self.timeframe_minutes)\n        dataframe['btc_ema_60'] = ta.TEMA(btc_df, timeperiod=60 // self.timeframe_minutes)\n        dataframe['btc_uptrend'] = (dataframe['btc_ema_45'] > dataframe['btc_ema_60']).astype('int')\n\n        dataframe['zema_offset_buy'] = zema(dataframe, int(self.base_nb_candles_buy_zema.value)) *self.low_offset_zema.value\n        dataframe['zema_offset_buy2'] = zema(dataframe, int(self.base_nb_candles_buy_zema2.value)) *self.low_offset_zema2.value\n        dataframe['ema_sell'] = ta.EMA(dataframe, 5)\n        dataframe['ema_offset_buy'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema.value)) *self.low_offset_ema.value\n        dataframe['ema_offset_buy2'] = ta.EMA(dataframe, int(self.base_nb_candles_buy_ema2.value)) *self.low_offset_ema2.value\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't some profit to be made\n                (dataframe['close_1h'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dont_buy_conditions.append((dataframe['trendline'] < 0.995))\n        dont_buy_conditions.append((dataframe['relative_price'] > 0.51))\n\n        dataframe.loc[\n            (\n                    (dataframe['rsi_fast'] < 35) &\n                    (dataframe['rsi_36'] < 0.45) &\n                    (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                    (dataframe['EWO'] > self.ewo_high.value) &\n                    (dataframe['rsi'] < self.rsi_buy.value) &\n                    (dataframe['volume'] > 0) &\n                    (dataframe['close'] < (\n                            dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                    (dataframe['rsi_fast'] < 35) &\n                    (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                    (dataframe['EWO'] > self.ewo_high_2.value) &\n                    (dataframe['rsi'] < self.rsi_buy.value) &\n                    (dataframe['volume'] > 0) &\n                    (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                    (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n\n        dataframe.loc[\n            (\n                    (dataframe['rsi_fast'] < 35) &\n                    (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                    (dataframe['EWO'] < self.ewo_low.value) &\n                    (dataframe['volume'] > 0) &\n                    (dataframe['close'] < (\n                            dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        # This produces around 0.85% - 1.0% profitable trades but long durations so decided against it.\n        # dataframe.loc[\n        #     (\n        #         (\n        #             (\n        #                 (dataframe['macd_norm'] < -0.9) &\n        #                 (dataframe['linangle_17'] > 0.5)\n        #             )\n        #         ) &\n        #         (dataframe['rsi_36'] < 0.55) &\n        #         (dataframe['uptrend'] < 1)\n        #     ),\n        #     ['buy', 'buy_tag']] = (1, 'MacD')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        # This does not fit well the protections for EWO buys.\n        dataframe.loc[\n            (\n                (dataframe['volume'] > 0) &\n                (dataframe['rocr_1h'].gt(self.clucha_rocr_1h.value)) &\n                (\n                    (\n                         (dataframe['lower'].shift().gt(0)) &\n                         (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.clucha_bbdelta_close.value)) &\n                         (dataframe['ha_closedelta'].gt(dataframe['ha_close'] * self.clucha_closedelta_close.value)) &\n                         (dataframe['tail'].lt(dataframe['bbdelta'] * self.clucha_bbdelta_tail.value)) &\n                         (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                         (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n                     ) |\n                     (\n                         (dataframe['ha_close'] < dataframe['hema_slow']) &\n                         (dataframe['ha_close'] < self.clucha_close_bblower.value * dataframe['lower'])\n                     )\n                 )\n            ),\n            ['buy', 'buy_tag']] = (1, 'clucHA')\n\n        # This does not fit well the protections for EWO buys.\n        dataframe.loc[\n            (\n                (\n                    ((dataframe['close'] < dataframe['zema_offset_buy']) & (dataframe['pm'] <= dataframe['pmax_thresh'])) |\n                    ((dataframe['close'] < dataframe['zema_offset_buy2']) & (dataframe['pm'] > dataframe['pmax_thresh']))\n                ) &\n                (dataframe['volume'] > 0) &\n                (dataframe['long_term_price_warning'] < 1) &\n                (dataframe['trendline'] > 0.996) &\n                (dataframe['btc_rsi'] > 0.49) &\n                (dataframe['close'] < dataframe['Smooth_HA_L']) &\n                (dataframe['close'] < (dataframe['ema_sell'] * self.high_offset_sell_ema.value)) &\n                (dataframe['close'].rolling(288).max() >= (dataframe['close'] * 1.10 )) &\n                (dataframe['Smooth_HA_O'].shift(1) < dataframe['Smooth_HA_H'].shift(1)) &\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60) &\n                (\n                    (\n                        (dataframe['close'] < dataframe['ema_offset_buy']) &\n                        (dataframe['pm'] <= dataframe['pmax_thresh']) &\n                        (\n                            (dataframe['EWO'] < -19.632) |\n                            (\n                                (dataframe['EWO'] > 2.615) & (dataframe['rsi'] < 60)\n                            )\n                        )\n                    ) |\n                    (\n                        (dataframe['close'] < dataframe['ema_offset_buy2']) &\n                        (dataframe['pm'] > dataframe['pmax_thresh']) &\n                        (\n                            (dataframe['EWO'] < -19.955) |\n                            (\n                                (dataframe['EWO'] > 2.188) & (dataframe['rsi'] < 45)\n                            )\n                        )\n                    )\n                )\n            ),\n            ['buy', 'buy_tag']] = (1, 'zema')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['uptrend'] == 1) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            ) |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['uptrend'] == 1) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\n\n    def rollingNormalize(self, dataframe, name):\n        df = dataframe.copy()\n        df[name + '_nmin'] = df[name].rolling(window=1440 // self.timeframe_minutes).min()\n        df[name + '_nmax'] = df[name].rolling(window=1440 // self.timeframe_minutes).max()\n        return np.where(df[name + '_nmin'] == df[name + '_nmax'], 0, (2.0*(df[name]-df[name + '_nmin'])/(df[name + '_nmax']-df[name + '_nmin'])-1.0))\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\ndef normalize(data, min_value, max_value):\n    return (data - min_value) / (max_value - min_value)\n\n\ndef williams_r(dataframe: DataFrame, timeperiod: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=timeperiod).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=timeperiod).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{timeperiod} Williams %R\",\n        )\n\n    return WR * -100\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n                basic_ub[i] < final_ub[i - 1]\n                or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n                basic_lb[i] > final_lb[i - 1]\n                or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                            and mavalue[i] <= final_ub[i])\n            else final_lb[i] if (\n                    pm_arr[i - 1] == final_ub[i - 1]\n                    and mavalue[i] > final_ub[i]) else final_lb[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] >= final_lb[i]) else final_ub[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# smoothed Heiken Ashi\ndef HA(dataframe, smoothing=None):\n    df = dataframe.copy()\n\n    df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    df.reset_index(inplace=True)\n\n    ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n    [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n    df['HA_Open'] = ha_open\n\n    df.set_index('index', inplace=True)\n\n    df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n    df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n    if smoothing is not None:\n        sml = abs(int(smoothing))\n        if sml > 0:\n            df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n            df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n            df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n            df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n\n    return df\n"
  },
  {
    "path": "strategies/NASOSv4/NASOSv4.py",
    "content": "# for live trailing_stop = False and use_custom_stoploss = True\n# for backtest trailing_stop = True and use_custom_stoploss = False\n\n# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n# @pluxury\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 8,\n    \"ewo_high\": 2.403,\n    \"ewo_high_2\": -5.585,\n    \"ewo_low\": -14.378,\n    \"lookback_candles\": 3,\n    \"low_offset\": 0.984,\n    \"low_offset_2\": 0.942,\n    \"profit_threshold\": 1.008,\n    \"rsi_buy\": 72\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 16,\n    \"high_offset\": 1.084,\n    \"high_offset_2\": 1.401,\n    \"pHSL\": -0.15,\n    \"pPF_1\": 0.016,\n    \"pPF_2\": 0.024,\n    \"pSL_1\": 0.014,\n    \"pSL_2\": 0.022\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NASOSv4(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        # \"0\": 0.283,\n        # \"40\": 0.086,\n        # \"99\": 0.036,\n        \"0\": 10\n    }\n\n    # Stoploss:\n    stoploss = -0.15\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=False)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=False)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(\n        1, 24, default=buy_params['lookback_candles'], space='buy', optimize=True)\n\n    profit_threshold = DecimalParameter(1.0, 1.03,\n                                        default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=False)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=False)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=False)\n\n    rsi_buy = IntParameter(50, 100, default=buy_params['rsi_buy'], space='buy', optimize=False)\n\n    # trailing stoploss hyperopt parameters\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.15, decimals=3,\n                            space='sell', optimize=False, load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3,\n                             space='sell', optimize=False, load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.014, decimals=3,\n                             space='sell', optimize=False, load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.024, decimals=3,\n                             space='sell', optimize=False, load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.022, decimals=3,\n                             space='sell', optimize=False, load=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.016\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = False\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    # Custom Trailing Stoploss by Perkmeister\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1)*(SL_2 - SL_1)/(PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # if current_profit < 0.001 and current_time - timedelta(minutes=600) > trade.open_date_utc:\n        #     return -0.005\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_1h'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NASOSv5/NASOSv5.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n# @pluxury\n# with help from @stash86 and @Perkmeister\n\n# Buy hyperspace params:\nbuy_params = {\n    \"low_offset\": 0.981,\n    \"base_nb_candles_buy\": 8,  # value loaded from strategy\n    \"ewo_high\": 3.553,  # value loaded from strategy\n    \"ewo_high_2\": -5.585,  # value loaded from strategy\n    \"ewo_low\": -14.378,  # value loaded from strategy\n    \"lookback_candles\": 32,  # value loaded from strategy\n    \"low_offset_2\": 0.942,  # value loaded from strategy\n    \"profit_threshold\": 1.037,  # value loaded from strategy\n    \"rsi_buy\": 78,  # value loaded from strategy\n    \"rsi_fast_buy\": 37,  # value loaded from strategy\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 16,  # value loaded from strategy\n    \"high_offset\": 1.097,  # value loaded from strategy\n    \"high_offset_2\": 1.472,  # value loaded from strategy\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NASOSv5(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        # \"0\": 0.283,\n        # \"40\": 0.086,\n        # \"99\": 0.036,\n        \"360\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.15\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=False)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=False)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=False)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(\n        1, 36, default=buy_params['lookback_candles'], space='buy', optimize=False)\n\n    profit_threshold = DecimalParameter(0.99, 1.05,\n                                        default=buy_params['profit_threshold'], space='buy', optimize=False)\n\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=False)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=False)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=False)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=False)\n    rsi_fast_buy = IntParameter(\n        10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=False)\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.016\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_15m = '15m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = True\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n        'subplots': {\n            'rsi': {\n                'rsi': {'color': 'orange'},\n                'rsi_fast': {'color': 'red'},\n                'rsi_slow': {'color': 'green'},\n            },\n            'ewo': {\n                'EWO': {'color': 'orange'}\n            },\n        }\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0.3):\n            return 0.05\n        elif (current_profit > 0.1):\n            return 0.03\n        elif (current_profit > 0.06):\n            return 0.02\n        elif (current_profit > 0.04):\n            return 0.01\n        elif (current_profit > 0.025):\n            return 0.005\n        elif (current_profit > 0.018):\n            return 0.005\n\n        return 0.15\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '15m') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NASOSv5_mod1/NASOSv5_mod1.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\nimport logging\nimport pandas as pd\n\n\nlogger = logging.getLogger(__name__)\n\n# @Rallipanos\n# @pluxury\n# with help from @stash86 and @Perkmeister\n\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NASOSv5_mod1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 20,\n        \"ewo_high\": 4.299,\n        \"ewo_high_2\": 8.492,\n        \"ewo_low\": -8.476,\n        \"low_offset\": 0.984,\n        \"low_offset_2\": 0.901,\n        \"lookback_candles\": 7,\n        \"profit_threshold\": 1.036,\n        \"rsi_buy\": 80,\n        \"rsi_fast_buy\": 27,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 20,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.4\n    }\n\n    # Stoploss:\n    stoploss = -0.3  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.03  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\n\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(\n        1, 36, default=buy_params['lookback_candles'], space='buy', optimize=True)\n\n    profit_threshold = DecimalParameter(0.99, 1.05,\n                                        default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_fast_buy = IntParameter(\n        10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=True)\n\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_15m = '15m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = False\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n        'subplots': {\n            'rsi': {\n                'rsi': {'color': 'orange'},\n                'rsi_fast': {'color': 'red'},\n                'rsi_slow': {'color': 'green'},\n            },\n            'ewo': {\n                'EWO': {'color': 'orange'}\n            },\n        }\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    protections = [\n        # \t{\n        # \t\t\"method\": \"StoplossGuard\",\n        # \t\t\"lookback_period_candles\": 12,\n        # \t\t\"trade_limit\": 1,\n        # \t\t\"stop_duration_candles\": 6,\n        # \t\t\"only_per_pair\": True\n        # \t},\n        # \t{\n        # \t\t\"method\": \"StoplossGuard\",\n        # \t\t\"lookback_period_candles\": 12,\n        # \t\t\"trade_limit\": 2,\n        # \t\t\"stop_duration_candles\": 6,\n        # \t\t\"only_per_pair\": False\n        # \t},\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"MaxDrawdown\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 1,\n            \"stop_duration_candles\": 12,\n            \"max_allowed_drawdown\": 0.2\n        },\n    ]\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0.3):\n            return 0.05\n        elif (current_profit > 0.1):\n            return 0.03\n        elif (current_profit > 0.06):\n            return 0.02\n        elif (current_profit > 0.04):\n            return 0.01\n        elif (current_profit > 0.025):\n            return 0.005\n        elif (current_profit > 0.018):\n            return 0.005\n\n        return 0.15\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '15m') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=5)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=25)\n\n        \"\"\"\n        ANTIPUMP THING TO TEST\n        \"\"\"\n        dataframe['pct_change'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int'] = ((dataframe['pct_change'] > 0.15).astype(int) | (dataframe['pct_change'] < -0.15).astype(int))\n\n        dataframe['pct_change_short'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int_short'] = ((dataframe['pct_change_short'] > 0.08).astype(int) | (dataframe['pct_change_short'] < -0.08).astype(int))\n\n        dataframe['ispumping'] = (\n         (dataframe['pct_change_int'].rolling(20).sum() >= 0.4)\n        ).astype('int')\n\n        dataframe['islongpumping'] = (\n         (dataframe['pct_change_int'].rolling(30).sum() >= 0.48)\n        ).astype('int')\n\n        dataframe['isshortpumping'] = (\n         (dataframe['pct_change_int_short'].rolling(10).sum() >= 0.10)\n        ).astype('int')\n\n        dataframe['recentispumping'] = (dataframe['ispumping'].rolling(300).max() > 0) | (dataframe['islongpumping'].rolling(300).max() > 0)# | (dataframe['isshortpumping'].rolling(300).max() > 0)\n        \"\"\"\n        END ANTIPUMP\n        \"\"\"\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\nclass NASOSv5HO(NASOSv5_mod1):\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 8,\n        \"ewo_high\": 4.13,\n        \"ewo_high_2\": 4.477,\n        \"ewo_low\": -19.076,\n        \"lookback_candles\": 27,\n        \"low_offset\": 0.988,\n        \"low_offset_2\": 0.974,\n        \"profit_threshold\": 1.049,\n        \"rsi_buy\": 72,\n        \"rsi_fast_buy\": 40,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 8,\n        \"high_offset\": 1.012,\n        \"high_offset_2\": 1.431,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.1  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.03  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\nclass NASOSv5PD(NASOSv5_mod1):\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dont_buy_conditions.append(\n            (dataframe['recentispumping'] == True)\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\nclass NASOSv5SL(NASOSv5_mod1):\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"base_nb_candles_sell\": 12,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n\n    trailing_stop = False\n    use_custom_stoploss = True\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n\nclass TrailingBuyStrat(NASOSv5_mod1):\n    # if process_only_new_candles = True, then you need to use 1m timeframe (and normal strat timeframe as informative)\n\n    trailing_buy_order_enabled = True\n    trailing_buy_offset = 0.005\n    process_only_new_candles = True\n\n    custom_info = dict() # custom_info should be a dict\n\n    def custom_sell(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                    current_profit: float, **kwargs):\n        tag = super(TrailingBuyStrat, self).custom_sell(pair, trade, current_time, current_rate, current_profit, **kwargs)\n        if tag:\n            self.custom_info[pair]['trailing_buy'] = {\n                'trailing_buy_order_started': False,\n                'trailing_buy_order_uplimit': 0,\n                'start_trailing_price': 0,\n                'buy_tag': None\n            }\n            logger.info(f'STOP trailing buy for {pair} because of {tag}')\n        return tag\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super(TrailingBuyStrat, self).populate_indicators(dataframe, metadata)\n        if not metadata[\"pair\"] in self.custom_info:\n            self.custom_info[metadata[\"pair\"]] = dict()\n        if not 'trailing_buy' in self.custom_info[metadata['pair']]:\n            self.custom_info[metadata[\"pair\"]]['trailing_buy'] = {\n                'trailing_buy_order_started': False,\n                'trailing_buy_order_uplimit': 0,\n                'start_trailing_price': 0,\n                'buy_tag': None\n            }\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super(TrailingBuyStrat, self).confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)\n        self.custom_info[pair]['trailing_buy']['trailing_buy_order_started'] = False\n        self.custom_info[pair]['trailing_buy']['trailing_buy_order_uplimit'] = 0\n        self.custom_info[pair]['trailing_buy']['start_trailing_price'] = 0\n        self.custom_info[pair]['trailing_buy']['buy_tag'] = None\n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        def get_local_min(x):\n            win = dataframe.loc[:, 'barssince_last_buy'].iloc[x.shape[0] - 1].astype('int')\n            win = max(win, 0)\n            return pd.Series(x).rolling(window=win).min().iloc[-1]\n\n        dataframe = super(TrailingBuyStrat, self).populate_buy_trend(dataframe, metadata)\n        dataframe = dataframe.rename(columns={\"buy\": \"pre_buy\"})\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):  # trailing live dry ticker, 1m\n            last_candle = dataframe.iloc[-1].squeeze()\n            if not self.process_only_new_candles:\n                current_price = self.get_current_price(metadata[\"pair\"])\n            else:\n                current_price = last_candle['close']\n            dataframe['buy'] = 0\n            if not self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] and last_candle['pre_buy'] == 1:\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] = True\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['buy_tag'] = last_candle['buy_tag']\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle[f'close']\n                logger.info(f'start trailing buy for {metadata[\"pair\"]} at {last_candle[\"close\"]}')\n            elif self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started']:\n                if current_price < self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit']:\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + self.trailing_buy_offset), self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'])\n                    logger.info(f'update trailing buy for {metadata[\"pair\"]} at {self.custom_info[metadata[\"pair\"]][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                elif current_price < self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price']:\n                    dataframe.iloc[-1, dataframe.columns.get_loc('buy')] = 1\n                    ratio = \"%.2f\" % ((current_price / self.custom_info[metadata['pair']]['trailing_buy']['start_trailing_price']) * 100)\n                    dataframe.iloc[-1, dataframe.columns.get_loc('buy_tag')] = f\"{self.custom_info[metadata['pair']]['trailing_buy']['buy_tag']} ({ratio} %)\"\n                    # stop trailing when buy signal ! prevent from buyin much higher price when slot is free\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] = False\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = 0\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price'] = None\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['buy_tag'] = None\n                else:\n                    logger.info(f'price to high for {metadata[\"pair\"]} at {current_price} vs {self.custom_info[metadata[\"pair\"]][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n        elif self.trailing_buy_order_enabled:\n            # FOR BACKTEST\n            # PROBABLY STILL NOT WORKING\n            dataframe.loc[\n                (dataframe['pre_buy'] == 1) &\n                (dataframe['pre_buy'].shift() == 0)\n            , 'pre_buy_switch'] = 1\n            dataframe['pre_buy_switch'] = dataframe['pre_buy_switch'].fillna(0)\n\n            dataframe['barssince_last_buy'] = dataframe['pre_buy_switch'].groupby(dataframe['pre_buy_switch'].cumsum()).cumcount()\n\n            # Create integer positions of each row\n            idx_positions = np.arange(len(dataframe))\n            # \"shift\" those integer positions by the amount in shift col\n            shifted_idx_positions = idx_positions - dataframe[\"barssince_last_buy\"]\n            # get the label based index from our DatetimeIndex\n            shifted_loc_index = dataframe.index[shifted_idx_positions]\n            # Retrieve the \"shifted\" values and assign them as a new column\n            dataframe[\"close_5m_last_buy\"] = dataframe.loc[shifted_loc_index, \"close_5m\"].values\n\n            dataframe.loc[:, 'close_lower'] = dataframe.loc[:, 'close'].expanding().apply(get_local_min)\n            dataframe['close_lower'] = np.where(dataframe['close_lower'].isna() == True, dataframe['close'], dataframe['close_lower'])\n            dataframe['close_lower_offset'] = dataframe['close_lower'] * (1 + self.trailing_buy_offset)\n            dataframe['trailing_buy_order_uplimit'] = np.where(dataframe['barssince_last_buy'] < 20, pd.DataFrame([dataframe['close_5m_last_buy'], dataframe['close_lower_offset']]).min(), np.nan)\n\n            dataframe.loc[\n                (dataframe['barssince_last_buy'] < 20) & # must buy within last 20 candles after signal\n                (dataframe['close'] > dataframe['trailing_buy_order_uplimit'])\n            , 'trailing_buy'] = 1\n\n            dataframe['trailing_buy_count'] = dataframe['trailing_buy'].rolling(20).sum()\n\n            dataframe.log[\n                (dataframe['trailing_buy'] == 1) &\n                (dataframe['trailing_buy_count'] == 1)\n            , 'buy'] = 1\n        else: # No but trailing\n            dataframe.loc[\n                (dataframe['pre_buy'] == 1)\n            , 'buy'] = 1\n        return dataframe\n\n    def get_current_price(self, pair: str) -> float:\n        ticker = self.dp.ticker(pair)\n        current_price = ticker['last']\n        return current_price\n"
  },
  {
    "path": "strategies/NASOSv5_mod1_DanMod/NASOSv5_mod1_DanMod.py",
    "content": "import datetime\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport logging\nimport numpy as np\nimport pandas as pd\nimport talib.abstract as ta\nimport technical.indicators as ftt\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom functools import reduce\nfrom logging import FATAL\nfrom pandas import DataFrame\nfrom technical.util import resample_to_interval, resampled_merge\nfrom typing import Dict, List\n\nlogger = logging.getLogger(__name__)\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n    \ndef VWAPB(dataframe, window_size=20, num_of_std=1):\n    df = dataframe.copy()\n    df['vwap'] = qtpylib.rolling_vwap(df,window=window_size)\n    rolling_std = df['vwap'].rolling(window=window_size).std()\n    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)\n    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)\n    return df['vwap_low'], df['vwap'], df['vwap_high']\n\ndef top_percent_change(dataframe: DataFrame, length: int) -> float:\n    if length == 0:\n        return (dataframe['open'] - dataframe['close']) / dataframe['close']\n    else:\n        return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\nclass NASOSv5_mod1_DanMod(IStrategy):\n    INTERFACE_VERSION = 2\n\n    buy_params = {\n        \"base_nb_candles_buy\": 20,\n        \"ewo_high\": 4.299,\n        \"ewo_high_2\": 8.492,\n        \"ewo_low\": -8.476,\n        \"low_offset\": 0.984,\n        \"low_offset_2\": 0.901,\n        \"lookback_candles\": 7,\n        \"profit_threshold\": 1.036,\n        \"rsi_buy\": 80,\n        \"rsi_fast_buy\": 27,\n    }\n\n    sell_params = {\n        \"base_nb_candles_sell\": 20,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    minimal_roi = {\n        \"0\": 0.4\n    }\n\n    stoploss = -0.3\n\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(\n        1, 36, default=buy_params['lookback_candles'], space='buy', optimize=True)\n\n    profit_threshold = DecimalParameter(0.99, 1.05,\n                                        default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_fast_buy = IntParameter(\n        10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=True)\n\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    timeframe = '5m'\n    inf_15m = '15m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = False\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n        'subplots': {\n            'rsi': {\n                'rsi': {'color': 'orange'},\n                'rsi_fast': {'color': 'red'},\n                'rsi_slow': {'color': 'green'},\n            },\n            'ewo': {\n                'EWO': {'color': 'orange'}\n            },\n        }\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    protections = [\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"MaxDrawdown\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 1,\n            \"stop_duration_candles\": 12,\n            \"max_allowed_drawdown\": 0.2\n        },\n    ]\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0.3):\n            return 0.05\n        elif (current_profit > 0.1):\n            return 0.03\n        elif (current_profit > 0.06):\n            return 0.02\n        elif (current_profit > 0.04):\n            return 0.01\n        elif (current_profit > 0.025):\n            return 0.005\n        elif (current_profit > 0.018):\n            return 0.005\n\n        return 0.15\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '15m') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        \n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n        \n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        vwap_low, vwap, vwap_high = VWAPB(dataframe, 20, 1)\n        dataframe['vwap_low'] = vwap_low\n        dataframe['tcp_percent_4'] = top_percent_change(dataframe , 4)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        \n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=5)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=25)\n\n        dataframe['pct_change'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int'] = ((dataframe['pct_change'] > 0.15).astype(int) | (dataframe['pct_change'] < -0.15).astype(int))\n\n        dataframe['pct_change_short'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int_short'] = ((dataframe['pct_change_short'] > 0.08).astype(int) | (dataframe['pct_change_short'] < -0.08).astype(int))\n\n        dataframe['ispumping'] = (\n         (dataframe['pct_change_int'].rolling(20).sum() >= 0.4)\n        ).astype('int')\n\n        dataframe['islongpumping'] = (\n         (dataframe['pct_change_int'].rolling(30).sum() >= 0.48)\n        ).astype('int')\n\n        dataframe['isshortpumping'] = (\n         (dataframe['pct_change_int_short'].rolling(10).sum() >= 0.10)\n        ).astype('int')\n\n        dataframe['recentispumping'] = (dataframe['ispumping'].rolling(300).max() > 0) | (dataframe['islongpumping'].rolling(300).max() > 0)# | (dataframe['isshortpumping'].rolling(300).max() > 0)\n        \n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < dataframe['vwap_low']) &\n                (dataframe['tcp_percent_4'] > 0.04) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe"
  },
  {
    "path": "strategies/NASOSv5_mod2/NASOSv5_mod2.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\nimport logging\nimport pandas as pd\n\n\nlogger = logging.getLogger(__name__)\n\n# @Rallipanos\n# @pluxury\n# with help from @stash86 and @Perkmeister\n\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=50):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 120\n    return emadif\n\n\nclass NASOSv5_mod2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 20,\n        \"ewo_high\": 4.299,\n        \"ewo_high_2\": 8.492,\n        \"ewo_low\": -8.476,\n        \"low_offset\": 0.984,\n        \"low_offset_2\": 0.901,\n        \"lookback_candles\": 7,\n        \"profit_threshold\": 1.036,\n        \"rsi_buy\": 80,\n        \"rsi_fast_buy\": 27,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 20,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.4\n    }\n\n    # Stoploss:\n    stoploss = -0.3  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.03  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\n\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(\n        1, 36, default=buy_params['lookback_candles'], space='buy', optimize=True)\n\n    profit_threshold = DecimalParameter(0.99, 1.05,\n                                        default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_fast_buy = IntParameter(\n        10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=True)\n\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_15m = '15m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = False\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n        'subplots': {\n            'rsi': {\n                'rsi': {'color': 'orange'},\n                'rsi_fast': {'color': 'red'},\n                'rsi_slow': {'color': 'green'},\n            },\n            'ewo': {\n                'EWO': {'color': 'orange'}\n            },\n        }\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    protections = [\n        # \t{\n        # \t\t\"method\": \"StoplossGuard\",\n        # \t\t\"lookback_period_candles\": 12,\n        # \t\t\"trade_limit\": 1,\n        # \t\t\"stop_duration_candles\": 6,\n        # \t\t\"only_per_pair\": True\n        # \t},\n        # \t{\n        # \t\t\"method\": \"StoplossGuard\",\n        # \t\t\"lookback_period_candles\": 12,\n        # \t\t\"trade_limit\": 2,\n        # \t\t\"stop_duration_candles\": 6,\n        # \t\t\"only_per_pair\": False\n        # \t},\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"MaxDrawdown\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 1,\n            \"stop_duration_candles\": 12,\n            \"max_allowed_drawdown\": 0.2\n        },\n    ]\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0.3):\n            return 0.05\n        elif (current_profit > 0.1):\n            return 0.03\n        elif (current_profit > 0.06):\n            return 0.02\n        elif (current_profit > 0.04):\n            return 0.01\n        elif (current_profit > 0.025):\n            return 0.005\n        elif (current_profit > 0.018):\n            return 0.005\n\n        return 0.15\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '15m') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=5)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=25)\n\n        \"\"\"\n        ANTIPUMP THING TO TEST\n        \"\"\"\n        dataframe['pct_change'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int'] = ((dataframe['pct_change'] > 0.15).astype(int) | (dataframe['pct_change'] < -0.15).astype(int))\n\n        dataframe['pct_change_short'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int_short'] = ((dataframe['pct_change_short'] > 0.08).astype(int) | (dataframe['pct_change_short'] < -0.08).astype(int))\n\n        dataframe['ispumping'] = (\n         (dataframe['pct_change_int'].rolling(20).sum() >= 0.4)\n        ).astype('int')\n\n        dataframe['islongpumping'] = (\n         (dataframe['pct_change_int'].rolling(30).sum() >= 0.48)\n        ).astype('int')\n\n        dataframe['isshortpumping'] = (\n         (dataframe['pct_change_int_short'].rolling(10).sum() >= 0.10)\n        ).astype('int')\n\n        dataframe['recentispumping'] = (dataframe['ispumping'].rolling(300).max() > 0) | (dataframe['islongpumping'].rolling(300).max() > 0)# | (dataframe['isshortpumping'].rolling(300).max() > 0)\n        \"\"\"\n        END ANTIPUMP\n        \"\"\"\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi'] < 31)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\nclass NASOSv5HO(NASOSv5_mod2):\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 8,\n        \"ewo_high\": 4.13,\n        \"ewo_high_2\": 4.477,\n        \"ewo_low\": -19.076,\n        \"lookback_candles\": 27,\n        \"low_offset\": 0.988,\n        \"low_offset_2\": 0.974,\n        \"profit_threshold\": 1.049,\n        \"rsi_buy\": 72,\n        \"rsi_fast_buy\": 40,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 8,\n        \"high_offset\": 1.012,\n        \"high_offset_2\": 1.431,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.1  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.03  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\nclass NASOSv5PD(NASOSv5_mod2):\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dont_buy_conditions.append(\n            (dataframe['recentispumping'] == True)\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                \n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi'] < 75)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 35)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\nclass NASOSv5SL(NASOSv5_mod2):\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"base_nb_candles_sell\": 12,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n\n    trailing_stop = False\n    use_custom_stoploss = True\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n\nclass TrailingBuyStrat(NASOSv5_mod2):\n    # if process_only_new_candles = True, then you need to use 1m timeframe (and normal strat timeframe as informative)\n\n    trailing_buy_order_enabled = True\n    trailing_buy_offset = 0.005\n    process_only_new_candles = True\n\n    custom_info = dict() # custom_info should be a dict\n\n    def custom_sell(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                    current_profit: float, **kwargs):\n        tag = super(TrailingBuyStrat, self).custom_sell(pair, trade, current_time, current_rate, current_profit, **kwargs)\n        if tag:\n            self.custom_info[pair]['trailing_buy'] = {\n                'trailing_buy_order_started': False,\n                'trailing_buy_order_uplimit': 0,\n                'start_trailing_price': 0,\n                'buy_tag': None\n            }\n            logger.info(f'STOP trailing buy for {pair} because of {tag}')\n        return tag\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super(TrailingBuyStrat, self).populate_indicators(dataframe, metadata)\n        if not metadata[\"pair\"] in self.custom_info:\n            self.custom_info[metadata[\"pair\"]] = dict()\n        if not 'trailing_buy' in self.custom_info[metadata['pair']]:\n            self.custom_info[metadata[\"pair\"]]['trailing_buy'] = {\n                'trailing_buy_order_started': False,\n                'trailing_buy_order_uplimit': 0,\n                'start_trailing_price': 0,\n                'buy_tag': None\n            }\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super(TrailingBuyStrat, self).confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)\n        self.custom_info[pair]['trailing_buy']['trailing_buy_order_started'] = False\n        self.custom_info[pair]['trailing_buy']['trailing_buy_order_uplimit'] = 0\n        self.custom_info[pair]['trailing_buy']['start_trailing_price'] = 0\n        self.custom_info[pair]['trailing_buy']['buy_tag'] = None\n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        def get_local_min(x):\n            win = dataframe.loc[:, 'barssince_last_buy'].iloc[x.shape[0] - 1].astype('int')\n            win = max(win, 0)\n            return pd.Series(x).rolling(window=win).min().iloc[-1]\n\n        dataframe = super(TrailingBuyStrat, self).populate_buy_trend(dataframe, metadata)\n        dataframe = dataframe.rename(columns={\"buy\": \"pre_buy\"})\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):  # trailing live dry ticker, 1m\n            last_candle = dataframe.iloc[-1].squeeze()\n            if not self.process_only_new_candles:\n                current_price = self.get_current_price(metadata[\"pair\"])\n            else:\n                current_price = last_candle['close']\n            dataframe['buy'] = 0\n            if not self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] and last_candle['pre_buy'] == 1:\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] = True\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['buy_tag'] = last_candle['buy_tag']\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle[f'close']\n                logger.info(f'start trailing buy for {metadata[\"pair\"]} at {last_candle[\"close\"]}')\n            elif self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started']:\n                if current_price < self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit']:\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + self.trailing_buy_offset), self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'])\n                    logger.info(f'update trailing buy for {metadata[\"pair\"]} at {self.custom_info[metadata[\"pair\"]][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                elif current_price < self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price']:\n                    dataframe.iloc[-1, dataframe.columns.get_loc('buy')] = 1\n                    ratio = \"%.2f\" % ((current_price / self.custom_info[metadata['pair']]['trailing_buy']['start_trailing_price']) * 100)\n                    dataframe.iloc[-1, dataframe.columns.get_loc('buy_tag')] = f\"{self.custom_info[metadata['pair']]['trailing_buy']['buy_tag']} ({ratio} %)\"\n                    # stop trailing when buy signal ! prevent from buyin much higher price when slot is free\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] = False\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = 0\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price'] = None\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['buy_tag'] = None\n                else:\n                    logger.info(f'price to high for {metadata[\"pair\"]} at {current_price} vs {self.custom_info[metadata[\"pair\"]][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n        elif self.trailing_buy_order_enabled:\n            # FOR BACKTEST\n            # PROBABLY STILL NOT WORKING\n            dataframe.loc[\n                (dataframe['pre_buy'] == 1) &\n                (dataframe['pre_buy'].shift() == 0)\n            , 'pre_buy_switch'] = 1\n            dataframe['pre_buy_switch'] = dataframe['pre_buy_switch'].fillna(0)\n\n            dataframe['barssince_last_buy'] = dataframe['pre_buy_switch'].groupby(dataframe['pre_buy_switch'].cumsum()).cumcount()\n\n            # Create integer positions of each row\n            idx_positions = np.arange(len(dataframe))\n            # \"shift\" those integer positions by the amount in shift col\n            shifted_idx_positions = idx_positions - dataframe[\"barssince_last_buy\"]\n            # get the label based index from our DatetimeIndex\n            shifted_loc_index = dataframe.index[shifted_idx_positions]\n            # Retrieve the \"shifted\" values and assign them as a new column\n            dataframe[\"close_5m_last_buy\"] = dataframe.loc[shifted_loc_index, \"close_5m\"].values\n\n            dataframe.loc[:, 'close_lower'] = dataframe.loc[:, 'close'].expanding().apply(get_local_min)\n            dataframe['close_lower'] = np.where(dataframe['close_lower'].isna() == True, dataframe['close'], dataframe['close_lower'])\n            dataframe['close_lower_offset'] = dataframe['close_lower'] * (1 + self.trailing_buy_offset)\n            dataframe['trailing_buy_order_uplimit'] = np.where(dataframe['barssince_last_buy'] < 20, pd.DataFrame([dataframe['close_5m_last_buy'], dataframe['close_lower_offset']]).min(), np.nan)\n\n            dataframe.loc[\n                (dataframe['barssince_last_buy'] < 20) & # must buy within last 20 candles after signal\n                (dataframe['close'] > dataframe['trailing_buy_order_uplimit'])\n            , 'trailing_buy'] = 1\n\n            dataframe['trailing_buy_count'] = dataframe['trailing_buy'].rolling(20).sum()\n\n            dataframe.log[\n                (dataframe['trailing_buy'] == 1) &\n                (dataframe['trailing_buy_count'] == 1)\n            , 'buy'] = 1\n        else: # No but trailing\n            dataframe.loc[\n                (dataframe['pre_buy'] == 1)\n            , 'buy'] = 1\n        return dataframe\n\n    def get_current_price(self, pair: str) -> float:\n        ticker = self.dp.ticker(pair)\n        current_price = ticker['last']\n        return current_price\n"
  },
  {
    "path": "strategies/NASOSv5_mod3/NASOSv5_mod3.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom logging import FATAL\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\nimport logging\nimport pandas as pd\n\n\nlogger = logging.getLogger(__name__)\n\n# @Rallipanos\n# @pluxury\n# with help from @stash86 and @Perkmeister\n\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=50):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 120\n    return emadif\n\n\nclass NASOSv5_mod3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 20,\n        \"ewo_high\": 4.299,\n        \"ewo_high_2\": 8.492,\n        \"ewo_low\": -8.476,\n        \"low_offset\": 0.984,\n        \"low_offset_2\": 0.901,\n        \"lookback_candles\": 7,\n        \"profit_threshold\": 1.036,\n        \"rsi_buy\": 80,\n        \"rsi_fast_buy\": 27,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 20,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.4\n    }\n\n    # Stoploss:\n    stoploss = -0.3  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.03  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\n\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        2, 25, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    lookback_candles = IntParameter(\n        1, 36, default=buy_params['lookback_candles'], space='buy', optimize=True)\n\n    profit_threshold = DecimalParameter(0.99, 1.05,\n                                        default=buy_params['profit_threshold'], space='buy', optimize=True)\n\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(10, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_fast_buy = IntParameter(\n        10, 50, default=buy_params['rsi_fast_buy'], space='buy', optimize=True)\n\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_15m = '15m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = False\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n        'subplots': {\n            'rsi': {\n                'rsi': {'color': 'orange'},\n                'rsi_fast': {'color': 'red'},\n                'rsi_slow': {'color': 'green'},\n            },\n            'ewo': {\n                'EWO': {'color': 'orange'}\n            },\n        }\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    protections = [\n        # \t{\n        # \t\t\"method\": \"StoplossGuard\",\n        # \t\t\"lookback_period_candles\": 12,\n        # \t\t\"trade_limit\": 1,\n        # \t\t\"stop_duration_candles\": 6,\n        # \t\t\"only_per_pair\": True\n        # \t},\n        # \t{\n        # \t\t\"method\": \"StoplossGuard\",\n        # \t\t\"lookback_period_candles\": 12,\n        # \t\t\"trade_limit\": 2,\n        # \t\t\"stop_duration_candles\": 6,\n        # \t\t\"only_per_pair\": False\n        # \t},\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"MaxDrawdown\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 1,\n            \"stop_duration_candles\": 12,\n            \"max_allowed_drawdown\": 0.2\n        },\n    ]\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if (current_profit > 0.3):\n            return 0.05\n        elif (current_profit > 0.1):\n            return 0.03\n        elif (current_profit > 0.06):\n            return 0.02\n        elif (current_profit > 0.04):\n            return 0.01\n        elif (current_profit > 0.025):\n            return 0.005\n        elif (current_profit > 0.018):\n            return 0.005\n\n        return 0.15\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '15m') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n        # EMA\n        # informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        # informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # # RSI\n        # informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # informative_1h['bb_lowerband'] = bollinger['lower']\n        # informative_1h['bb_middleband'] = bollinger['mid']\n        # informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=5)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=25)\n\n        \"\"\"\n        ANTIPUMP THING TO TEST\n        \"\"\"\n        dataframe['pct_change'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int'] = ((dataframe['pct_change'] > 0.15).astype(int) | (dataframe['pct_change'] < -0.15).astype(int))\n\n        dataframe['pct_change_short'] = dataframe['close'].pct_change(periods=8)\n        dataframe['pct_change_int_short'] = ((dataframe['pct_change_short'] > 0.08).astype(int) | (dataframe['pct_change_short'] < -0.08).astype(int))\n\n        dataframe['ispumping'] = (\n         (dataframe['pct_change_int'].rolling(20).sum() >= 0.4)\n        ).astype('int')\n\n        dataframe['islongpumping'] = (\n         (dataframe['pct_change_int'].rolling(30).sum() >= 0.48)\n        ).astype('int')\n\n        dataframe['isshortpumping'] = (\n         (dataframe['pct_change_int_short'].rolling(10).sum() >= 0.10)\n        ).astype('int')\n\n        dataframe['recentispumping'] = (dataframe['ispumping'].rolling(300).max() > 0) | (dataframe['islongpumping'].rolling(300).max() > 0)# | (dataframe['isshortpumping'].rolling(300).max() > 0)\n        \"\"\"\n        END ANTIPUMP\n        \"\"\"\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(\n            dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                \n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi'] < 44)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\nclass NASOSv5HO(NASOSv5_mod3):\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 8,\n        \"ewo_high\": 4.13,\n        \"ewo_high_2\": 4.477,\n        \"ewo_low\": -19.076,\n        \"lookback_candles\": 27,\n        \"low_offset\": 0.988,\n        \"low_offset_2\": 0.974,\n        \"profit_threshold\": 1.049,\n        \"rsi_buy\": 72,\n        \"rsi_fast_buy\": 40,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 8,\n        \"high_offset\": 1.012,\n        \"high_offset_2\": 1.431,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    # Stoploss:\n    stoploss = -0.1  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = True  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.03  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy\n\nclass NASOSv5PD(NASOSv5_mod3):\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (\n                # don't buy if there isn't 3% profit to be made\n                (dataframe['close_15m'].rolling(self.lookback_candles.value).max()\n                 < (dataframe['close'] * self.profit_threshold.value))\n            )\n        )\n\n        dont_buy_conditions.append(\n            (dataframe['recentispumping'] == True)\n        )\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                \n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n                \n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 35)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < self.rsi_fast_buy.value) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\nclass NASOSv5SL(NASOSv5_mod3):\n    sell_params = {\n        \"pHSL\": -0.178,\n        \"pPF_1\": 0.019,\n        \"pPF_2\": 0.065,\n        \"pSL_1\": 0.019,\n        \"pSL_2\": 0.062,\n        \"base_nb_candles_sell\": 12,\n        \"high_offset\": 1.01,\n        \"high_offset_2\": 1.142,\n    }\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n\n    trailing_stop = False\n    use_custom_stoploss = True\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n\nclass TrailingBuyStrat(NASOSv5_mod3):\n    # if process_only_new_candles = True, then you need to use 1m timeframe (and normal strat timeframe as informative)\n\n    trailing_buy_order_enabled = True\n    trailing_buy_offset = 0.005\n    process_only_new_candles = True\n\n    custom_info = dict() # custom_info should be a dict\n\n    def custom_sell(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                    current_profit: float, **kwargs):\n        tag = super(TrailingBuyStrat, self).custom_sell(pair, trade, current_time, current_rate, current_profit, **kwargs)\n        if tag:\n            self.custom_info[pair]['trailing_buy'] = {\n                'trailing_buy_order_started': False,\n                'trailing_buy_order_uplimit': 0,\n                'start_trailing_price': 0,\n                'buy_tag': None\n            }\n            logger.info(f'STOP trailing buy for {pair} because of {tag}')\n        return tag\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super(TrailingBuyStrat, self).populate_indicators(dataframe, metadata)\n        if not metadata[\"pair\"] in self.custom_info:\n            self.custom_info[metadata[\"pair\"]] = dict()\n        if not 'trailing_buy' in self.custom_info[metadata['pair']]:\n            self.custom_info[metadata[\"pair\"]]['trailing_buy'] = {\n                'trailing_buy_order_started': False,\n                'trailing_buy_order_uplimit': 0,\n                'start_trailing_price': 0,\n                'buy_tag': None\n            }\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super(TrailingBuyStrat, self).confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)\n        self.custom_info[pair]['trailing_buy']['trailing_buy_order_started'] = False\n        self.custom_info[pair]['trailing_buy']['trailing_buy_order_uplimit'] = 0\n        self.custom_info[pair]['trailing_buy']['start_trailing_price'] = 0\n        self.custom_info[pair]['trailing_buy']['buy_tag'] = None\n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        def get_local_min(x):\n            win = dataframe.loc[:, 'barssince_last_buy'].iloc[x.shape[0] - 1].astype('int')\n            win = max(win, 0)\n            return pd.Series(x).rolling(window=win).min().iloc[-1]\n\n        dataframe = super(TrailingBuyStrat, self).populate_buy_trend(dataframe, metadata)\n        dataframe = dataframe.rename(columns={\"buy\": \"pre_buy\"})\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):  # trailing live dry ticker, 1m\n            last_candle = dataframe.iloc[-1].squeeze()\n            if not self.process_only_new_candles:\n                current_price = self.get_current_price(metadata[\"pair\"])\n            else:\n                current_price = last_candle['close']\n            dataframe['buy'] = 0\n            if not self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] and last_candle['pre_buy'] == 1:\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] = True\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['buy_tag'] = last_candle['buy_tag']\n                self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle[f'close']\n                logger.info(f'start trailing buy for {metadata[\"pair\"]} at {last_candle[\"close\"]}')\n            elif self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started']:\n                if current_price < self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit']:\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + self.trailing_buy_offset), self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'])\n                    logger.info(f'update trailing buy for {metadata[\"pair\"]} at {self.custom_info[metadata[\"pair\"]][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                elif current_price < self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price']:\n                    dataframe.iloc[-1, dataframe.columns.get_loc('buy')] = 1\n                    ratio = \"%.2f\" % ((current_price / self.custom_info[metadata['pair']]['trailing_buy']['start_trailing_price']) * 100)\n                    dataframe.iloc[-1, dataframe.columns.get_loc('buy_tag')] = f\"{self.custom_info[metadata['pair']]['trailing_buy']['buy_tag']} ({ratio} %)\"\n                    # stop trailing when buy signal ! prevent from buyin much higher price when slot is free\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_started'] = False\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['trailing_buy_order_uplimit'] = 0\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['start_trailing_price'] = None\n                    self.custom_info[metadata[\"pair\"]]['trailing_buy']['buy_tag'] = None\n                else:\n                    logger.info(f'price to high for {metadata[\"pair\"]} at {current_price} vs {self.custom_info[metadata[\"pair\"]][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n        elif self.trailing_buy_order_enabled:\n            # FOR BACKTEST\n            # PROBABLY STILL NOT WORKING\n            dataframe.loc[\n                (dataframe['pre_buy'] == 1) &\n                (dataframe['pre_buy'].shift() == 0)\n            , 'pre_buy_switch'] = 1\n            dataframe['pre_buy_switch'] = dataframe['pre_buy_switch'].fillna(0)\n\n            dataframe['barssince_last_buy'] = dataframe['pre_buy_switch'].groupby(dataframe['pre_buy_switch'].cumsum()).cumcount()\n\n            # Create integer positions of each row\n            idx_positions = np.arange(len(dataframe))\n            # \"shift\" those integer positions by the amount in shift col\n            shifted_idx_positions = idx_positions - dataframe[\"barssince_last_buy\"]\n            # get the label based index from our DatetimeIndex\n            shifted_loc_index = dataframe.index[shifted_idx_positions]\n            # Retrieve the \"shifted\" values and assign them as a new column\n            dataframe[\"close_5m_last_buy\"] = dataframe.loc[shifted_loc_index, \"close_5m\"].values\n\n            dataframe.loc[:, 'close_lower'] = dataframe.loc[:, 'close'].expanding().apply(get_local_min)\n            dataframe['close_lower'] = np.where(dataframe['close_lower'].isna() == True, dataframe['close'], dataframe['close_lower'])\n            dataframe['close_lower_offset'] = dataframe['close_lower'] * (1 + self.trailing_buy_offset)\n            dataframe['trailing_buy_order_uplimit'] = np.where(dataframe['barssince_last_buy'] < 20, pd.DataFrame([dataframe['close_5m_last_buy'], dataframe['close_lower_offset']]).min(), np.nan)\n\n            dataframe.loc[\n                (dataframe['barssince_last_buy'] < 20) & # must buy within last 20 candles after signal\n                (dataframe['close'] > dataframe['trailing_buy_order_uplimit'])\n            , 'trailing_buy'] = 1\n\n            dataframe['trailing_buy_count'] = dataframe['trailing_buy'].rolling(20).sum()\n\n            dataframe.log[\n                (dataframe['trailing_buy'] == 1) &\n                (dataframe['trailing_buy_count'] == 1)\n            , 'buy'] = 1\n        else: # No but trailing\n            dataframe.loc[\n                (dataframe['pre_buy'] == 1)\n            , 'buy'] = 1\n        return dataframe\n\n    def get_current_price(self, pair: str) -> float:\n        ticker = self.dp.ticker(pair)\n        current_price = ticker['last']\n        return current_price"
  },
  {
    "path": "strategies/NFI46/NFI46.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI46(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom Stoploss\n    use_custom_stoploss = False\n    \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_bb20_close_bblowerband_4\": 0.909,\n        \"buy_bb20_volume_4\": 32,\n        \"buy_bb40_bbdelta_close_3\": 0.053,\n        \"buy_bb40_closedelta_close_3\": 0.013,\n        \"buy_bb40_tail_bbdelta_3\": 0.171,\n        \"buy_bb_offset_10\": 0.989,\n        \"buy_bb_offset_14\": 0.99,\n        \"buy_bb_offset_2\": 0.989,\n        \"buy_bb_offset_5\": 0.986,\n        \"buy_bb_offset_6\": 0.981,\n        \"buy_bb_offset_9\": 0.975,\n        \"buy_dip_threshold_1\": 0.032,\n        \"buy_dip_threshold_10\": 0.142,\n        \"buy_dip_threshold_11\": 0.233,\n        \"buy_dip_threshold_12\": 0.292,\n        \"buy_dip_threshold_2\": 0.053,\n        \"buy_dip_threshold_3\": 0.358,\n        \"buy_dip_threshold_4\": 0.248,\n        \"buy_dip_threshold_5\": 0.026,\n        \"buy_dip_threshold_6\": 0.041,\n        \"buy_dip_threshold_7\": 0.161,\n        \"buy_dip_threshold_8\": 0.398,\n        \"buy_dip_threshold_9\": 0.02,\n        \"buy_ema_open_mult_14\": 0.023,\n        \"buy_ema_open_mult_15\": 0.02,\n        \"buy_ema_open_mult_5\": 0.02,\n        \"buy_ema_open_mult_6\": 0.038,\n        \"buy_ema_open_mult_7\": 0.039,\n        \"buy_ema_rel_15\": 0.993,\n        \"buy_ema_rel_3\": 0.998,\n        \"buy_ema_rel_5\": 0.98,\n        \"buy_ema_rel_8\": 0.994,\n        \"buy_ewo_12\": 5.9,\n        \"buy_ewo_13\": -11.0,\n        \"buy_ewo_16\": 8.0,\n        \"buy_ewo_17\": -15.4,\n        \"buy_ma_offset_10\": 0.944,\n        \"buy_ma_offset_11\": 0.986,\n        \"buy_ma_offset_12\": 0.962,\n        \"buy_ma_offset_13\": 0.939,\n        \"buy_ma_offset_14\": 0.977,\n        \"buy_ma_offset_15\": 0.971,\n        \"buy_ma_offset_16\": 0.934,\n        \"buy_ma_offset_17\": 0.935,\n        \"buy_ma_offset_9\": 0.979,\n        \"buy_mfi_1\": 47.4,\n        \"buy_mfi_11\": 40.6,\n        \"buy_mfi_2\": 44.6,\n        \"buy_mfi_9\": 36.1,\n        \"buy_min_inc_1\": 0.023,\n        \"buy_min_inc_11\": 0.016,\n        \"buy_pump_pull_threshold_1\": 1.95,\n        \"buy_pump_pull_threshold_2\": 2.87,\n        \"buy_pump_pull_threshold_3\": 1.67,\n        \"buy_pump_pull_threshold_4\": 2.48,\n        \"buy_pump_pull_threshold_5\": 2.39,\n        \"buy_pump_pull_threshold_6\": 1.99,\n        \"buy_pump_pull_threshold_7\": 2.88,\n        \"buy_pump_pull_threshold_8\": 2.85,\n        \"buy_pump_pull_threshold_9\": 1.5,\n        \"buy_pump_threshold_1\": 0.531,\n        \"buy_pump_threshold_2\": 0.491,\n        \"buy_pump_threshold_3\": 0.728,\n        \"buy_pump_threshold_4\": 0.418,\n        \"buy_pump_threshold_5\": 0.522,\n        \"buy_pump_threshold_6\": 0.989,\n        \"buy_pump_threshold_7\": 0.531,\n        \"buy_pump_threshold_8\": 0.61,\n        \"buy_pump_threshold_9\": 0.767,\n        \"buy_rsi_1\": 21.6,\n        \"buy_rsi_11\": 35.5,\n        \"buy_rsi_12\": 30.2,\n        \"buy_rsi_15\": 48.9,\n        \"buy_rsi_16\": 48.8,\n        \"buy_rsi_1h_10\": 39.4,\n        \"buy_rsi_1h_diff_2\": 39.0,\n        \"buy_rsi_1h_max_1\": 76.6,\n        \"buy_rsi_1h_max_11\": 86.6,\n        \"buy_rsi_1h_max_2\": 91.0,\n        \"buy_rsi_1h_max_9\": 85.9,\n        \"buy_rsi_1h_min_1\": 33.5,\n        \"buy_rsi_1h_min_11\": 59.8,\n        \"buy_rsi_1h_min_2\": 34.6,\n        \"buy_rsi_1h_min_9\": 26.7,\n        \"buy_rsi_7\": 36.3,\n        \"buy_rsi_8\": 30.4,\n        \"buy_volume_10\": 1.2,\n        \"buy_volume_12\": 6.5,\n        \"buy_volume_14\": 4.5,\n        \"buy_volume_16\": 2.6,\n        \"buy_volume_2\": 9.8,\n        \"buy_volume_5\": 5.4,\n        \"buy_volume_6\": 3.7,\n        \"buy_volume_7\": 4.1,\n        \"buy_volume_9\": 1.97,\n    }\n\n    sell_params = {\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        \"sell_bb_relative_8\": 1.158,\n        \"sell_custom_dec_profit_max_1\": 0.064,\n        \"sell_custom_dec_profit_max_2\": 0.139,\n        \"sell_custom_dec_profit_min_1\": 0.051,\n        \"sell_custom_dec_profit_min_2\": 0.053,\n        \"sell_custom_profit_0\": 0.022,\n        \"sell_custom_profit_1\": 0.079,\n        \"sell_custom_profit_10\": 0.111,\n        \"sell_custom_profit_11\": 0.237,\n        \"sell_custom_profit_2\": 0.074,\n        \"sell_custom_profit_3\": 0.016,\n        \"sell_custom_profit_4\": 0.049,\n        \"sell_custom_profit_5\": 0.077,\n        \"sell_custom_profit_6\": 0.013,\n        \"sell_custom_profit_7\": 0.059,\n        \"sell_custom_profit_8\": 0.083,\n        \"sell_custom_profit_9\": 0.122,\n        \"sell_custom_profit_under_rel_1\": 0.019,\n        \"sell_custom_profit_under_rsi_diff_1\": 1.978,\n        \"sell_custom_pump_dec_profit_max_1\": 0.034,\n        \"sell_custom_pump_dec_profit_max_2\": 0.043,\n        \"sell_custom_pump_dec_profit_max_3\": 0.064,\n        \"sell_custom_pump_dec_profit_max_4\": 0.064,\n        \"sell_custom_pump_dec_profit_min_1\": 0.018,\n        \"sell_custom_pump_dec_profit_min_2\": 0.078,\n        \"sell_custom_pump_dec_profit_min_3\": 0.052,\n        \"sell_custom_pump_dec_profit_min_4\": 0.013,\n        \"sell_custom_pump_profit_1_1\": 0.027,\n        \"sell_custom_pump_profit_1_2\": 0.322,\n        \"sell_custom_pump_profit_1_3\": 0.086,\n        \"sell_custom_pump_profit_1_4\": 0.098,\n        \"sell_custom_pump_profit_1_5\": 0.225,\n        \"sell_custom_pump_profit_2_1\": 0.014,\n        \"sell_custom_pump_profit_2_2\": 0.288,\n        \"sell_custom_pump_profit_2_3\": 0.1,\n        \"sell_custom_pump_profit_2_4\": 0.087,\n        \"sell_custom_pump_profit_2_5\": 0.154,\n        \"sell_custom_pump_profit_3_1\": 0.026,\n        \"sell_custom_pump_profit_3_2\": 0.443,\n        \"sell_custom_pump_profit_3_3\": 0.068,\n        \"sell_custom_pump_profit_3_4\": 0.116,\n        \"sell_custom_pump_profit_3_5\": 0.143,\n        \"sell_custom_pump_rsi_1_1\": 34.6,\n        \"sell_custom_pump_rsi_1_2\": 42.8,\n        \"sell_custom_pump_rsi_1_3\": 41.2,\n        \"sell_custom_pump_rsi_1_4\": 39.4,\n        \"sell_custom_pump_rsi_1_5\": 31.7,\n        \"sell_custom_pump_rsi_2_1\": 29.4,\n        \"sell_custom_pump_rsi_2_2\": 41.0,\n        \"sell_custom_pump_rsi_2_3\": 40.6,\n        \"sell_custom_pump_rsi_2_4\": 40.6,\n        \"sell_custom_pump_rsi_2_5\": 39.4,\n        \"sell_custom_pump_rsi_3_1\": 34.4,\n        \"sell_custom_pump_rsi_3_2\": 39.6,\n        \"sell_custom_pump_rsi_3_3\": 47.0,\n        \"sell_custom_pump_rsi_3_4\": 43.7,\n        \"sell_custom_pump_rsi_3_5\": 20.8,\n        \"sell_custom_pump_trail_down_1\": 0.018,\n        \"sell_custom_pump_trail_profit_max_1\": 0.15,\n        \"sell_custom_pump_trail_profit_min_1\": 0.066,\n        \"sell_custom_pump_trail_rsi_max_1\": 35.4,\n        \"sell_custom_pump_trail_rsi_min_1\": 24.8,\n        \"sell_custom_pump_under_profit_max_1\": 0.097,\n        \"sell_custom_pump_under_profit_min_1\": 0.035,\n        \"sell_custom_rsi_0\": 32.686,\n        \"sell_custom_rsi_1\": 38.65,\n        \"sell_custom_rsi_10\": 42.94,\n        \"sell_custom_rsi_11\": 39.31,\n        \"sell_custom_rsi_2\": 33.17,\n        \"sell_custom_rsi_3\": 48.86,\n        \"sell_custom_rsi_4\": 38.61,\n        \"sell_custom_rsi_5\": 48.34,\n        \"sell_custom_rsi_6\": 51.26,\n        \"sell_custom_rsi_7\": 45.63,\n        \"sell_custom_rsi_8\": 48.46,\n        \"sell_custom_rsi_9\": 54.83,\n        \"sell_custom_stoploss_pump_loss_2\": -0.054,\n        \"sell_custom_stoploss_pump_loss_3\": -0.06,\n        \"sell_custom_stoploss_pump_ma_offset_1\": 0.91,\n        \"sell_custom_stoploss_pump_ma_offset_2\": 0.78,\n        \"sell_custom_stoploss_pump_ma_offset_3\": 0.73,\n        \"sell_custom_stoploss_pump_max_1\": -0.047,\n        \"sell_custom_stoploss_pump_max_profit_1\": 0.034,\n        \"sell_custom_stoploss_pump_max_profit_2\": 0.018,\n        \"sell_custom_stoploss_pump_max_profit_3\": 0.022,\n        \"sell_custom_stoploss_pump_min_1\": -0.018,\n        \"sell_custom_stoploss_under_rel_1\": 0.001,\n        \"sell_custom_stoploss_under_rsi_diff_1\": 0.859,\n        \"sell_custom_under_profit_0\": 0.017,\n        \"sell_custom_under_profit_1\": 0.017,\n        \"sell_custom_under_profit_10\": 0.124,\n        \"sell_custom_under_profit_11\": 0.183,\n        \"sell_custom_under_profit_2\": 0.05,\n        \"sell_custom_under_profit_3\": 0.01,\n        \"sell_custom_under_profit_4\": 0.099,\n        \"sell_custom_under_profit_5\": 0.06,\n        \"sell_custom_under_profit_6\": 0.081,\n        \"sell_custom_under_profit_7\": 0.059,\n        \"sell_custom_under_profit_8\": 0.108,\n        \"sell_custom_under_profit_9\": 0.104,\n        \"sell_custom_under_rsi_0\": 38.3,\n        \"sell_custom_under_rsi_1\": 36.2,\n        \"sell_custom_under_rsi_10\": 40.4,\n        \"sell_custom_under_rsi_11\": 29.8,\n        \"sell_custom_under_rsi_2\": 53.8,\n        \"sell_custom_under_rsi_3\": 63.1,\n        \"sell_custom_under_rsi_4\": 63.8,\n        \"sell_custom_under_rsi_5\": 59.7,\n        \"sell_custom_under_rsi_6\": 52.7,\n        \"sell_custom_under_rsi_7\": 47.3,\n        \"sell_custom_under_rsi_8\": 57.6,\n        \"sell_custom_under_rsi_9\": 40.1,\n        \"sell_dual_rsi_rsi_1h_4\": 82.1,\n        \"sell_dual_rsi_rsi_4\": 76.1,\n        \"sell_ema_relative_5\": 0.036,\n        \"sell_pump_threshold_1\": 0.9,\n        \"sell_pump_threshold_2\": 0.44,\n        \"sell_pump_threshold_3\": 0.37,\n        \"sell_pump_threshold_4\": 0.51,\n        \"sell_pump_threshold_5\": 3.11,\n        \"sell_pump_threshold_6\": 1.3,\n        \"sell_pump_threshold_7\": 0.88,\n        \"sell_pump_threshold_8\": 0.37,\n        \"sell_pump_threshold_9\": 0.38,\n        \"sell_rsi_1h_7\": 93.7,\n        \"sell_rsi_bb_1\": 64.9,\n        \"sell_rsi_bb_2\": 72.8,\n        \"sell_rsi_diff_5\": 16.83,\n        \"sell_rsi_main_3\": 90.0,\n        \"sell_rsi_under_6\": 83.7,\n        \"sell_trail_down_1\": 0.056,\n        \"sell_trail_down_2\": 0.065,\n        \"sell_trail_down_3\": 0.035,\n        \"sell_trail_profit_max_1\": 0.5,\n        \"sell_trail_profit_max_2\": 0.46,\n        \"sell_trail_profit_max_3\": 0.21,\n        \"sell_trail_profit_min_1\": 0.1,\n        \"sell_trail_profit_min_2\": 0.099,\n        \"sell_trail_profit_min_3\": 0.048,\n        \"sell_trail_rsi_max_1\": 41.6,\n        \"sell_trail_rsi_max_2\": 30.0,\n        \"sell_trail_rsi_min_1\": 19.1,\n        \"sell_trail_rsi_min_2\": 25.6,\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=False, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/NFI46Frog/NFI46Frog.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom finta import TA as fta\nfrom typing import Dict, List, Optional, Tuple\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom skopt.space import Dimension\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI46Frog(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -1.0\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    custom_trade_info = {}\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_dynamic_roi = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        \n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.inf_1h:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_1h, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.inf_1h) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.inf_1h), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n        \n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc"
  },
  {
    "path": "strategies/NFI46FrogZ/NFI46FrogZ.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom finta import TA as fta\nfrom typing import Dict, List, Optional, Tuple\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom skopt.space import Dimension\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI46FrogZ(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom Stoploss\n    use_custom_stoploss = False\n    \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    custom_trade_info = {}\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_dynamic_roi = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        \n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.inf_1h:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_1h, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.inf_1h) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.inf_1h), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n        \n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 35:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.025 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.5\n\n        return 0.99\n\n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc"
  },
  {
    "path": "strategies/NFI46Offset/NFI46Offset.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI46Offset(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.013,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=True)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=True)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom Stoploss\n    use_custom_stoploss = False\n    \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 47,\n        \"buy_chop_min_19\": 41.0,\n        \"buy_rsi_1h_min_19\": 50.9,\n        \"ewo_high\": 3.28,\n        \"ewo_low\": -16.004,\n        \"low_offset_ema\": 0.93,\n        \"low_offset_kama\": 0.985,\n        \"low_offset_sma\": 0.9,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.973,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/NFI46OffsetHOA1/NFI46OffsetHOA1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI46OffsetHOA1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.013,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=True)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=True)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Custom Stoploss\n    use_custom_stoploss = False\n    \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        \"base_nb_candles_buy\": 74,\n        \"buy_bb20_close_bblowerband_4\": 0.932,\n        \"buy_bb20_volume_4\": 24,\n        \"buy_bb40_bbdelta_close_3\": 0.013,\n        \"buy_bb40_closedelta_close_3\": 0.021,\n        \"buy_bb40_tail_bbdelta_3\": 0.19,\n        \"buy_bb_offset_10\": 0.986,\n        \"buy_bb_offset_14\": 0.991,\n        \"buy_bb_offset_2\": 0.975,\n        \"buy_bb_offset_5\": 0.983,\n        \"buy_bb_offset_6\": 0.99,\n        \"buy_bb_offset_9\": 0.976,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": False,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": False,\n        \"buy_condition_16_enable\": False,\n        \"buy_condition_17_enable\": False,\n        \"buy_condition_1_enable\": False,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": False,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": False,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": False,\n        \"buy_condition_9_enable\": True,\n        \"buy_dip_threshold_1\": 0.015,\n        \"buy_dip_threshold_10\": 0.027,\n        \"buy_dip_threshold_11\": 0.321,\n        \"buy_dip_threshold_12\": 0.323,\n        \"buy_dip_threshold_2\": 0.124,\n        \"buy_dip_threshold_3\": 0.278,\n        \"buy_dip_threshold_4\": 0.496,\n        \"buy_dip_threshold_5\": 0.034,\n        \"buy_dip_threshold_6\": 0.111,\n        \"buy_dip_threshold_7\": 0.344,\n        \"buy_dip_threshold_8\": 0.429,\n        \"buy_dip_threshold_9\": 0.048,\n        \"buy_ema_open_mult_14\": 0.019,\n        \"buy_ema_open_mult_15\": 0.035,\n        \"buy_ema_open_mult_5\": 0.016,\n        \"buy_ema_open_mult_6\": 0.032,\n        \"buy_ema_open_mult_7\": 0.034,\n        \"buy_ema_rel_15\": 0.998,\n        \"buy_ema_rel_3\": 0.986,\n        \"buy_ema_rel_5\": 0.973,\n        \"buy_ema_rel_8\": 0.996,\n        \"buy_ewo_12\": 5.9,\n        \"buy_ewo_13\": -7.1,\n        \"buy_ewo_16\": 6.4,\n        \"buy_ewo_17\": -12.6,\n        \"buy_ma_offset_10\": 0.962,\n        \"buy_ma_offset_11\": 0.975,\n        \"buy_ma_offset_12\": 0.936,\n        \"buy_ma_offset_13\": 0.953,\n        \"buy_ma_offset_14\": 0.963,\n        \"buy_ma_offset_15\": 0.946,\n        \"buy_ma_offset_16\": 0.965,\n        \"buy_ma_offset_17\": 0.938,\n        \"buy_ma_offset_9\": 0.967,\n        \"buy_mfi_1\": 52.4,\n        \"buy_mfi_11\": 37.9,\n        \"buy_mfi_2\": 43.3,\n        \"buy_mfi_9\": 43.5,\n        \"buy_min_inc_1\": 0.027,\n        \"buy_min_inc_11\": 0.024,\n        \"buy_pump_pull_threshold_1\": 2.38,\n        \"buy_pump_pull_threshold_2\": 2.88,\n        \"buy_pump_pull_threshold_3\": 1.71,\n        \"buy_pump_pull_threshold_4\": 2.5,\n        \"buy_pump_pull_threshold_5\": 2.58,\n        \"buy_pump_pull_threshold_6\": 2.52,\n        \"buy_pump_pull_threshold_7\": 1.72,\n        \"buy_pump_pull_threshold_8\": 2.56,\n        \"buy_pump_pull_threshold_9\": 1.62,\n        \"buy_pump_threshold_1\": 0.699,\n        \"buy_pump_threshold_2\": 0.924,\n        \"buy_pump_threshold_3\": 0.909,\n        \"buy_pump_threshold_4\": 0.493,\n        \"buy_pump_threshold_5\": 0.636,\n        \"buy_pump_threshold_6\": 0.601,\n        \"buy_pump_threshold_7\": 0.822,\n        \"buy_pump_threshold_8\": 0.529,\n        \"buy_pump_threshold_9\": 1.652,\n        \"buy_rsi_1\": 39.9,\n        \"buy_rsi_11\": 47.0,\n        \"buy_rsi_12\": 39.4,\n        \"buy_rsi_15\": 30.2,\n        \"buy_rsi_16\": 46.6,\n        \"buy_rsi_1h_10\": 26.5,\n        \"buy_rsi_1h_diff_2\": 46.5,\n        \"buy_rsi_1h_max_1\": 84.8,\n        \"buy_rsi_1h_max_11\": 70.6,\n        \"buy_rsi_1h_max_2\": 75.0,\n        \"buy_rsi_1h_max_9\": 71.7,\n        \"buy_rsi_1h_min_1\": 28.6,\n        \"buy_rsi_1h_min_11\": 59.3,\n        \"buy_rsi_1h_min_2\": 30.4,\n        \"buy_rsi_1h_min_9\": 37.7,\n        \"buy_rsi_7\": 43.7,\n        \"buy_rsi_8\": 38.7,\n        \"buy_volume_10\": 8.5,\n        \"buy_volume_12\": 2.7,\n        \"buy_volume_14\": 4.2,\n        \"buy_volume_16\": 2.9,\n        \"buy_volume_2\": 6.9,\n        \"buy_volume_5\": 3.2,\n        \"buy_volume_6\": 2.1,\n        \"buy_volume_7\": 5.6,\n        \"buy_volume_9\": 3.45,\n        \"ewo_high\": 2.089,\n        \"ewo_low\": -13.005,\n        \"fast_ewo\": 12,\n        \"low_offset_ema\": 0.91,\n        \"low_offset_kama\": 0.975,\n        \"low_offset_sma\": 0.9,\n        \"low_offset_t3\": 0.977,\n        \"low_offset_trima\": 0.988,\n        \"slow_ewo\": 167,\n    }\n\n    sell_params = {\n        \"base_nb_candles_sell\": 30,\n        \"high_offset_ema\": 1.049,\n        \"high_offset_kama\": 1.065,\n        \"high_offset_sma\": 1.039,\n        \"high_offset_t3\": 0.99,\n        \"high_offset_trima\": 1.012,\n        \"sell_bb_relative_8\": 1.278,\n        \"sell_condition_1_enable\": False,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": False,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": False,\n        \"sell_custom_dec_profit_max_1\": 0.091,\n        \"sell_custom_dec_profit_max_2\": 0.157,\n        \"sell_custom_dec_profit_min_1\": 0.043,\n        \"sell_custom_dec_profit_min_2\": 0.055,\n        \"sell_custom_profit_0\": 0.037,\n        \"sell_custom_profit_1\": 0.087,\n        \"sell_custom_profit_10\": 0.129,\n        \"sell_custom_profit_11\": 0.314,\n        \"sell_custom_profit_2\": 0.032,\n        \"sell_custom_profit_3\": 0.089,\n        \"sell_custom_profit_4\": 0.096,\n        \"sell_custom_profit_5\": 0.043,\n        \"sell_custom_profit_6\": 0.049,\n        \"sell_custom_profit_7\": 0.01,\n        \"sell_custom_profit_8\": 0.082,\n        \"sell_custom_profit_9\": 0.113,\n        \"sell_custom_profit_under_rel_1\": 0.018,\n        \"sell_custom_profit_under_rsi_diff_1\": 5.003,\n        \"sell_custom_pump_dec_profit_max_1\": 0.041,\n        \"sell_custom_pump_dec_profit_max_2\": 0.04,\n        \"sell_custom_pump_dec_profit_max_3\": 0.072,\n        \"sell_custom_pump_dec_profit_max_4\": 0.047,\n        \"sell_custom_pump_dec_profit_min_1\": 0.015,\n        \"sell_custom_pump_dec_profit_min_2\": 0.052,\n        \"sell_custom_pump_dec_profit_min_3\": 0.076,\n        \"sell_custom_pump_dec_profit_min_4\": 0.027,\n        \"sell_custom_pump_profit_1_1\": 0.017,\n        \"sell_custom_pump_profit_1_2\": 0.308,\n        \"sell_custom_pump_profit_1_3\": 0.096,\n        \"sell_custom_pump_profit_1_4\": 0.07,\n        \"sell_custom_pump_profit_1_5\": 0.236,\n        \"sell_custom_pump_profit_2_1\": 0.024,\n        \"sell_custom_pump_profit_2_2\": 0.012,\n        \"sell_custom_pump_profit_2_3\": 0.098,\n        \"sell_custom_pump_profit_2_4\": 0.082,\n        \"sell_custom_pump_profit_2_5\": 0.18,\n        \"sell_custom_pump_profit_3_1\": 0.02,\n        \"sell_custom_pump_profit_3_2\": 0.195,\n        \"sell_custom_pump_profit_3_3\": 0.027,\n        \"sell_custom_pump_profit_3_4\": 0.088,\n        \"sell_custom_pump_profit_3_5\": 0.226,\n        \"sell_custom_pump_rsi_1_1\": 32.2,\n        \"sell_custom_pump_rsi_1_2\": 43.1,\n        \"sell_custom_pump_rsi_1_3\": 45.0,\n        \"sell_custom_pump_rsi_1_4\": 37.4,\n        \"sell_custom_pump_rsi_1_5\": 27.0,\n        \"sell_custom_pump_rsi_2_1\": 33.7,\n        \"sell_custom_pump_rsi_2_2\": 45.3,\n        \"sell_custom_pump_rsi_2_3\": 38.0,\n        \"sell_custom_pump_rsi_2_4\": 39.5,\n        \"sell_custom_pump_rsi_2_5\": 31.1,\n        \"sell_custom_pump_rsi_3_1\": 27.8,\n        \"sell_custom_pump_rsi_3_2\": 44.0,\n        \"sell_custom_pump_rsi_3_3\": 49.8,\n        \"sell_custom_pump_rsi_3_4\": 41.9,\n        \"sell_custom_pump_rsi_3_5\": 31.6,\n        \"sell_custom_pump_trail_down_1\": 0.019,\n        \"sell_custom_pump_trail_profit_max_1\": 0.09,\n        \"sell_custom_pump_trail_profit_min_1\": 0.012,\n        \"sell_custom_pump_trail_rsi_max_1\": 35.1,\n        \"sell_custom_pump_trail_rsi_min_1\": 20.8,\n        \"sell_custom_pump_under_profit_max_1\": 0.083,\n        \"sell_custom_pump_under_profit_min_1\": 0.049,\n        \"sell_custom_rsi_0\": 35.691,\n        \"sell_custom_rsi_1\": 41.11,\n        \"sell_custom_rsi_10\": 39.65,\n        \"sell_custom_rsi_11\": 34.84,\n        \"sell_custom_rsi_2\": 40.15,\n        \"sell_custom_rsi_3\": 33.85,\n        \"sell_custom_rsi_4\": 46.57,\n        \"sell_custom_rsi_5\": 40.61,\n        \"sell_custom_rsi_6\": 41.64,\n        \"sell_custom_rsi_7\": 57.43,\n        \"sell_custom_rsi_8\": 47.94,\n        \"sell_custom_rsi_9\": 58.51,\n        \"sell_custom_stoploss_pump_loss_2\": -0.045,\n        \"sell_custom_stoploss_pump_loss_3\": -0.066,\n        \"sell_custom_stoploss_pump_ma_offset_1\": 0.94,\n        \"sell_custom_stoploss_pump_ma_offset_2\": 0.84,\n        \"sell_custom_stoploss_pump_ma_offset_3\": 0.98,\n        \"sell_custom_stoploss_pump_max_1\": -0.013,\n        \"sell_custom_stoploss_pump_max_profit_1\": 0.022,\n        \"sell_custom_stoploss_pump_max_profit_2\": 0.035,\n        \"sell_custom_stoploss_pump_max_profit_3\": 0.017,\n        \"sell_custom_stoploss_pump_min_1\": -0.07,\n        \"sell_custom_stoploss_under_rel_1\": 0.02,\n        \"sell_custom_stoploss_under_rsi_diff_1\": 0.892,\n        \"sell_custom_under_profit_0\": 0.314,\n        \"sell_custom_under_profit_1\": 0.066,\n        \"sell_custom_under_profit_10\": 0.102,\n        \"sell_custom_under_profit_11\": 0.169,\n        \"sell_custom_under_profit_2\": 0.046,\n        \"sell_custom_under_profit_3\": 0.093,\n        \"sell_custom_under_profit_4\": 0.061,\n        \"sell_custom_under_profit_5\": 0.026,\n        \"sell_custom_under_profit_6\": 0.099,\n        \"sell_custom_under_profit_7\": 0.046,\n        \"sell_custom_under_profit_8\": 0.084,\n        \"sell_custom_under_profit_9\": 0.086,\n        \"sell_custom_under_rsi_0\": 35.3,\n        \"sell_custom_under_rsi_1\": 50.4,\n        \"sell_custom_under_rsi_10\": 42.8,\n        \"sell_custom_under_rsi_11\": 33.2,\n        \"sell_custom_under_rsi_2\": 58.4,\n        \"sell_custom_under_rsi_3\": 64.0,\n        \"sell_custom_under_rsi_4\": 52.7,\n        \"sell_custom_under_rsi_5\": 55.6,\n        \"sell_custom_under_rsi_6\": 48.0,\n        \"sell_custom_under_rsi_7\": 53.8,\n        \"sell_custom_under_rsi_8\": 45.3,\n        \"sell_custom_under_rsi_9\": 42.9,\n        \"sell_dual_rsi_rsi_1h_4\": 81.5,\n        \"sell_dual_rsi_rsi_4\": 81.2,\n        \"sell_ema_relative_5\": 0.015,\n        \"sell_pump_threshold_1\": 0.97,\n        \"sell_pump_threshold_2\": 0.74,\n        \"sell_pump_threshold_3\": 0.59,\n        \"sell_pump_threshold_4\": 0.52,\n        \"sell_pump_threshold_5\": 4.69,\n        \"sell_pump_threshold_6\": 1.03,\n        \"sell_pump_threshold_7\": 0.89,\n        \"sell_pump_threshold_8\": 0.43,\n        \"sell_pump_threshold_9\": 0.22,\n        \"sell_rsi_1h_7\": 90.4,\n        \"sell_rsi_bb_1\": 76.0,\n        \"sell_rsi_bb_2\": 88.9,\n        \"sell_rsi_diff_5\": 1.192,\n        \"sell_rsi_main_3\": 79.5,\n        \"sell_rsi_under_6\": 89.6,\n        \"sell_trail_down_1\": 0.018,\n        \"sell_trail_down_2\": 0.076,\n        \"sell_trail_down_3\": 0.029,\n        \"sell_trail_profit_max_1\": 0.56,\n        \"sell_trail_profit_max_2\": 0.42,\n        \"sell_trail_profit_max_3\": 0.28,\n        \"sell_trail_profit_min_1\": 0.18,\n        \"sell_trail_profit_min_2\": 0.16,\n        \"sell_trail_profit_min_3\": 0.06,\n        \"sell_trail_rsi_max_1\": 50.0,\n        \"sell_trail_rsi_max_2\": 46.5,\n        \"sell_trail_rsi_min_1\": 31.4,\n        \"sell_trail_rsi_min_2\": 35.2,\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/NFI46Z/NFI46Z.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI46Z(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,         # I feel lucky!\n        \"10\": 0.018,\n        \"40\": 0.005,\n        \"180\": 0.018,        # We're going up?\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom Stoploss\n    use_custom_stoploss = True\n    \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        \"buy_bb20_close_bblowerband_4\": 0.987,\n        \"buy_bb20_close_bblowerband_safe_1\": 1.014,\n        \"buy_bb20_close_bblowerband_safe_2\": 0.811,\n        \"buy_bb20_volume_4\": 34,\n        \"buy_bb40_bbdelta_close_3\": 0.052,\n        \"buy_bb40_closedelta_close_3\": 0.02,\n        \"buy_bb40_tail_bbdelta_3\": 0.397,\n        \"buy_bb_offset_10\": 0.982,\n        \"buy_bb_offset_14\": 0.981,\n        \"buy_bb_offset_2\": 0.983,\n        \"buy_bb_offset_5\": 0.987,\n        \"buy_bb_offset_6\": 0.986,\n        \"buy_bb_offset_9\": 0.981,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": False,\n        \"buy_condition_12_enable\": False,\n        \"buy_condition_13_enable\": False,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": False,\n        \"buy_condition_16_enable\": False,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": False,\n        \"buy_condition_19_enable\": False,\n        \"buy_condition_1_enable\": False,\n        \"buy_condition_20_enable\": False,\n        \"buy_condition_21_enable\": False,\n        \"buy_condition_22_enable\": False,\n        \"buy_condition_23_enable\": False,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": False,\n        \"buy_condition_26_enable\": False,\n        \"buy_condition_27_enable\": False,\n        \"buy_condition_28_enable\": False,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": False,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": False,\n        \"buy_condition_7_enable\": False,\n        \"buy_condition_8_enable\": False,\n        \"buy_condition_9_enable\": False,\n        \"buy_dip_threshold_1\": 0.014,\n        \"buy_dip_threshold_10\": 0.135,\n        \"buy_dip_threshold_11\": 0.156,\n        \"buy_dip_threshold_12\": 0.47,\n        \"buy_dip_threshold_2\": 0.127,\n        \"buy_dip_threshold_3\": 0.2,\n        \"buy_dip_threshold_4\": 0.243,\n        \"buy_dip_threshold_5\": 0.009,\n        \"buy_dip_threshold_6\": 0.072,\n        \"buy_dip_threshold_7\": 0.169,\n        \"buy_dip_threshold_8\": 0.487,\n        \"buy_dip_threshold_9\": 0.008,\n        \"buy_ema_open_mult_14\": 0.025,\n        \"buy_ema_open_mult_15\": 0.035,\n        \"buy_ema_open_mult_5\": 0.02,\n        \"buy_ema_open_mult_6\": 0.04,\n        \"buy_ema_open_mult_7\": 0.038,\n        \"buy_ema_rel_15\": 0.978,\n        \"buy_ema_rel_3\": 0.992,\n        \"buy_ema_rel_5\": 0.974,\n        \"buy_ema_rel_8\": 0.995,\n        \"buy_ewo_12\": 5.2,\n        \"buy_ewo_13\": -8.1,\n        \"buy_ewo_16\": 7.6,\n        \"buy_ewo_17\": -11.8,\n        \"buy_ma_offset_10\": 0.935,\n        \"buy_ma_offset_11\": 0.988,\n        \"buy_ma_offset_12\": 0.941,\n        \"buy_ma_offset_13\": 0.943,\n        \"buy_ma_offset_14\": 0.975,\n        \"buy_ma_offset_15\": 0.983,\n        \"buy_ma_offset_16\": 0.947,\n        \"buy_ma_offset_17\": 0.931,\n        \"buy_ma_offset_9\": 0.962,\n        \"buy_macd_1\": 0.05,\n        \"buy_macd_2\": 0.01,\n        \"buy_mfi_1\": 31.6,\n        \"buy_mfi_11\": 49.9,\n        \"buy_mfi_2\": 56.4,\n        \"buy_mfi_9\": 50.3,\n        \"buy_min_inc_1\": 0.048,\n        \"buy_min_inc_11\": 0.027,\n        \"buy_pump_pull_threshold_1\": 1.91,\n        \"buy_pump_pull_threshold_2\": 1.53,\n        \"buy_pump_pull_threshold_3\": 2.04,\n        \"buy_pump_pull_threshold_4\": 2.08,\n        \"buy_pump_pull_threshold_5\": 2.57,\n        \"buy_pump_pull_threshold_6\": 2.46,\n        \"buy_pump_pull_threshold_7\": 2.54,\n        \"buy_pump_pull_threshold_8\": 1.5,\n        \"buy_pump_pull_threshold_9\": 1.66,\n        \"buy_pump_threshold_1\": 0.549,\n        \"buy_pump_threshold_2\": 0.492,\n        \"buy_pump_threshold_3\": 0.453,\n        \"buy_pump_threshold_4\": 0.732,\n        \"buy_pump_threshold_5\": 0.815,\n        \"buy_pump_threshold_6\": 0.933,\n        \"buy_pump_threshold_7\": 0.535,\n        \"buy_pump_threshold_8\": 0.75,\n        \"buy_pump_threshold_9\": 0.65,\n        \"buy_rsi_1\": 30.1,\n        \"buy_rsi_11\": 34.4,\n        \"buy_rsi_12\": 35.2,\n        \"buy_rsi_15\": 32.4,\n        \"buy_rsi_16\": 47.5,\n        \"buy_rsi_1h_1\": 16.0,\n        \"buy_rsi_1h_10\": 30.0,\n        \"buy_rsi_1h_2\": 24.9,\n        \"buy_rsi_1h_3\": 24.7,\n        \"buy_rsi_1h_4\": 17.6,\n        \"buy_rsi_1h_5\": 30.6,\n        \"buy_rsi_1h_diff_2\": 42.7,\n        \"buy_rsi_1h_max_1\": 84.7,\n        \"buy_rsi_1h_max_11\": 86.7,\n        \"buy_rsi_1h_max_2\": 79.7,\n        \"buy_rsi_1h_max_9\": 79.5,\n        \"buy_rsi_1h_min_1\": 33.0,\n        \"buy_rsi_1h_min_11\": 43.4,\n        \"buy_rsi_1h_min_2\": 39.9,\n        \"buy_rsi_1h_min_9\": 38.9,\n        \"buy_rsi_2\": 39.7,\n        \"buy_rsi_3\": 10.0,\n        \"buy_rsi_7\": 33.2,\n        \"buy_rsi_8\": 41.8,\n        \"buy_volume_10\": 7.6,\n        \"buy_volume_12\": 8.9,\n        \"buy_volume_14\": 1.0,\n        \"buy_volume_16\": 6.3,\n        \"buy_volume_2\": 5.6,\n        \"buy_volume_5\": 2.8,\n        \"buy_volume_6\": 8.6,\n        \"buy_volume_7\": 4.9,\n        \"buy_volume_9\": 3.45,\n        \"buy_volume_drop_1\": 6.1,\n        \"buy_volume_drop_2\": 6.6,\n        \"buy_volume_drop_3\": 9.1,\n        \"buy_volume_pump_1\": 0.4,\n    }\n\n    sell_params = {\n        \"sell_bb_relative_8\": 1.073,\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": False,\n        \"sell_condition_3_enable\": False,\n        \"sell_condition_4_enable\": False,\n        \"sell_condition_5_enable\": False,\n        \"sell_condition_6_enable\": False,\n        \"sell_condition_7_enable\": False,\n        \"sell_condition_8_enable\": False,\n        \"sell_custom_dec_profit_max_1\": 0.108,\n        \"sell_custom_dec_profit_max_2\": 0.165,\n        \"sell_custom_dec_profit_min_1\": 0.085,\n        \"sell_custom_dec_profit_min_2\": 0.084,\n        \"sell_custom_profit_0\": 0.048,\n        \"sell_custom_profit_1\": 0.02,\n        \"sell_custom_profit_10\": 0.111,\n        \"sell_custom_profit_11\": 0.313,\n        \"sell_custom_profit_2\": 0.086,\n        \"sell_custom_profit_3\": 0.01,\n        \"sell_custom_profit_4\": 0.052,\n        \"sell_custom_profit_5\": 0.077,\n        \"sell_custom_profit_6\": 0.051,\n        \"sell_custom_profit_7\": 0.085,\n        \"sell_custom_profit_8\": 0.08,\n        \"sell_custom_profit_9\": 0.083,\n        \"sell_custom_profit_under_rel_1\": 0.01,\n        \"sell_custom_profit_under_rsi_diff_1\": 2.12,\n        \"sell_custom_pump_dec_profit_max_1\": 0.03,\n        \"sell_custom_pump_dec_profit_max_2\": 0.074,\n        \"sell_custom_pump_dec_profit_max_3\": 0.112,\n        \"sell_custom_pump_dec_profit_max_4\": 0.051,\n        \"sell_custom_pump_dec_profit_min_1\": 0.03,\n        \"sell_custom_pump_dec_profit_min_2\": 0.053,\n        \"sell_custom_pump_dec_profit_min_3\": 0.057,\n        \"sell_custom_pump_dec_profit_min_4\": 0.044,\n        \"sell_custom_pump_profit_1_1\": 0.013,\n        \"sell_custom_pump_profit_1_2\": 0.39,\n        \"sell_custom_pump_profit_1_3\": 0.067,\n        \"sell_custom_pump_profit_1_4\": 0.109,\n        \"sell_custom_pump_profit_1_5\": 0.177,\n        \"sell_custom_pump_profit_2_1\": 0.028,\n        \"sell_custom_pump_profit_2_2\": 0.275,\n        \"sell_custom_pump_profit_2_3\": 0.028,\n        \"sell_custom_pump_profit_2_4\": 0.11,\n        \"sell_custom_pump_profit_2_5\": 0.24,\n        \"sell_custom_pump_profit_3_1\": 0.026,\n        \"sell_custom_pump_profit_3_2\": 0.46,\n        \"sell_custom_pump_profit_3_3\": 0.094,\n        \"sell_custom_pump_profit_3_4\": 0.098,\n        \"sell_custom_pump_profit_3_5\": 0.231,\n        \"sell_custom_pump_rsi_1_1\": 26.8,\n        \"sell_custom_pump_rsi_1_2\": 42.9,\n        \"sell_custom_pump_rsi_1_3\": 40.3,\n        \"sell_custom_pump_rsi_1_4\": 39.7,\n        \"sell_custom_pump_rsi_1_5\": 27.9,\n        \"sell_custom_pump_rsi_2_1\": 32.5,\n        \"sell_custom_pump_rsi_2_2\": 48.1,\n        \"sell_custom_pump_rsi_2_3\": 40.8,\n        \"sell_custom_pump_rsi_2_4\": 45.2,\n        \"sell_custom_pump_rsi_2_5\": 38.6,\n        \"sell_custom_pump_rsi_3_1\": 31.0,\n        \"sell_custom_pump_rsi_3_2\": 44.8,\n        \"sell_custom_pump_rsi_3_3\": 44.7,\n        \"sell_custom_pump_rsi_3_4\": 45.7,\n        \"sell_custom_pump_rsi_3_5\": 36.7,\n        \"sell_custom_pump_trail_down_1\": 0.034,\n        \"sell_custom_pump_trail_profit_max_1\": 0.09,\n        \"sell_custom_pump_trail_profit_min_1\": 0.016,\n        \"sell_custom_pump_trail_rsi_max_1\": 33.7,\n        \"sell_custom_pump_trail_rsi_min_1\": 25.0,\n        \"sell_custom_pump_under_profit_max_1\": 0.066,\n        \"sell_custom_pump_under_profit_min_1\": 0.057,\n        \"sell_custom_rsi_0\": 31.129,\n        \"sell_custom_rsi_1\": 48.18,\n        \"sell_custom_rsi_10\": 47.63,\n        \"sell_custom_rsi_11\": 38.45,\n        \"sell_custom_rsi_2\": 42.64,\n        \"sell_custom_rsi_3\": 46.33,\n        \"sell_custom_rsi_4\": 44.62,\n        \"sell_custom_rsi_5\": 41.47,\n        \"sell_custom_rsi_6\": 49.31,\n        \"sell_custom_rsi_7\": 51.68,\n        \"sell_custom_rsi_8\": 42.78,\n        \"sell_custom_rsi_9\": 55.93,\n        \"sell_custom_stoploss_pump_loss_2\": -0.052,\n        \"sell_custom_stoploss_pump_loss_3\": -0.127,\n        \"sell_custom_stoploss_pump_ma_offset_1\": 0.99,\n        \"sell_custom_stoploss_pump_ma_offset_2\": 0.91,\n        \"sell_custom_stoploss_pump_ma_offset_3\": 0.76,\n        \"sell_custom_stoploss_pump_max_1\": -0.034,\n        \"sell_custom_stoploss_pump_max_profit_1\": 0.022,\n        \"sell_custom_stoploss_pump_max_profit_2\": 0.029,\n        \"sell_custom_stoploss_pump_max_profit_3\": 0.024,\n        \"sell_custom_stoploss_pump_min_1\": -0.063,\n        \"sell_custom_stoploss_under_rel_1\": 0.018,\n        \"sell_custom_stoploss_under_rsi_diff_1\": 3.666,\n        \"sell_custom_under_profit_0\": 0.065,\n        \"sell_custom_under_profit_1\": 0.09,\n        \"sell_custom_under_profit_10\": 0.101,\n        \"sell_custom_under_profit_11\": 0.177,\n        \"sell_custom_under_profit_2\": 0.083,\n        \"sell_custom_under_profit_3\": 0.061,\n        \"sell_custom_under_profit_4\": 0.086,\n        \"sell_custom_under_profit_5\": 0.025,\n        \"sell_custom_under_profit_6\": 0.061,\n        \"sell_custom_under_profit_7\": 0.08,\n        \"sell_custom_under_profit_8\": 0.114,\n        \"sell_custom_under_profit_9\": 0.094,\n        \"sell_custom_under_rsi_0\": 30.1,\n        \"sell_custom_under_rsi_1\": 48.1,\n        \"sell_custom_under_rsi_10\": 43.1,\n        \"sell_custom_under_rsi_11\": 25.5,\n        \"sell_custom_under_rsi_2\": 64.6,\n        \"sell_custom_under_rsi_3\": 56.7,\n        \"sell_custom_under_rsi_4\": 64.3,\n        \"sell_custom_under_rsi_5\": 60.8,\n        \"sell_custom_under_rsi_6\": 47.1,\n        \"sell_custom_under_rsi_7\": 58.0,\n        \"sell_custom_under_rsi_8\": 51.2,\n        \"sell_custom_under_rsi_9\": 32.7,\n        \"sell_dual_rsi_rsi_1h_4\": 86.0,\n        \"sell_dual_rsi_rsi_4\": 76.0,\n        \"sell_ema_relative_5\": 0.006,\n        \"sell_pump_threshold_1\": 1.04,\n        \"sell_pump_threshold_2\": 0.46,\n        \"sell_pump_threshold_3\": 0.66,\n        \"sell_pump_threshold_4\": 0.5,\n        \"sell_pump_threshold_5\": 3.23,\n        \"sell_pump_threshold_6\": 0.94,\n        \"sell_pump_threshold_7\": 0.51,\n        \"sell_pump_threshold_8\": 0.55,\n        \"sell_pump_threshold_9\": 0.38,\n        \"sell_rsi_1h_7\": 92.0,\n        \"sell_rsi_bb_1\": 73.3,\n        \"sell_rsi_bb_2\": 73.0,\n        \"sell_rsi_diff_5\": 3.551,\n        \"sell_rsi_main_3\": 84.2,\n        \"sell_rsi_under_6\": 85.8,\n        \"sell_trail_down_1\": 0.069,\n        \"sell_trail_down_2\": 0.05,\n        \"sell_trail_down_3\": 0.023,\n        \"sell_trail_profit_max_1\": 0.61,\n        \"sell_trail_profit_max_2\": 0.4,\n        \"sell_trail_profit_max_3\": 0.15,\n        \"sell_trail_profit_min_1\": 0.17,\n        \"sell_trail_profit_min_2\": 0.131,\n        \"sell_trail_profit_min_3\": 0.062,\n        \"sell_trail_rsi_max_1\": 43.8,\n        \"sell_trail_rsi_max_2\": 30.6,\n        \"sell_trail_rsi_min_1\": 16.5,\n        \"sell_trail_rsi_min_2\": 31.9,\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_25_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_27_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_28_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_29_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=True, load=True)\n    buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=True, load=True)\n\n    buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=True, load=True)\n    buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=True, load=True)\n    buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=True, load=True)\n    buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=True, load=True)\n    buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n\n        if (current_profit > 0):\n            return 0.99\n        else:\n            trade_time_50 = current_time - timedelta(minutes=50)\n\n            # Trade open more then 60 minutes. For this strategy it's means -> loss\n            # Let's try to minimize the loss\n\n            if (trade_time_50 > trade.open_date_utc):\n\n                try:\n                    number_of_candle_shift = int((trade_time_50 - trade.open_date_utc).total_seconds() / 300)\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    candle = dataframe.iloc[-number_of_candle_shift].squeeze()\n\n                    # We are at bottom. Wait...\n                    if candle['rsi_1h'] < 35:\n                        return 0.99\n\n                    # Are we still sinking? \n                    if candle['close'] > candle['ema_200']:\n                        if current_rate * 1.025 < candle['open']:\n                            return 0.01 \n\n                    if current_rate * 1.015 < candle['open']:\n                        return 0.01\n\n                except IndexError as error:\n\n                    # Whoops, set stoploss at 10%\n                    return 0.5\n\n        return 0.99\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # MACD \n        dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        ##From BigZ03\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &\n                (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &\n                (dataframe['close'].shift() > dataframe['bb_lowerband']) &\n                (dataframe['rsi_1h'] < 72.8) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                ((dataframe['high'] - dataframe['low']) < dataframe['open']/100) &\n                (dataframe['open'] < dataframe['close']) &\n                ((dataframe['high'].shift() - dataframe['low'].shift()) < dataframe['open'].shift()/100) &\n                ((dataframe['high'].shift(2) - dataframe['low'].shift(2)) < dataframe['open'].shift(2)/100) &\n                ((dataframe['high'].shift(3) - dataframe['low'].shift(3)) < dataframe['open'].shift(3)/100) &\n                ((dataframe['high'].shift(4) - dataframe['low'].shift(4)) < dataframe['open'].shift(4)/100) &\n                ((dataframe['high'].shift(5) - dataframe['low'].shift(5)) < dataframe['open'].shift(5)/100) &\n                ((dataframe['high'].shift(6) - dataframe['low'].shift(6)) < dataframe['open'].shift(6)/100) &\n                ((dataframe['high'].shift(7) - dataframe['low'].shift(7)) < dataframe['open'].shift(7)/100) &\n                ((dataframe['high'].shift(8) - dataframe['low'].shift(8)) < dataframe['open'].shift(8)/100) &\n                ((dataframe['high'].shift(9) - dataframe['low'].shift(9)) < dataframe['open'].shift(9)/100) &\n                (dataframe['bb_middleband'] > dataframe['bb_middleband'].shift(9) * 1.005) &\n                (dataframe['rsi'] < 68) &\n\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['rsi'] < 30) &\n                (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &\n                (dataframe['rsi_1h'] < 71) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] <  dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &\n                (dataframe['rsi_1h'] < 69) &\n                (dataframe['open'] > dataframe['close']) &\n                \n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_22_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband'] *  self.buy_bb20_close_bblowerband_safe_2.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_23_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n                (dataframe['rsi'] < self.buy_rsi_3.value) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_24_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &\n\n                (dataframe['close'] < dataframe['bb_lowerband']) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_25_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_26_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_27_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &\n                \n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_28_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_29_enable.value &\n\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &\n                (dataframe['rsi'] < self.buy_rsi_2.value) &\n                \n                (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &\n                (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &\n                (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['bb_middleband'] * 1.01) &                  # Don't be gready, sell fast\n                (dataframe['volume'] > 0) # Make sure Volume is not 0\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/NFI47V2/NFI47V2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI47V2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.025\n\n    # Custom Stoploss\n    use_custom_stoploss = False\n    \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_dip_threshold_1\": 0.017,\n        \"buy_dip_threshold_2\": 0.058,\n        \"buy_dip_threshold_3\": 0.32,\n        \"buy_dip_threshold_4\": 0.278,\n        \"buy_dip_threshold_5\": 0.006,\n        \"buy_dip_threshold_6\": 0.126,\n        \"buy_dip_threshold_7\": 0.146,\n        \"buy_dip_threshold_8\": 0.341,\n        \"buy_dip_threshold_10\": 0.022,\n        \"buy_dip_threshold_11\": 0.313,\n        \"buy_dip_threshold_12\": 0.29,\n        \"buy_dip_threshold_9\": 0.05,\n        \"buy_pump_pull_threshold_1\": 1.7,\n        \"buy_pump_pull_threshold_2\": 2.35,\n        \"buy_pump_threshold_1\": 0.98,\n        \"buy_pump_threshold_2\": 0.994,\n        \"buy_pump_pull_threshold_3\": 2.85,\n        \"buy_pump_pull_threshold_4\": 2.86,\n        \"buy_pump_threshold_3\": 0.442,\n        \"buy_pump_threshold_4\": 0.484,\n        \"buy_pump_pull_threshold_5\": 2.65,\n        \"buy_pump_pull_threshold_6\": 2.11,\n        \"buy_pump_threshold_5\": 0.864,\n        \"buy_pump_threshold_6\": 0.809,\n        \"buy_pump_pull_threshold_7\": 2.65,\n        \"buy_pump_pull_threshold_8\": 2.4,\n        \"buy_pump_pull_threshold_9\": 1.53,\n        \"buy_pump_threshold_7\": 0.437,\n        \"buy_pump_threshold_8\": 0.412,\n        \"buy_pump_threshold_9\": 1.264,\n        \"buy_mfi_1\": 33.4,\n        \"buy_min_inc_1\": 0.046,\n        \"buy_rsi_1\": 39.8,\n        \"buy_rsi_1h_max_1\": 85.4,\n        \"buy_rsi_1h_min_1\": 39.0,\n        \"buy_bb_offset_2\": 0.975,\n        \"buy_mfi_2\": 34.1,\n        \"buy_rsi_1h_diff_2\": 32.0,\n        \"buy_rsi_1h_max_2\": 74.7,\n        \"buy_rsi_1h_min_2\": 30.5,\n        \"buy_volume_2\": 3.2,\n        \"buy_bb40_bbdelta_close_3\": 0.028,\n        \"buy_bb40_closedelta_close_3\": 0.025,\n        \"buy_bb40_tail_bbdelta_3\": 0.442,\n        \"buy_ema_rel_3\": 0.973,\n        \"buy_bb20_close_bblowerband_4\": 0.988,\n        \"buy_bb20_volume_4\": 33,\n        \"buy_bb_offset_5\": 1.0,\n        \"buy_ema_open_mult_5\": 0.018,\n        \"buy_ema_rel_5\": 0.981,\n        \"buy_volume_5\": 3.5,\n        \"buy_bb_offset_6\": 0.998,\n        \"buy_ema_open_mult_6\": 0.03,\n        \"buy_volume_6\": 5.8,\n        \"buy_ema_open_mult_7\": 0.024,\n        \"buy_rsi_7\": 46.3,\n        \"buy_volume_7\": 7.8,\n        \"buy_ema_rel_8\": 0.997,\n        \"buy_rsi_8\": 35.5,\n        \"buy_bb_offset_9\": 0.985,\n        \"buy_ma_offset_9\": 0.978,\n        \"buy_mfi_9\": 38.7,\n        \"buy_rsi_1h_max_9\": 79.0,\n        \"buy_rsi_1h_min_9\": 31.4,\n        \"buy_volume_9\": 3.52,\n        \"buy_bb_offset_10\": 0.989,\n        \"buy_ma_offset_10\": 0.966,\n        \"buy_rsi_1h_10\": 39.5,\n        \"buy_volume_10\": 23.5,\n        \"buy_ma_offset_11\": 0.947,\n        \"buy_mfi_11\": 44.6,\n        \"buy_min_inc_11\": 0.008,\n        \"buy_rsi_11\": 32.9,\n        \"buy_rsi_1h_max_11\": 72.1,\n        \"buy_rsi_1h_min_11\": 59.2,\n        \"buy_ewo_12\": 2.2,\n        \"buy_ma_offset_12\": 0.943,\n        \"buy_rsi_12\": 30.3,\n        \"buy_volume_12\": 1.5,\n        \"buy_bb_offset_14\": 1.0,\n        \"buy_ema_open_mult_14\": 0.01,\n        \"buy_ma_offset_14\": 0.979,\n        \"buy_volume_14\": 5.9,\n        \"buy_ema_open_mult_15\": 0.023,\n        \"buy_ema_rel_15\": 0.989,\n        \"buy_ma_offset_15\": 0.959,\n        \"buy_rsi_15\": 30.5,\n        \"buy_ewo_16\": 7.3,\n        \"buy_ma_offset_16\": 0.939,\n        \"buy_rsi_16\": 46.7,\n        \"buy_volume_16\": 7.5,\n    }\n\n    sell_params = {\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        \"sell_custom_profit_0\": 0.016,\n        \"sell_custom_profit_1\": 0.044,\n        \"sell_custom_rsi_0\": 36.733,\n        \"sell_custom_rsi_1\": 45.61,\n        \"sell_custom_profit_2\": 0.036,\n        \"sell_custom_profit_3\": 0.083,\n        \"sell_custom_rsi_2\": 49.15,\n        \"sell_custom_rsi_3\": 46.41,\n        \"sell_custom_profit_4\": 0.062,\n        \"sell_custom_profit_5\": 0.045,\n        \"sell_custom_rsi_4\": 48.68,\n        \"sell_custom_rsi_5\": 49.84,\n        \"sell_custom_profit_6\": 0.047,\n        \"sell_custom_profit_7\": 0.056,\n        \"sell_custom_rsi_6\": 51.82,\n        \"sell_custom_rsi_7\": 56.54,\n        \"sell_custom_profit_8\": 0.087,\n        \"sell_custom_profit_9\": 0.071,\n        \"sell_custom_rsi_8\": 48.51,\n        \"sell_custom_rsi_9\": 58.66,\n        \"sell_custom_profit_10\": 0.11,\n        \"sell_custom_profit_11\": 0.216,\n        \"sell_custom_rsi_10\": 45.16,\n        \"sell_custom_rsi_11\": 33.15,\n        \"sell_custom_under_profit_4\": 0.03,\n        \"sell_custom_under_profit_5\": 0.08,\n        \"sell_custom_under_rsi_4\": 56.4,\n        \"sell_custom_under_rsi_5\": 54.7,\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=False, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_params_9_optimize = False\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=buy_params_9_optimize, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=buy_params_9_optimize, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=buy_params_9_optimize, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=buy_params_9_optimize, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=buy_params_9_optimize, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=buy_params_9_optimize, load=True)\n\n    buy_params_10_optimize = False\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=buy_params_10_optimize, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=buy_params_10_optimize, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=buy_params_10_optimize, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=buy_params_10_optimize, load=True)\n\n    buy_params_11_optimize = False\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=buy_params_11_optimize, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=buy_params_11_optimize, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=buy_params_11_optimize, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=buy_params_11_optimize, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=buy_params_11_optimize, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=buy_params_11_optimize, load=True)\n\n    buy_params_12_optimize = False\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=buy_params_12_optimize, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=buy_params_12_optimize, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=buy_params_12_optimize, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=buy_params_12_optimize, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_params_14_optimize = False\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=buy_params_14_optimize, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=buy_params_14_optimize, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=buy_params_14_optimize, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=buy_params_14_optimize, load=True)\n\n    buy_params_15_optimize = False\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=buy_params_15_optimize, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=buy_params_15_optimize, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=buy_params_15_optimize, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=buy_params_15_optimize, load=True)\n\n    buy_params_16_optimize = False\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=buy_params_16_optimize, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=buy_params_16_optimize, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=buy_params_16_optimize, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=buy_params_16_optimize, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_params_optimize = False\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=sell_rsi_params_optimize, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=sell_rsi_params_optimize, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=sell_rsi_params_optimize, load=True)\n\n    sell_dual_rsi_params_optimize = False\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=sell_dual_rsi_params_optimize, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=sell_dual_rsi_params_optimize, load=True)\n\n    sell_5_params_optimize = False\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=sell_5_params_optimize, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=sell_5_params_optimize, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_01_params_optimize = False\n    sell_custom_profit_23_params_optimize = False\n    sell_custom_profit_45_params_optimize = False\n    sell_custom_profit_67_params_optimize = False\n    sell_custom_profit_89_params_optimize = False\n    sell_custom_profit_1011_params_optimize = False\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=sell_custom_profit_01_params_optimize, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=sell_custom_profit_01_params_optimize, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=sell_custom_profit_01_params_optimize, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=sell_custom_profit_01_params_optimize, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=sell_custom_profit_23_params_optimize, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=sell_custom_profit_23_params_optimize, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=sell_custom_profit_23_params_optimize, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=sell_custom_profit_23_params_optimize, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=sell_custom_profit_45_params_optimize, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=sell_custom_profit_45_params_optimize, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=sell_custom_profit_45_params_optimize, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=sell_custom_profit_45_params_optimize, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=sell_custom_profit_67_params_optimize, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=sell_custom_profit_67_params_optimize, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=sell_custom_profit_67_params_optimize, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=sell_custom_profit_67_params_optimize, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=sell_custom_profit_89_params_optimize, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=sell_custom_profit_89_params_optimize, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=sell_custom_profit_89_params_optimize, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=sell_custom_profit_89_params_optimize, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=sell_custom_profit_1011_params_optimize, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=sell_custom_profit_1011_params_optimize, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=sell_custom_profit_1011_params_optimize, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=sell_custom_profit_1011_params_optimize, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_01_optimize=False\n    sell_custom_under_profit_23_optimize=False\n    sell_custom_under_profit_45_optimize=False\n    sell_custom_under_profit_67_optimize=False\n    sell_custom_under_profit_89_optimize=False\n    sell_custom_under_profit_1011_optimize=False\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=sell_custom_under_profit_01_optimize, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=sell_custom_under_profit_01_optimize, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=sell_custom_under_profit_01_optimize, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=sell_custom_under_profit_01_optimize, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=sell_custom_under_profit_23_optimize, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=sell_custom_under_profit_23_optimize, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=sell_custom_under_profit_23_optimize, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=sell_custom_under_profit_23_optimize, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=sell_custom_under_profit_45_optimize, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=sell_custom_under_profit_45_optimize, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=sell_custom_under_profit_45_optimize, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=sell_custom_under_profit_45_optimize, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=sell_custom_under_profit_67_optimize, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=sell_custom_under_profit_67_optimize, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=sell_custom_under_profit_67_optimize, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=sell_custom_under_profit_67_optimize, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=sell_custom_under_profit_89_optimize, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=sell_custom_under_profit_89_optimize, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=sell_custom_under_profit_89_optimize, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=sell_custom_under_profit_89_optimize, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=sell_custom_under_profit_1011_optimize, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=sell_custom_under_profit_1011_optimize, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=sell_custom_under_profit_1011_optimize, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=sell_custom_under_profit_1011_optimize, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_123_optimize=False\n    sell_custom_pump_profit_45_optimize=False\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=sell_custom_pump_profit_123_optimize, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=sell_custom_pump_profit_123_optimize, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=sell_custom_pump_profit_123_optimize, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=sell_custom_pump_profit_123_optimize, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=sell_custom_pump_profit_123_optimize, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=sell_custom_pump_profit_123_optimize, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=sell_custom_pump_profit_45_optimize, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=sell_custom_pump_profit_45_optimize, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=sell_custom_pump_profit_45_optimize, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=sell_custom_pump_profit_45_optimize, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=9.0, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/NFI4Frog/NFI4Frog.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom finta import TA as fta\nfrom typing import Dict, List, Optional, Tuple\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom cachetools import TTLCache\nfrom skopt.space import Dimension\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI4Frog(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -1.0\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    custom_trade_info = {}\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_dynamic_roi = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.382, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=30.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=36.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.035, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=True, load=True)\n\n    #############################################################\n\n    ## smoothed Heiken Ashi\n    def HA(self, dataframe, smoothing=None):\n        df = dataframe.copy()\n\n        df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n        df.reset_index(inplace=True)\n\n        ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n        [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n        df['HA_Open'] = ha_open\n\n        df.set_index('index', inplace=True)\n\n        df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n        df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n        if smoothing is not None:\n            sml = abs(int(smoothing))\n            if sml > 0:\n                df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n                df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n                df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n                df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n                \n        return df\n    \n    def hansen_HA(self, informative_df, period=6):\n        dataframe = informative_df.copy()\n        \n        dataframe['hhclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hhopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hhlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hhclose'], timeperiod=period) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hhopen'], timeperiod=period)\n        \n        return {'emac': dataframe['emac'], 'emao': dataframe['emao']}\n    \n    ## detect BB width expansion to indicate possible volatility\n    def bbw_expansion(self, bbw_rolling, mult=1.1):\n        bbw = list(bbw_rolling)\n\n        m = 0.0\n        for i in range(len(bbw)-1):\n            if bbw[i] > m:\n                m = bbw[i]\n\n        if (bbw[-1] > (m * mult)):\n            return 1\n        return 0\n\n    ## do_indicator style a la Obelisk strategies\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Stoch fast - mainly due to 5m timeframes\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']        \n        \n        #StochRSI for double checking things\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        # Bollinger Bands because obviously\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        # SAR Parabol - probably don't need this\n        dataframe['sar'] = ta.SAR(dataframe)\n        \n        ## confirm wideboi variance signal with bbw expansion\n        dataframe[\"bb_width\"] = ((dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"])\n        dataframe['bbw_expansion'] = dataframe['bb_width'].rolling(window=4).apply(self.bbw_expansion)\n\n        # confirm entry and exit on smoothed HA\n        dataframe = self.HA(dataframe, 4)\n\n        # thanks to Hansen_Khornelius for this idea that I apply to the 1hr informative\n        # https://github.com/hansen1015/freqtrade_strategy\n        hansencalc = self.hansen_HA(dataframe, 6)\n        dataframe['emac'] = hansencalc['emac']\n        dataframe['emao'] = hansencalc['emao']\n        \n        # money flow index (MFI) for in/outflow of money, like RSI adjusted for vol\n        dataframe['mfi'] = fta.MFI(dataframe)\n        \n        ## sqzmi to detect quiet periods\n        dataframe['sqzmi'] = fta.SQZMI(dataframe) #, MA=hansencalc['emac'])\n        \n        # Volume Flow Indicator (MFI) for volume based on the direction of price movement\n        dataframe['vfi'] = fta.VFI(dataframe, period=14)\n        \n        dmi = fta.DMI(dataframe, period=14)\n        dataframe['dmi_plus'] = dmi['DI+']\n        dataframe['dmi_minus'] = dmi['DI-']\n        dataframe['adx'] = fta.ADX(dataframe, period=14)\n        \n        ## for stoploss - all from Solipsis4\n        ## simple ATR and ROC for stoploss\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=9)        \n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\n        ssldown, sslup = SSLChannels_ATR(dataframe, length=21)\n        dataframe['sroc'] = SROC(dataframe, roclen=21, emalen=13, smooth=21)\n        dataframe['ssl-dir'] = np.where(sslup > ssldown,'up','down')        \n        dataframe['rmi-up'] = np.where(dataframe['rmi'] >= dataframe['rmi'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(5).sum() >= 3,1,0) \n        dataframe['candle-up'] = np.where(dataframe['close'] >= dataframe['close'].shift(),1,0)\n        dataframe['candle-up-trend'] = np.where(dataframe['candle-up'].rolling(5).sum() >= 3,1,0)        \n        \n        return dataframe\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        \n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n        \n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 30), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.inf_1h:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n            \n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_1h, ffill=True)\n            \n            skip_columns = [(s + \"_\" + self.inf_1h) for s in ['date', 'open', 'high', 'low', 'close', 'volume', 'emac', 'emao']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.inf_1h), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        # Slam some indicators into the trade_info dict so we can dynamic roi and custom stoploss in backtest\n        if self.dp.runmode.value in ('backtest', 'hyperopt'):\n            self.custom_trade_info[metadata['pair']]['roc'] = dataframe[['date', 'roc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['atr'] = dataframe[['date', 'atr']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['sroc'] = dataframe[['date', 'sroc']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['ssl-dir'] = dataframe[['date', 'ssl-dir']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['rmi-up-trend'] = dataframe[['date', 'rmi-up-trend']].copy().set_index('date')\n            self.custom_trade_info[metadata['pair']]['candle-up-trend'] = dataframe[['date', 'candle-up-trend']].copy().set_index('date')            \n        \n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be lower than the heiken low at 5m\n                    (dataframe['close'] < dataframe['Smooth_HA_L'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] < dataframe['emao_1h'])\n                )\n                &\n                (\n                    (\n                        ## potential uptick incoming so buy\n                        (dataframe['bbw_expansion'] == 1) & (dataframe['sqzmi'] == False)\n                        &\n                        (\n                            (dataframe['mfi'] < 20)\n                            |\n                            (dataframe['dmi_minus'] > 30)\n                        )\n                    )\n                    |\n                    (\n                        # this tries to find extra buys in undersold regions\n                        (dataframe['close'] < dataframe['sar'])\n                        &\n                        ((dataframe['srsi_d'] >= dataframe['srsi_k']) & (dataframe['srsi_d'] < 30))\n                        &\n                        ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 23))\n                        &\n                        (dataframe['mfi'] < 30)\n                    )\n                    |\n                    (\n                        # find smaller temporary dips in sideways\n                        (\n                            ((dataframe['dmi_minus'] > 30) & qtpylib.crossed_above(dataframe['dmi_minus'], dataframe['dmi_plus']))\n                            &\n                            (dataframe['close'] < dataframe['bb_lowerband'])\n                        )\n                        |\n                        (\n                            ## if nothing else is making a buy signal\n                            ## just throw in any old SQZMI shit based fastd\n                            ## this needs work!\n                            (dataframe['sqzmi'] == True)\n                            &\n                            ((dataframe['fastd'] > dataframe['fastk']) & (dataframe['fastd'] < 20))\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] < 0.0)                    \n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_5_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (((dataframe['ema_200'] - dataframe['close']) / dataframe['close']) < self.sell_ema_relative_5.value) &\n                (dataframe['rsi'] > dataframe['rsi_1h'] + self.sell_rsi_diff_5.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        dataframe.loc[\n            (\n                (\n                    ## close ALWAYS needs to be higher than the heiken high at 5m\n                    (dataframe['close'] > dataframe['Smooth_HA_H'])\n                    &\n                    ## Hansen's HA EMA at informative timeframe\n                    (dataframe['emac_1h'] > dataframe['emao_1h'])\n                )\n                &\n                (\n                    ## try to find oversold regions with a corresponding BB expansion\n                    (\n                        (dataframe['bbw_expansion'] == 1)\n                        &\n                        (\n                            (dataframe['mfi'] > 80)\n                            |\n                            (dataframe['dmi_plus'] > 30)\n                        )\n                    )\n                    ## volume sanity checks\n                    &\n                    (dataframe['vfi'] > 0.0)\n                    &\n                    (dataframe['volume'] > 0)                    \n                )\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Everything from here completely stolen from the godly work of @werkkrew\n    \n    Custom Stoploss \n    \"\"\" \n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n            sroc = dataframe['sroc'].iat[-1]\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n        else:\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\n\n        if current_profit < self.cstp_threshold.value:\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on rate of change\n                if (sroc/100) <= self.cstp_bail_roc.value:\n                    return 0.001\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\n                # Dynamic bailout based on time\n                if trade_dur > self.cstp_bail_time.value:\n                    return 0.001\n                   \n        return 1\n\n    \"\"\"\n    Freqtrade ROI Overload for dynamic ROI functionality\n    \"\"\"\n    def min_roi_reached_dynamic(self, trade: Trade, current_profit: float, current_time: datetime, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n\n        minimal_roi = self.minimal_roi\n        _, table_roi = self.min_roi_reached_entry(trade_dur)\n\n        # see if we have the data we need to do this, otherwise fall back to the standard table\n        if self.custom_trade_info and trade and trade.pair in self.custom_trade_info:\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=trade.pair, timeframe=self.timeframe)\n                rmi_trend = dataframe['rmi-up-trend'].iat[-1]\n                candle_trend = dataframe['candle-up-trend'].iat[-1]\n                ssl_dir = dataframe['ssl-dir'].iat[-1]\n            # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\n            else:\n                rmi_trend = self.custom_trade_info[trade.pair]['rmi-up-trend'].loc[current_time]['rmi-up-trend']\n                candle_trend = self.custom_trade_info[trade.pair]['candle-up-trend'].loc[current_time]['candle-up-trend']\n                ssl_dir = self.custom_trade_info[trade.pair]['ssl-dir'].loc[current_time]['ssl-dir']\n\n            min_roi = table_roi\n            max_profit = trade.calc_profit_ratio(trade.max_rate)\n            pullback_value = (max_profit - self.droi_pullback_amount.value)\n            in_trend = False\n\n            if self.droi_trend_type.value == 'rmi' or self.droi_trend_type.value == 'any':\n                if rmi_trend == 1:\n                    in_trend = True\n            if self.droi_trend_type.value == 'ssl' or self.droi_trend_type.value == 'any':\n                if ssl_dir == 'up':\n                    in_trend = True\n            if self.droi_trend_type.value == 'candle' or self.droi_trend_type.value == 'any':\n                if candle_trend == 1:\n                    in_trend = True\n\n            # Force the ROI value high if in trend\n            if (in_trend == True):\n                min_roi = 100\n                # If pullback is enabled, allow to sell if a pullback from peak has happened regardless of trend\n                if self.droi_pullback.value == True and (current_profit < pullback_value):\n                    if self.droi_pullback_respect_table.value == True:\n                        min_roi = table_roi\n                    else:\n                        min_roi = current_profit / 2\n\n        else:\n            min_roi = table_roi\n\n        return trade_dur, min_roi\n\n    # Change here to allow loading of the dynamic_roi settings\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n\n        if self.use_dynamic_roi:\n            _, roi = self.min_roi_reached_dynamic(trade, current_profit, current_time, trade_dur)\n        else:\n            _, roi = self.min_roi_reached_entry(trade_dur)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi    \n    \n    # Get the current price from the exchange (or local cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate    \n    \n    \"\"\"\n    Stripped down version from Schism, meant only to update the price data a bit\n    more frequently than the default instead of getting all sorts of trade information\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n        return trade_data\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\ndef RMI(dataframe, *, length=20, mom=5):\n    \"\"\"\n    Source: https://github.com/freqtrade/technical/blob/master/technical/indicators/indicators.py#L912\n    \"\"\"\n    df = dataframe.copy()\n\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\n\n    df.fillna(0, inplace=True)\n\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\n\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\n\n    return df[\"RMI\"]\n\ndef SSLChannels_ATR(dataframe, length=7):\n    \"\"\"\n    SSL Channels with ATR: https://www.tradingview.com/script/SKHqWzql-SSL-ATR-channel/\n    Credit to @JimmyNixx for python\n    \"\"\"\n    df = dataframe.copy()\n\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n\n    return df['sslDown'], df['sslUp']\n\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\n    df = dataframe.copy()\n\n    roc = ta.ROC(df, timeperiod=roclen)\n    ema = ta.EMA(df, timeperiod=emalen)\n    sroc = ta.ROC(ema, timeperiod=smooth)\n\n    return sroc"
  },
  {
    "path": "strategies/NFI5MOHO/NFI5MOHO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NFI5MOHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'market',\n        'trailing_stop_loss': 'market',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 36,\n        \"buy_chop_min_19\": 58.2,\n        \"buy_rsi_1h_min_19\": 65.3,\n        \"ewo_high\": 4.3,\n        \"ewo_low\": -8.5,\n        \"low_offset_ema\": 0.929,\n        \"low_offset_kama\": 0.972,\n        \"low_offset_sma\": 0.955,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.949,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.08,\n        \"60\": 0.04,\n        \"90\": 0.02,\n        \"120\": 0.01\n    }\n\n    stoploss = -0.1\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.06\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        for i in self.ma_types:\n            conditions.append(\n                (dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (dataframe['mfi'] < 27) &\n                (dataframe['close'] < dataframe['ema_20']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n            )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        \"\"\"\n\tfor i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\t\"\"\"\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 0\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NFI5MOHO2/NFI5MOHO2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NFI5MOHO2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 47,\n        \"buy_chop_min_19\": 37.4,\n        \"buy_rsi_1h_min_19\": 50.5,\n        \"ewo_high\": 3.183,\n        \"ewo_low\": -14.969,\n        \"fast_ewo\": 15,\n        \"slow_ewo\": 133,\n        \"low_offset_ema\": 0.906,\n        \"low_offset_kama\": 0.985,\n        \"low_offset_sma\": 0.9,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.964,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    buy_nb_candles_optimize = False\n    offset_sma_optimize = False\n    offset_ema_optimize = False\n    offset_trima_optimize = False\n    offset_t3_optimize = False\n    offset_kama_optimize = False\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=buy_nb_candles_optimize)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=buy_nb_candles_optimize)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_sma_optimize)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_sma_optimize)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_ema_optimize)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_ema_optimize)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_trima_optimize)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_trima_optimize)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_t3_optimize)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_t3_optimize)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_kama_optimize)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_kama_optimize)\n\n    # Protection\n    ewo_low_high_optimize = False\n    ewo_fast_slow_optimize = False\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=ewo_low_high_optimize)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=ewo_low_high_optimize)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=ewo_fast_slow_optimize)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=ewo_fast_slow_optimize)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NFI5MOHO_WIP/NFI5MOHO_WIP.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NFI5MOHO_WIP(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n\t\"\"\"\n\t\"base_nb_candles_buy\": 42,\n        \"buy_chop_min_19\": 29.3,\n        \"buy_rsi_1h_min_19\": 52.4,\n        \"ewo_high\": 5.262,\n        \"ewo_low\": -8.164,\n        \"low_offset_ema\": 0.984,\n        \"low_offset_kama\": 0.919,\n        \"low_offset_sma\": 0.97,\n        \"low_offset_t3\": 0.904,\n        \"low_offset_trima\": 0.984,\n\t\"\"\"\n\t\"base_nb_candles_buy\": 72,\n        \"buy_chop_min_19\": 58.2,\n        \"buy_rsi_1h_min_19\": 65.3,\n        \"ewo_high\": 3.319,\n        \"ewo_low\": -11.101,\n        \"low_offset_ema\": 0.929,\n        \"low_offset_kama\": 0.972,\n        \"low_offset_sma\": 0.955,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.949,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.111,\n        \"13\": 0.048,\n        \"50\": 0.015,\n        \"61\": 0.01\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        \"\"\"\n\tfor i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\t\"\"\"\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NFI5MOHO_WIP_1/NFI5MOHO_WIP_1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NFI5MOHO_WIP_1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n\t\"\"\"\n\t\"base_nb_candles_buy\": 42,\n        \"buy_chop_min_19\": 29.3,\n        \"buy_rsi_1h_min_19\": 52.4,\n        \"ewo_high\": 5.262,\n        \"ewo_low\": -8.164,\n        \"low_offset_ema\": 0.984,\n        \"low_offset_kama\": 0.919,\n        \"low_offset_sma\": 0.97,\n        \"low_offset_t3\": 0.904,\n        \"low_offset_trima\": 0.984,\n\t\"\"\"\n\t\"base_nb_candles_buy\": 72,\n        \"buy_chop_min_19\": 58.2,\n        \"buy_rsi_1h_min_19\": 65.3,\n        \"ewo_high\": 3.319,\n        \"ewo_low\": -11.101,\n        \"low_offset_ema\": 0.929,\n        \"low_offset_kama\": 0.972,\n        \"low_offset_sma\": 0.955,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.949,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    # ROI table:\n    minimal_roi = {\n         \"0\": 0.05,\n        \"10\": 0.045,\n        \"20\": 0.04,\n         \"30\": 0.035,\n        \"40\": 0.03,\n         \"50\": 0.025,\n         \"60\": 0.02,\n         \"70\": 0.015,\n         \"90\": 0.01,\n         \"120\": 0.005\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.04\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        \"\"\"\n\tfor i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\t\"\"\"\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 0\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NFI5MOHO_WIP_2/NFI5MOHO_WIP_2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NFI5MOHO_WIP_2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n\t\"\"\"\n\t\"base_nb_candles_buy\": 42,\n        \"buy_chop_min_19\": 29.3,\n        \"buy_rsi_1h_min_19\": 52.4,\n        \"ewo_high\": 5.262,\n        \"ewo_low\": -8.164,\n        \"low_offset_ema\": 0.984,\n        \"low_offset_kama\": 0.919,\n        \"low_offset_sma\": 0.97,\n        \"low_offset_t3\": 0.904,\n        \"low_offset_trima\": 0.984,\n\t\"\"\"\n\t\"base_nb_candles_buy\": 72,\n        \"buy_chop_min_19\": 58.2,\n        \"buy_rsi_1h_min_19\": 65.3,\n        \"ewo_high\": 3.319,\n        \"ewo_low\": -11.101,\n        \"low_offset_ema\": 0.929,\n        \"low_offset_kama\": 0.972,\n        \"low_offset_sma\": 0.955,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.949,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.08,\n        \"10\": 0.04,\n        \"30\": 0.02,\n        \"60\": 0.01\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=True)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=True)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.04\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=True, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=True, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        \"\"\"\n\tfor i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\t\"\"\"\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 0\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NFI731_BUSD/NFI731_BUSD.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinity by iterativ    V7.3.1 BUSD                                        ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI731_BUSD(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 7\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        2: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        3: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        4: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        5: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"130\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        6: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        7: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        8: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        9: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        10: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        11: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        12: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        13: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        14: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        15: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"130\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        16: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        17: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        18: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        19: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        20: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        21: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        22: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        23: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        24: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        25: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        26: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        27: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        28: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        29: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        30: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        31: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        32: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        33: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        34: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        34: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        35: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        36: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        37: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        38: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        }\n    }\n\n    buy_condition_1_enable = buy_protection_params[1][\"enable\"]\n    buy_1_protection__ema_fast                 = buy_protection_params[1][\"ema_fast\"]\n    buy_1_protection__ema_fast_len             = buy_protection_params[1][\"ema_fast_len\"]\n    buy_1_protection__ema_slow                 = buy_protection_params[1][\"ema_slow\"]\n    buy_1_protection__ema_slow_len             = buy_protection_params[1][\"ema_slow_len\"]\n    buy_1_protection__close_above_ema_fast     = buy_protection_params[1][\"close_above_ema_fast\"]\n    buy_1_protection__close_above_ema_fast_len = buy_protection_params[1][\"close_above_ema_fast_len\"]\n    buy_1_protection__close_above_ema_slow     = buy_protection_params[1][\"close_above_ema_slow\"]\n    buy_1_protection__close_above_ema_slow_len = buy_protection_params[1][\"close_above_ema_slow_len\"]\n    buy_1_protection__sma200_rising            = buy_protection_params[1][\"sma200_rising\"]\n    buy_1_protection__sma200_rising_val        = buy_protection_params[1][\"sma200_rising_val\"]\n    buy_1_protection__sma200_1h_rising         = buy_protection_params[1][\"sma200_1h_rising\"]\n    buy_1_protection__sma200_1h_rising_val     = buy_protection_params[1][\"sma200_1h_rising_val\"]\n    buy_1_protection__safe_dips                = buy_protection_params[1][\"safe_dips\"]\n    buy_1_protection__safe_dips_type           = buy_protection_params[1][\"safe_dips_type\"]\n    buy_1_protection__safe_pump                = buy_protection_params[1][\"safe_pump\"]\n    buy_1_protection__safe_pump_type           = buy_protection_params[1][\"safe_pump_type\"]\n    buy_1_protection__safe_pump_period         = buy_protection_params[1][\"safe_pump_period\"]\n    buy_1_protection__btc_1h_not_downtrend     = buy_protection_params[1][\"btc_1h_not_downtrend\"]\n\n    buy_condition_2_enable = buy_protection_params[2][\"enable\"]\n    buy_2_protection__ema_fast                 = buy_protection_params[2][\"ema_fast\"]\n    buy_2_protection__ema_fast_len             = buy_protection_params[2][\"ema_fast_len\"]\n    buy_2_protection__ema_slow                 = buy_protection_params[2][\"ema_slow\"]\n    buy_2_protection__ema_slow_len             = buy_protection_params[2][\"ema_slow_len\"]\n    buy_2_protection__close_above_ema_fast     = buy_protection_params[2][\"close_above_ema_fast\"]\n    buy_2_protection__close_above_ema_fast_len = buy_protection_params[2][\"close_above_ema_fast_len\"]\n    buy_2_protection__close_above_ema_slow     = buy_protection_params[2][\"close_above_ema_slow\"]\n    buy_2_protection__close_above_ema_slow_len = buy_protection_params[2][\"close_above_ema_slow_len\"]\n    buy_2_protection__sma200_rising            = buy_protection_params[2][\"sma200_rising\"]\n    buy_2_protection__sma200_rising_val        = buy_protection_params[2][\"sma200_rising_val\"]\n    buy_2_protection__sma200_1h_rising         = buy_protection_params[2][\"sma200_1h_rising\"]\n    buy_2_protection__sma200_1h_rising_val     = buy_protection_params[2][\"sma200_1h_rising_val\"]\n    buy_2_protection__safe_dips                = buy_protection_params[2][\"safe_dips\"]\n    buy_2_protection__safe_dips_type           = buy_protection_params[2][\"safe_dips_type\"]\n    buy_2_protection__safe_pump                = buy_protection_params[2][\"safe_pump\"]\n    buy_2_protection__safe_pump_type           = buy_protection_params[2][\"safe_pump_type\"]\n    buy_2_protection__safe_pump_period         = buy_protection_params[2][\"safe_pump_period\"]\n    buy_2_protection__btc_1h_not_downtrend     = buy_protection_params[2][\"btc_1h_not_downtrend\"]\n\n    buy_condition_3_enable = buy_protection_params[3][\"enable\"]\n    buy_3_protection__ema_fast                 = buy_protection_params[3][\"ema_fast\"]\n    buy_3_protection__ema_fast_len             = buy_protection_params[3][\"ema_fast_len\"]\n    buy_3_protection__ema_slow                 = buy_protection_params[3][\"ema_slow\"]\n    buy_3_protection__ema_slow_len             = buy_protection_params[3][\"ema_slow_len\"]\n    buy_3_protection__close_above_ema_fast     = buy_protection_params[3][\"close_above_ema_fast\"]\n    buy_3_protection__close_above_ema_fast_len = buy_protection_params[3][\"close_above_ema_fast_len\"]\n    buy_3_protection__close_above_ema_slow     = buy_protection_params[3][\"close_above_ema_slow\"]\n    buy_3_protection__close_above_ema_slow_len = buy_protection_params[3][\"close_above_ema_slow_len\"]\n    buy_3_protection__sma200_rising            = buy_protection_params[3][\"sma200_rising\"]\n    buy_3_protection__sma200_rising_val        = buy_protection_params[3][\"sma200_rising_val\"]\n    buy_3_protection__sma200_1h_rising         = buy_protection_params[3][\"sma200_1h_rising\"]\n    buy_3_protection__sma200_1h_rising_val     = buy_protection_params[3][\"sma200_1h_rising_val\"]\n    buy_3_protection__safe_dips                = buy_protection_params[3][\"safe_dips\"]\n    buy_3_protection__safe_dips_type           = buy_protection_params[3][\"safe_dips_type\"]\n    buy_3_protection__safe_pump                = buy_protection_params[3][\"safe_pump\"]\n    buy_3_protection__safe_pump_type           = buy_protection_params[3][\"safe_pump_type\"]\n    buy_3_protection__safe_pump_period         = buy_protection_params[3][\"safe_pump_period\"]\n    buy_3_protection__btc_1h_not_downtrend     = buy_protection_params[3][\"btc_1h_not_downtrend\"]\n\n    buy_condition_4_enable = buy_protection_params[4][\"enable\"]\n    buy_4_protection__ema_fast                 = buy_protection_params[4][\"ema_fast\"]\n    buy_4_protection__ema_fast_len             = buy_protection_params[4][\"ema_fast_len\"]\n    buy_4_protection__ema_slow                 = buy_protection_params[4][\"ema_slow\"]\n    buy_4_protection__ema_slow_len             = buy_protection_params[4][\"ema_slow_len\"]\n    buy_4_protection__close_above_ema_fast     = buy_protection_params[4][\"close_above_ema_fast\"]\n    buy_4_protection__close_above_ema_fast_len = buy_protection_params[4][\"close_above_ema_fast_len\"]\n    buy_4_protection__close_above_ema_slow     = buy_protection_params[4][\"close_above_ema_slow\"]\n    buy_4_protection__close_above_ema_slow_len = buy_protection_params[4][\"close_above_ema_slow_len\"]\n    buy_4_protection__sma200_rising            = buy_protection_params[4][\"sma200_rising\"]\n    buy_4_protection__sma200_rising_val        = buy_protection_params[4][\"sma200_rising_val\"]\n    buy_4_protection__sma200_1h_rising         = buy_protection_params[4][\"sma200_1h_rising\"]\n    buy_4_protection__sma200_1h_rising_val     = buy_protection_params[4][\"sma200_1h_rising_val\"]\n    buy_4_protection__safe_dips                = buy_protection_params[4][\"safe_dips\"]\n    buy_4_protection__safe_dips_type           = buy_protection_params[4][\"safe_dips_type\"]\n    buy_4_protection__safe_pump                = buy_protection_params[4][\"safe_pump\"]\n    buy_4_protection__safe_pump_type           = buy_protection_params[4][\"safe_pump_type\"]\n    buy_4_protection__safe_pump_period         = buy_protection_params[4][\"safe_pump_period\"]\n    buy_4_protection__btc_1h_not_downtrend     = buy_protection_params[4][\"btc_1h_not_downtrend\"]\n\n    buy_condition_5_enable = buy_protection_params[5][\"enable\"]\n    buy_5_protection__ema_fast                 = buy_protection_params[5][\"ema_fast\"]\n    buy_5_protection__ema_fast_len             = buy_protection_params[5][\"ema_fast_len\"]\n    buy_5_protection__ema_slow                 = buy_protection_params[5][\"ema_slow\"]\n    buy_5_protection__ema_slow_len             = buy_protection_params[5][\"ema_slow_len\"]\n    buy_5_protection__close_above_ema_fast     = buy_protection_params[5][\"close_above_ema_fast\"]\n    buy_5_protection__close_above_ema_fast_len = buy_protection_params[5][\"close_above_ema_fast_len\"]\n    buy_5_protection__close_above_ema_slow     = buy_protection_params[5][\"close_above_ema_slow\"]\n    buy_5_protection__close_above_ema_slow_len = buy_protection_params[5][\"close_above_ema_slow_len\"]\n    buy_5_protection__sma200_rising            = buy_protection_params[5][\"sma200_rising\"]\n    buy_5_protection__sma200_rising_val        = buy_protection_params[5][\"sma200_rising_val\"]\n    buy_5_protection__sma200_1h_rising         = buy_protection_params[5][\"sma200_1h_rising\"]\n    buy_5_protection__sma200_1h_rising_val     = buy_protection_params[5][\"sma200_1h_rising_val\"]\n    buy_5_protection__safe_dips                = buy_protection_params[5][\"safe_dips\"]\n    buy_5_protection__safe_dips_type           = buy_protection_params[5][\"safe_dips_type\"]\n    buy_5_protection__safe_pump                = buy_protection_params[5][\"safe_pump\"]\n    buy_5_protection__safe_pump_type           = buy_protection_params[5][\"safe_pump_type\"]\n    buy_5_protection__safe_pump_period         = buy_protection_params[5][\"safe_pump_period\"]\n    buy_5_protection__btc_1h_not_downtrend     = buy_protection_params[5][\"btc_1h_not_downtrend\"]\n\n    buy_condition_6_enable = buy_protection_params[6][\"enable\"]\n    buy_6_protection__ema_fast                 = buy_protection_params[6][\"ema_fast\"]\n    buy_6_protection__ema_fast_len             = buy_protection_params[6][\"ema_fast_len\"]\n    buy_6_protection__ema_slow                 = buy_protection_params[6][\"ema_slow\"]\n    buy_6_protection__ema_slow_len             = buy_protection_params[6][\"ema_slow_len\"]\n    buy_6_protection__close_above_ema_fast     = buy_protection_params[6][\"close_above_ema_fast\"]\n    buy_6_protection__close_above_ema_fast_len = buy_protection_params[6][\"close_above_ema_fast_len\"]\n    buy_6_protection__close_above_ema_slow     = buy_protection_params[6][\"close_above_ema_slow\"]\n    buy_6_protection__close_above_ema_slow_len = buy_protection_params[6][\"close_above_ema_slow_len\"]\n    buy_6_protection__sma200_rising            = buy_protection_params[6][\"sma200_rising\"]\n    buy_6_protection__sma200_rising_val        = buy_protection_params[6][\"sma200_rising_val\"]\n    buy_6_protection__sma200_1h_rising         = buy_protection_params[6][\"sma200_1h_rising\"]\n    buy_6_protection__sma200_1h_rising_val     = buy_protection_params[6][\"sma200_1h_rising_val\"]\n    buy_6_protection__safe_dips                = buy_protection_params[6][\"safe_dips\"]\n    buy_6_protection__safe_dips_type           = buy_protection_params[6][\"safe_dips_type\"]\n    buy_6_protection__safe_pump                = buy_protection_params[6][\"safe_pump\"]\n    buy_6_protection__safe_pump_type           = buy_protection_params[6][\"safe_pump_type\"]\n    buy_6_protection__safe_pump_period         = buy_protection_params[6][\"safe_pump_period\"]\n    buy_6_protection__btc_1h_not_downtrend     = buy_protection_params[6][\"btc_1h_not_downtrend\"]\n\n    buy_condition_7_enable = buy_protection_params[7][\"enable\"]\n    buy_7_protection__ema_fast                 = buy_protection_params[7][\"ema_fast\"]\n    buy_7_protection__ema_fast_len             = buy_protection_params[7][\"ema_fast_len\"]\n    buy_7_protection__ema_slow                 = buy_protection_params[7][\"ema_slow\"]\n    buy_7_protection__ema_slow_len             = buy_protection_params[7][\"ema_slow_len\"]\n    buy_7_protection__close_above_ema_fast     = buy_protection_params[7][\"close_above_ema_fast\"]\n    buy_7_protection__close_above_ema_fast_len = buy_protection_params[7][\"close_above_ema_fast_len\"]\n    buy_7_protection__close_above_ema_slow     = buy_protection_params[7][\"close_above_ema_slow\"]\n    buy_7_protection__close_above_ema_slow_len = buy_protection_params[7][\"close_above_ema_slow_len\"]\n    buy_7_protection__sma200_rising            = buy_protection_params[7][\"sma200_rising\"]\n    buy_7_protection__sma200_rising_val        = buy_protection_params[7][\"sma200_rising_val\"]\n    buy_7_protection__sma200_1h_rising         = buy_protection_params[7][\"sma200_1h_rising\"]\n    buy_7_protection__sma200_1h_rising_val     = buy_protection_params[7][\"sma200_1h_rising_val\"]\n    buy_7_protection__safe_dips                = buy_protection_params[7][\"safe_dips\"]\n    buy_7_protection__safe_dips_type           = buy_protection_params[7][\"safe_dips_type\"]\n    buy_7_protection__safe_pump                = buy_protection_params[7][\"safe_pump\"]\n    buy_7_protection__safe_pump_type           = buy_protection_params[7][\"safe_pump_type\"]\n    buy_7_protection__safe_pump_period         = buy_protection_params[7][\"safe_pump_period\"]\n    buy_7_protection__btc_1h_not_downtrend     = buy_protection_params[7][\"btc_1h_not_downtrend\"]\n\n    buy_condition_8_enable = buy_protection_params[8][\"enable\"]\n    buy_8_protection__ema_fast                 = buy_protection_params[8][\"ema_fast\"]\n    buy_8_protection__ema_fast_len             = buy_protection_params[8][\"ema_fast_len\"]\n    buy_8_protection__ema_slow                 = buy_protection_params[8][\"ema_slow\"]\n    buy_8_protection__ema_slow_len             = buy_protection_params[8][\"ema_slow_len\"]\n    buy_8_protection__close_above_ema_fast     = buy_protection_params[8][\"close_above_ema_fast\"]\n    buy_8_protection__close_above_ema_fast_len = buy_protection_params[8][\"close_above_ema_fast_len\"]\n    buy_8_protection__close_above_ema_slow     = buy_protection_params[8][\"close_above_ema_slow\"]\n    buy_8_protection__close_above_ema_slow_len = buy_protection_params[8][\"close_above_ema_slow_len\"]\n    buy_8_protection__sma200_rising            = buy_protection_params[8][\"sma200_rising\"]\n    buy_8_protection__sma200_rising_val        = buy_protection_params[8][\"sma200_rising_val\"]\n    buy_8_protection__sma200_1h_rising         = buy_protection_params[8][\"sma200_1h_rising\"]\n    buy_8_protection__sma200_1h_rising_val     = buy_protection_params[8][\"sma200_1h_rising_val\"]\n    buy_8_protection__safe_dips                = buy_protection_params[8][\"safe_dips\"]\n    buy_8_protection__safe_dips_type           = buy_protection_params[8][\"safe_dips_type\"]\n    buy_8_protection__safe_pump                = buy_protection_params[8][\"safe_pump\"]\n    buy_8_protection__safe_pump_type           = buy_protection_params[8][\"safe_pump_type\"]\n    buy_8_protection__safe_pump_period         = buy_protection_params[8][\"safe_pump_period\"]\n    buy_8_protection__btc_1h_not_downtrend     = buy_protection_params[8][\"btc_1h_not_downtrend\"]\n\n    buy_condition_9_enable = buy_protection_params[9][\"enable\"]\n    buy_9_protection__ema_fast                 = buy_protection_params[9][\"ema_fast\"]\n    buy_9_protection__ema_fast_len             = buy_protection_params[9][\"ema_fast_len\"]\n    buy_9_protection__ema_slow                 = buy_protection_params[9][\"ema_slow\"]\n    buy_9_protection__ema_slow_len             = buy_protection_params[9][\"ema_slow_len\"]\n    buy_9_protection__close_above_ema_fast     = buy_protection_params[9][\"close_above_ema_fast\"]\n    buy_9_protection__close_above_ema_fast_len = buy_protection_params[9][\"close_above_ema_fast_len\"]\n    buy_9_protection__close_above_ema_slow     = buy_protection_params[9][\"close_above_ema_slow\"]\n    buy_9_protection__close_above_ema_slow_len = buy_protection_params[9][\"close_above_ema_slow_len\"]\n    buy_9_protection__sma200_rising            = buy_protection_params[9][\"sma200_rising\"]\n    buy_9_protection__sma200_rising_val        = buy_protection_params[9][\"sma200_rising_val\"]\n    buy_9_protection__sma200_1h_rising         = buy_protection_params[9][\"sma200_1h_rising\"]\n    buy_9_protection__sma200_1h_rising_val     = buy_protection_params[9][\"sma200_1h_rising_val\"]\n    buy_9_protection__safe_dips                = buy_protection_params[9][\"safe_dips\"]\n    buy_9_protection__safe_dips_type           = buy_protection_params[9][\"safe_dips_type\"]\n    buy_9_protection__safe_pump                = buy_protection_params[9][\"safe_pump\"]\n    buy_9_protection__safe_pump_type           = buy_protection_params[9][\"safe_pump_type\"]\n    buy_9_protection__safe_pump_period         = buy_protection_params[9][\"safe_pump_period\"]\n    buy_9_protection__btc_1h_not_downtrend     = buy_protection_params[9][\"btc_1h_not_downtrend\"]\n\n    buy_condition_10_enable = buy_protection_params[10][\"enable\"]\n    buy_10_protection__ema_fast                 = buy_protection_params[10][\"ema_fast\"]\n    buy_10_protection__ema_fast_len             = buy_protection_params[10][\"ema_fast_len\"]\n    buy_10_protection__ema_slow                 = buy_protection_params[10][\"ema_slow\"]\n    buy_10_protection__ema_slow_len             = buy_protection_params[10][\"ema_slow_len\"]\n    buy_10_protection__close_above_ema_fast     = buy_protection_params[10][\"close_above_ema_fast\"]\n    buy_10_protection__close_above_ema_fast_len = buy_protection_params[10][\"close_above_ema_fast_len\"]\n    buy_10_protection__close_above_ema_slow     = buy_protection_params[10][\"close_above_ema_slow\"]\n    buy_10_protection__close_above_ema_slow_len = buy_protection_params[10][\"close_above_ema_slow_len\"]\n    buy_10_protection__sma200_rising            = buy_protection_params[10][\"sma200_rising\"]\n    buy_10_protection__sma200_rising_val        = buy_protection_params[10][\"sma200_rising_val\"]\n    buy_10_protection__sma200_1h_rising         = buy_protection_params[10][\"sma200_1h_rising\"]\n    buy_10_protection__sma200_1h_rising_val     = buy_protection_params[10][\"sma200_1h_rising_val\"]\n    buy_10_protection__safe_dips                = buy_protection_params[10][\"safe_dips\"]\n    buy_10_protection__safe_dips_type           = buy_protection_params[10][\"safe_dips_type\"]\n    buy_10_protection__safe_pump                = buy_protection_params[10][\"safe_pump\"]\n    buy_10_protection__safe_pump_type           = buy_protection_params[10][\"safe_pump_type\"]\n    buy_10_protection__safe_pump_period         = buy_protection_params[10][\"safe_pump_period\"]\n    buy_10_protection__btc_1h_not_downtrend     = buy_protection_params[10][\"btc_1h_not_downtrend\"]\n\n    buy_condition_11_enable = buy_protection_params[11][\"enable\"]\n    buy_11_protection__ema_fast                 = buy_protection_params[11][\"ema_fast\"]\n    buy_11_protection__ema_fast_len             = buy_protection_params[11][\"ema_fast_len\"]\n    buy_11_protection__ema_slow                 = buy_protection_params[11][\"ema_slow\"]\n    buy_11_protection__ema_slow_len             = buy_protection_params[11][\"ema_slow_len\"]\n    buy_11_protection__close_above_ema_fast     = buy_protection_params[11][\"close_above_ema_fast\"]\n    buy_11_protection__close_above_ema_fast_len = buy_protection_params[11][\"close_above_ema_fast_len\"]\n    buy_11_protection__close_above_ema_slow     = buy_protection_params[11][\"close_above_ema_slow\"]\n    buy_11_protection__close_above_ema_slow_len = buy_protection_params[11][\"close_above_ema_slow_len\"]\n    buy_11_protection__sma200_rising            = buy_protection_params[11][\"sma200_rising\"]\n    buy_11_protection__sma200_rising_val        = buy_protection_params[11][\"sma200_rising_val\"]\n    buy_11_protection__sma200_1h_rising         = buy_protection_params[11][\"sma200_1h_rising\"]\n    buy_11_protection__sma200_1h_rising_val     = buy_protection_params[11][\"sma200_1h_rising_val\"]\n    buy_11_protection__safe_dips                = buy_protection_params[11][\"safe_dips\"]\n    buy_11_protection__safe_dips_type           = buy_protection_params[11][\"safe_dips_type\"]\n    buy_11_protection__safe_pump                = buy_protection_params[11][\"safe_pump\"]\n    buy_11_protection__safe_pump_type           = buy_protection_params[11][\"safe_pump_type\"]\n    buy_11_protection__safe_pump_period         = buy_protection_params[11][\"safe_pump_period\"]\n    buy_11_protection__btc_1h_not_downtrend     = buy_protection_params[11][\"btc_1h_not_downtrend\"]\n\n    buy_condition_12_enable = buy_protection_params[12][\"enable\"]\n    buy_12_protection__ema_fast                 = buy_protection_params[12][\"ema_fast\"]\n    buy_12_protection__ema_fast_len             = buy_protection_params[12][\"ema_fast_len\"]\n    buy_12_protection__ema_slow                 = buy_protection_params[12][\"ema_slow\"]\n    buy_12_protection__ema_slow_len             = buy_protection_params[12][\"ema_slow_len\"]\n    buy_12_protection__close_above_ema_fast     = buy_protection_params[12][\"close_above_ema_fast\"]\n    buy_12_protection__close_above_ema_fast_len = buy_protection_params[12][\"close_above_ema_fast_len\"]\n    buy_12_protection__close_above_ema_slow     = buy_protection_params[12][\"close_above_ema_slow\"]\n    buy_12_protection__close_above_ema_slow_len = buy_protection_params[12][\"close_above_ema_slow_len\"]\n    buy_12_protection__sma200_rising            = buy_protection_params[12][\"sma200_rising\"]\n    buy_12_protection__sma200_rising_val        = buy_protection_params[12][\"sma200_rising_val\"]\n    buy_12_protection__sma200_1h_rising         = buy_protection_params[12][\"sma200_1h_rising\"]\n    buy_12_protection__sma200_1h_rising_val     = buy_protection_params[12][\"sma200_1h_rising_val\"]\n    buy_12_protection__safe_dips                = buy_protection_params[12][\"safe_dips\"]\n    buy_12_protection__safe_dips_type           = buy_protection_params[12][\"safe_dips_type\"]\n    buy_12_protection__safe_pump                = buy_protection_params[12][\"safe_pump\"]\n    buy_12_protection__safe_pump_type           = buy_protection_params[12][\"safe_pump_type\"]\n    buy_12_protection__safe_pump_period         = buy_protection_params[12][\"safe_pump_period\"]\n    buy_12_protection__btc_1h_not_downtrend     = buy_protection_params[12][\"btc_1h_not_downtrend\"]\n\n    buy_condition_13_enable = buy_protection_params[13][\"enable\"]\n    buy_13_protection__ema_fast                 = buy_protection_params[13][\"ema_fast\"]\n    buy_13_protection__ema_fast_len             = buy_protection_params[13][\"ema_fast_len\"]\n    buy_13_protection__ema_slow                 = buy_protection_params[13][\"ema_slow\"]\n    buy_13_protection__ema_slow_len             = buy_protection_params[13][\"ema_slow_len\"]\n    buy_13_protection__close_above_ema_fast     = buy_protection_params[13][\"close_above_ema_fast\"]\n    buy_13_protection__close_above_ema_fast_len = buy_protection_params[13][\"close_above_ema_fast_len\"]\n    buy_13_protection__close_above_ema_slow     = buy_protection_params[13][\"close_above_ema_slow\"]\n    buy_13_protection__close_above_ema_slow_len = buy_protection_params[13][\"close_above_ema_slow_len\"]\n    buy_13_protection__sma200_rising            = buy_protection_params[13][\"sma200_rising\"]\n    buy_13_protection__sma200_rising_val        = buy_protection_params[13][\"sma200_rising_val\"]\n    buy_13_protection__sma200_1h_rising         = buy_protection_params[13][\"sma200_1h_rising\"]\n    buy_13_protection__sma200_1h_rising_val     = buy_protection_params[13][\"sma200_1h_rising_val\"]\n    buy_13_protection__safe_dips                = buy_protection_params[13][\"safe_dips\"]\n    buy_13_protection__safe_dips_type           = buy_protection_params[13][\"safe_dips_type\"]\n    buy_13_protection__safe_pump                = buy_protection_params[13][\"safe_pump\"]\n    buy_13_protection__safe_pump_type           = buy_protection_params[13][\"safe_pump_type\"]\n    buy_13_protection__safe_pump_period         = buy_protection_params[13][\"safe_pump_period\"]\n    buy_13_protection__btc_1h_not_downtrend     = buy_protection_params[13][\"btc_1h_not_downtrend\"]\n\n    buy_condition_14_enable = buy_protection_params[14][\"enable\"]\n    buy_14_protection__ema_fast                 = buy_protection_params[14][\"ema_fast\"]\n    buy_14_protection__ema_fast_len             = buy_protection_params[14][\"ema_fast_len\"]\n    buy_14_protection__ema_slow                 = buy_protection_params[14][\"ema_slow\"]\n    buy_14_protection__ema_slow_len             = buy_protection_params[14][\"ema_slow_len\"]\n    buy_14_protection__close_above_ema_fast     = buy_protection_params[14][\"close_above_ema_fast\"]\n    buy_14_protection__close_above_ema_fast_len = buy_protection_params[14][\"close_above_ema_fast_len\"]\n    buy_14_protection__close_above_ema_slow     = buy_protection_params[14][\"close_above_ema_slow\"]\n    buy_14_protection__close_above_ema_slow_len = buy_protection_params[14][\"close_above_ema_slow_len\"]\n    buy_14_protection__sma200_rising            = buy_protection_params[14][\"sma200_rising\"]\n    buy_14_protection__sma200_rising_val        = buy_protection_params[14][\"sma200_rising_val\"]\n    buy_14_protection__sma200_1h_rising         = buy_protection_params[14][\"sma200_1h_rising\"]\n    buy_14_protection__sma200_1h_rising_val     = buy_protection_params[14][\"sma200_1h_rising_val\"]\n    buy_14_protection__safe_dips                = buy_protection_params[14][\"safe_dips\"]\n    buy_14_protection__safe_dips_type           = buy_protection_params[14][\"safe_dips_type\"]\n    buy_14_protection__safe_pump                = buy_protection_params[14][\"safe_pump\"]\n    buy_14_protection__safe_pump_type           = buy_protection_params[14][\"safe_pump_type\"]\n    buy_14_protection__safe_pump_period         = buy_protection_params[14][\"safe_pump_period\"]\n    buy_14_protection__btc_1h_not_downtrend     = buy_protection_params[14][\"btc_1h_not_downtrend\"]\n\n    buy_condition_15_enable = buy_protection_params[15][\"enable\"]\n    buy_15_protection__ema_fast                 = buy_protection_params[15][\"ema_fast\"]\n    buy_15_protection__ema_fast_len             = buy_protection_params[15][\"ema_fast_len\"]\n    buy_15_protection__ema_slow                 = buy_protection_params[15][\"ema_slow\"]\n    buy_15_protection__ema_slow_len             = buy_protection_params[15][\"ema_slow_len\"]\n    buy_15_protection__close_above_ema_fast     = buy_protection_params[15][\"close_above_ema_fast\"]\n    buy_15_protection__close_above_ema_fast_len = buy_protection_params[15][\"close_above_ema_fast_len\"]\n    buy_15_protection__close_above_ema_slow     = buy_protection_params[15][\"close_above_ema_slow\"]\n    buy_15_protection__close_above_ema_slow_len = buy_protection_params[15][\"close_above_ema_slow_len\"]\n    buy_15_protection__sma200_rising            = buy_protection_params[15][\"sma200_rising\"]\n    buy_15_protection__sma200_rising_val        = buy_protection_params[15][\"sma200_rising_val\"]\n    buy_15_protection__sma200_1h_rising         = buy_protection_params[15][\"sma200_1h_rising\"]\n    buy_15_protection__sma200_1h_rising_val     = buy_protection_params[15][\"sma200_1h_rising_val\"]\n    buy_15_protection__safe_dips                = buy_protection_params[15][\"safe_dips\"]\n    buy_15_protection__safe_dips_type           = buy_protection_params[15][\"safe_dips_type\"]\n    buy_15_protection__safe_pump                = buy_protection_params[15][\"safe_pump\"]\n    buy_15_protection__safe_pump_type           = buy_protection_params[15][\"safe_pump_type\"]\n    buy_15_protection__safe_pump_period         = buy_protection_params[15][\"safe_pump_period\"]\n    buy_15_protection__btc_1h_not_downtrend     = buy_protection_params[15][\"btc_1h_not_downtrend\"]\n\n    buy_condition_16_enable = buy_protection_params[16][\"enable\"]\n    buy_16_protection__ema_fast                 = buy_protection_params[16][\"ema_fast\"]\n    buy_16_protection__ema_fast_len             = buy_protection_params[16][\"ema_fast_len\"]\n    buy_16_protection__ema_slow                 = buy_protection_params[16][\"ema_slow\"]\n    buy_16_protection__ema_slow_len             = buy_protection_params[16][\"ema_slow_len\"]\n    buy_16_protection__close_above_ema_fast     = buy_protection_params[16][\"close_above_ema_fast\"]\n    buy_16_protection__close_above_ema_fast_len = buy_protection_params[16][\"close_above_ema_fast_len\"]\n    buy_16_protection__close_above_ema_slow     = buy_protection_params[16][\"close_above_ema_slow\"]\n    buy_16_protection__close_above_ema_slow_len = buy_protection_params[16][\"close_above_ema_slow_len\"]\n    buy_16_protection__sma200_rising            = buy_protection_params[16][\"sma200_rising\"]\n    buy_16_protection__sma200_rising_val        = buy_protection_params[16][\"sma200_rising_val\"]\n    buy_16_protection__sma200_1h_rising         = buy_protection_params[16][\"sma200_1h_rising\"]\n    buy_16_protection__sma200_1h_rising_val     = buy_protection_params[16][\"sma200_1h_rising_val\"]\n    buy_16_protection__safe_dips                = buy_protection_params[16][\"safe_dips\"]\n    buy_16_protection__safe_dips_type           = buy_protection_params[16][\"safe_dips_type\"]\n    buy_16_protection__safe_pump                = buy_protection_params[16][\"safe_pump\"]\n    buy_16_protection__safe_pump_type           = buy_protection_params[16][\"safe_pump_type\"]\n    buy_16_protection__safe_pump_period         = buy_protection_params[16][\"safe_pump_period\"]\n    buy_16_protection__btc_1h_not_downtrend     = buy_protection_params[16][\"btc_1h_not_downtrend\"]\n\n    buy_condition_17_enable = buy_protection_params[17][\"enable\"]\n    buy_17_protection__ema_fast                 = buy_protection_params[17][\"ema_fast\"]\n    buy_17_protection__ema_fast_len             = buy_protection_params[17][\"ema_fast_len\"]\n    buy_17_protection__ema_slow                 = buy_protection_params[17][\"ema_slow\"]\n    buy_17_protection__ema_slow_len             = buy_protection_params[17][\"ema_slow_len\"]\n    buy_17_protection__close_above_ema_fast     = buy_protection_params[17][\"close_above_ema_fast\"]\n    buy_17_protection__close_above_ema_fast_len = buy_protection_params[17][\"close_above_ema_fast_len\"]\n    buy_17_protection__close_above_ema_slow     = buy_protection_params[17][\"close_above_ema_slow\"]\n    buy_17_protection__close_above_ema_slow_len = buy_protection_params[17][\"close_above_ema_slow_len\"]\n    buy_17_protection__sma200_rising            = buy_protection_params[17][\"sma200_rising\"]\n    buy_17_protection__sma200_rising_val        = buy_protection_params[17][\"sma200_rising_val\"]\n    buy_17_protection__sma200_1h_rising         = buy_protection_params[17][\"sma200_1h_rising\"]\n    buy_17_protection__sma200_1h_rising_val     = buy_protection_params[17][\"sma200_1h_rising_val\"]\n    buy_17_protection__safe_dips                = buy_protection_params[17][\"safe_dips\"]\n    buy_17_protection__safe_dips_type           = buy_protection_params[17][\"safe_dips_type\"]\n    buy_17_protection__safe_pump                = buy_protection_params[17][\"safe_pump\"]\n    buy_17_protection__safe_pump_type           = buy_protection_params[17][\"safe_pump_type\"]\n    buy_17_protection__safe_pump_period         = buy_protection_params[17][\"safe_pump_period\"]\n    buy_17_protection__btc_1h_not_downtrend     = buy_protection_params[17][\"btc_1h_not_downtrend\"]\n\n    buy_condition_18_enable = buy_protection_params[18][\"enable\"]\n    buy_18_protection__ema_fast                 = buy_protection_params[18][\"ema_fast\"]\n    buy_18_protection__ema_fast_len             = buy_protection_params[18][\"ema_fast_len\"]\n    buy_18_protection__ema_slow                 = buy_protection_params[18][\"ema_slow\"]\n    buy_18_protection__ema_slow_len             = buy_protection_params[18][\"ema_slow_len\"]\n    buy_18_protection__close_above_ema_fast     = buy_protection_params[18][\"close_above_ema_fast\"]\n    buy_18_protection__close_above_ema_fast_len = buy_protection_params[18][\"close_above_ema_fast_len\"]\n    buy_18_protection__close_above_ema_slow     = buy_protection_params[18][\"close_above_ema_slow\"]\n    buy_18_protection__close_above_ema_slow_len = buy_protection_params[18][\"close_above_ema_slow_len\"]\n    buy_18_protection__sma200_rising            = buy_protection_params[18][\"sma200_rising\"]\n    buy_18_protection__sma200_rising_val        = buy_protection_params[18][\"sma200_rising_val\"]\n    buy_18_protection__sma200_1h_rising         = buy_protection_params[18][\"sma200_1h_rising\"]\n    buy_18_protection__sma200_1h_rising_val     = buy_protection_params[18][\"sma200_1h_rising_val\"]\n    buy_18_protection__safe_dips                = buy_protection_params[18][\"safe_dips\"]\n    buy_18_protection__safe_dips_type           = buy_protection_params[18][\"safe_dips_type\"]\n    buy_18_protection__safe_pump                = buy_protection_params[18][\"safe_pump\"]\n    buy_18_protection__safe_pump_type           = buy_protection_params[18][\"safe_pump_type\"]\n    buy_18_protection__safe_pump_period         = buy_protection_params[18][\"safe_pump_period\"]\n    buy_18_protection__btc_1h_not_downtrend     = buy_protection_params[18][\"btc_1h_not_downtrend\"]\n\n    buy_condition_19_enable = buy_protection_params[19][\"enable\"]\n    buy_19_protection__ema_fast                 = buy_protection_params[19][\"ema_fast\"]\n    buy_19_protection__ema_fast_len             = buy_protection_params[19][\"ema_fast_len\"]\n    buy_19_protection__ema_slow                 = buy_protection_params[19][\"ema_slow\"]\n    buy_19_protection__ema_slow_len             = buy_protection_params[19][\"ema_slow_len\"]\n    buy_19_protection__close_above_ema_fast     = buy_protection_params[19][\"close_above_ema_fast\"]\n    buy_19_protection__close_above_ema_fast_len = buy_protection_params[19][\"close_above_ema_fast_len\"]\n    buy_19_protection__close_above_ema_slow     = buy_protection_params[19][\"close_above_ema_slow\"]\n    buy_19_protection__close_above_ema_slow_len = buy_protection_params[19][\"close_above_ema_slow_len\"]\n    buy_19_protection__sma200_rising            = buy_protection_params[19][\"sma200_rising\"]\n    buy_19_protection__sma200_rising_val        = buy_protection_params[19][\"sma200_rising_val\"]\n    buy_19_protection__sma200_1h_rising         = buy_protection_params[19][\"sma200_1h_rising\"]\n    buy_19_protection__sma200_1h_rising_val     = buy_protection_params[19][\"sma200_1h_rising_val\"]\n    buy_19_protection__safe_dips                = buy_protection_params[19][\"safe_dips\"]\n    buy_19_protection__safe_dips_type           = buy_protection_params[19][\"safe_dips_type\"]\n    buy_19_protection__safe_pump                = buy_protection_params[19][\"safe_pump\"]\n    buy_19_protection__safe_pump_type           = buy_protection_params[19][\"safe_pump_type\"]\n    buy_19_protection__safe_pump_period         = buy_protection_params[19][\"safe_pump_period\"]\n    buy_19_protection__btc_1h_not_downtrend     = buy_protection_params[19][\"btc_1h_not_downtrend\"]\n\n    buy_condition_20_enable = buy_protection_params[20][\"enable\"]\n    buy_20_protection__ema_fast                 = buy_protection_params[20][\"ema_fast\"]\n    buy_20_protection__ema_fast_len             = buy_protection_params[20][\"ema_fast_len\"]\n    buy_20_protection__ema_slow                 = buy_protection_params[20][\"ema_slow\"]\n    buy_20_protection__ema_slow_len             = buy_protection_params[20][\"ema_slow_len\"]\n    buy_20_protection__close_above_ema_fast     = buy_protection_params[20][\"close_above_ema_fast\"]\n    buy_20_protection__close_above_ema_fast_len = buy_protection_params[20][\"close_above_ema_fast_len\"]\n    buy_20_protection__close_above_ema_slow     = buy_protection_params[20][\"close_above_ema_slow\"]\n    buy_20_protection__close_above_ema_slow_len = buy_protection_params[20][\"close_above_ema_slow_len\"]\n    buy_20_protection__sma200_rising            = buy_protection_params[20][\"sma200_rising\"]\n    buy_20_protection__sma200_rising_val        = buy_protection_params[20][\"sma200_rising_val\"]\n    buy_20_protection__sma200_1h_rising         = buy_protection_params[20][\"sma200_1h_rising\"]\n    buy_20_protection__sma200_1h_rising_val     = buy_protection_params[20][\"sma200_1h_rising_val\"]\n    buy_20_protection__safe_dips                = buy_protection_params[20][\"safe_dips\"]\n    buy_20_protection__safe_dips_type           = buy_protection_params[20][\"safe_dips_type\"]\n    buy_20_protection__safe_pump                = buy_protection_params[20][\"safe_pump\"]\n    buy_20_protection__safe_pump_type           = buy_protection_params[20][\"safe_pump_type\"]\n    buy_20_protection__safe_pump_period         = buy_protection_params[20][\"safe_pump_period\"]\n    buy_20_protection__btc_1h_not_downtrend     = buy_protection_params[20][\"btc_1h_not_downtrend\"]\n\n    buy_condition_21_enable = buy_protection_params[21][\"enable\"]\n    buy_21_protection__ema_fast                 = buy_protection_params[21][\"ema_fast\"]\n    buy_21_protection__ema_fast_len             = buy_protection_params[21][\"ema_fast_len\"]\n    buy_21_protection__ema_slow                 = buy_protection_params[21][\"ema_slow\"]\n    buy_21_protection__ema_slow_len             = buy_protection_params[21][\"ema_slow_len\"]\n    buy_21_protection__close_above_ema_fast     = buy_protection_params[21][\"close_above_ema_fast\"]\n    buy_21_protection__close_above_ema_fast_len = buy_protection_params[21][\"close_above_ema_fast_len\"]\n    buy_21_protection__close_above_ema_slow     = buy_protection_params[21][\"close_above_ema_slow\"]\n    buy_21_protection__close_above_ema_slow_len = buy_protection_params[21][\"close_above_ema_slow_len\"]\n    buy_21_protection__sma200_rising            = buy_protection_params[21][\"sma200_rising\"]\n    buy_21_protection__sma200_rising_val        = buy_protection_params[21][\"sma200_rising_val\"]\n    buy_21_protection__sma200_1h_rising         = buy_protection_params[21][\"sma200_1h_rising\"]\n    buy_21_protection__sma200_1h_rising_val     = buy_protection_params[21][\"sma200_1h_rising_val\"]\n    buy_21_protection__safe_dips                = buy_protection_params[21][\"safe_dips\"]\n    buy_21_protection__safe_dips_type           = buy_protection_params[21][\"safe_dips_type\"]\n    buy_21_protection__safe_pump                = buy_protection_params[21][\"safe_pump\"]\n    buy_21_protection__safe_pump_type           = buy_protection_params[21][\"safe_pump_type\"]\n    buy_21_protection__safe_pump_period         = buy_protection_params[21][\"safe_pump_period\"]\n    buy_21_protection__btc_1h_not_downtrend     = buy_protection_params[21][\"btc_1h_not_downtrend\"]\n\n    buy_condition_22_enable = buy_protection_params[22][\"enable\"]\n    buy_22_protection__ema_fast                 = buy_protection_params[22][\"ema_fast\"]\n    buy_22_protection__ema_fast_len             = buy_protection_params[22][\"ema_fast_len\"]\n    buy_22_protection__ema_slow                 = buy_protection_params[22][\"ema_slow\"]\n    buy_22_protection__ema_slow_len             = buy_protection_params[22][\"ema_slow_len\"]\n    buy_22_protection__close_above_ema_fast     = buy_protection_params[22][\"close_above_ema_fast\"]\n    buy_22_protection__close_above_ema_fast_len = buy_protection_params[22][\"close_above_ema_fast_len\"]\n    buy_22_protection__close_above_ema_slow     = buy_protection_params[22][\"close_above_ema_slow\"]\n    buy_22_protection__close_above_ema_slow_len = buy_protection_params[22][\"close_above_ema_slow_len\"]\n    buy_22_protection__sma200_rising            = buy_protection_params[22][\"sma200_rising\"]\n    buy_22_protection__sma200_rising_val        = buy_protection_params[22][\"sma200_rising_val\"]\n    buy_22_protection__sma200_1h_rising         = buy_protection_params[22][\"sma200_1h_rising\"]\n    buy_22_protection__sma200_1h_rising_val     = buy_protection_params[22][\"sma200_1h_rising_val\"]\n    buy_22_protection__safe_dips                = buy_protection_params[22][\"safe_dips\"]\n    buy_22_protection__safe_dips_type           = buy_protection_params[22][\"safe_dips_type\"]\n    buy_22_protection__safe_pump                = buy_protection_params[22][\"safe_pump\"]\n    buy_22_protection__safe_pump_type           = buy_protection_params[22][\"safe_pump_type\"]\n    buy_22_protection__safe_pump_period         = buy_protection_params[22][\"safe_pump_period\"]\n    buy_22_protection__btc_1h_not_downtrend     = buy_protection_params[22][\"btc_1h_not_downtrend\"]\n\n    buy_condition_23_enable = buy_protection_params[23][\"enable\"]\n    buy_23_protection__ema_fast                 = buy_protection_params[23][\"ema_fast\"]\n    buy_23_protection__ema_fast_len             = buy_protection_params[23][\"ema_fast_len\"]\n    buy_23_protection__ema_slow                 = buy_protection_params[23][\"ema_slow\"]\n    buy_23_protection__ema_slow_len             = buy_protection_params[23][\"ema_slow_len\"]\n    buy_23_protection__close_above_ema_fast     = buy_protection_params[23][\"close_above_ema_fast\"]\n    buy_23_protection__close_above_ema_fast_len = buy_protection_params[23][\"close_above_ema_fast_len\"]\n    buy_23_protection__close_above_ema_slow     = buy_protection_params[23][\"close_above_ema_slow\"]\n    buy_23_protection__close_above_ema_slow_len = buy_protection_params[23][\"close_above_ema_slow_len\"]\n    buy_23_protection__sma200_rising            = buy_protection_params[23][\"sma200_rising\"]\n    buy_23_protection__sma200_rising_val        = buy_protection_params[23][\"sma200_rising_val\"]\n    buy_23_protection__sma200_1h_rising         = buy_protection_params[23][\"sma200_1h_rising\"]\n    buy_23_protection__sma200_1h_rising_val     = buy_protection_params[23][\"sma200_1h_rising_val\"]\n    buy_23_protection__safe_dips                = buy_protection_params[23][\"safe_dips\"]\n    buy_23_protection__safe_dips_type           = buy_protection_params[23][\"safe_dips_type\"]\n    buy_23_protection__safe_pump                = buy_protection_params[23][\"safe_pump\"]\n    buy_23_protection__safe_pump_type           = buy_protection_params[23][\"safe_pump_type\"]\n    buy_23_protection__safe_pump_period         = buy_protection_params[23][\"safe_pump_period\"]\n    buy_23_protection__btc_1h_not_downtrend     = buy_protection_params[23][\"btc_1h_not_downtrend\"]\n\n    buy_condition_24_enable = buy_protection_params[24][\"enable\"]\n    buy_24_protection__ema_fast                 = buy_protection_params[24][\"ema_fast\"]\n    buy_24_protection__ema_fast_len             = buy_protection_params[24][\"ema_fast_len\"]\n    buy_24_protection__ema_slow                 = buy_protection_params[24][\"ema_slow\"]\n    buy_24_protection__ema_slow_len             = buy_protection_params[24][\"ema_slow_len\"]\n    buy_24_protection__close_above_ema_fast     = buy_protection_params[24][\"close_above_ema_fast\"]\n    buy_24_protection__close_above_ema_fast_len = buy_protection_params[24][\"close_above_ema_fast_len\"]\n    buy_24_protection__close_above_ema_slow     = buy_protection_params[24][\"close_above_ema_slow\"]\n    buy_24_protection__close_above_ema_slow_len = buy_protection_params[24][\"close_above_ema_slow_len\"]\n    buy_24_protection__sma200_rising            = buy_protection_params[24][\"sma200_rising\"]\n    buy_24_protection__sma200_rising_val        = buy_protection_params[24][\"sma200_rising_val\"]\n    buy_24_protection__sma200_1h_rising         = buy_protection_params[24][\"sma200_1h_rising\"]\n    buy_24_protection__sma200_1h_rising_val     = buy_protection_params[24][\"sma200_1h_rising_val\"]\n    buy_24_protection__safe_dips                = buy_protection_params[24][\"safe_dips\"]\n    buy_24_protection__safe_dips_type           = buy_protection_params[24][\"safe_dips_type\"]\n    buy_24_protection__safe_pump                = buy_protection_params[24][\"safe_pump\"]\n    buy_24_protection__safe_pump_type           = buy_protection_params[24][\"safe_pump_type\"]\n    buy_24_protection__safe_pump_period         = buy_protection_params[24][\"safe_pump_period\"]\n    buy_24_protection__btc_1h_not_downtrend     = buy_protection_params[24][\"btc_1h_not_downtrend\"]\n\n    buy_condition_25_enable = buy_protection_params[25][\"enable\"]\n    buy_25_protection__ema_fast                 = buy_protection_params[25][\"ema_fast\"]\n    buy_25_protection__ema_fast_len             = buy_protection_params[25][\"ema_fast_len\"]\n    buy_25_protection__ema_slow                 = buy_protection_params[25][\"ema_slow\"]\n    buy_25_protection__ema_slow_len             = buy_protection_params[25][\"ema_slow_len\"]\n    buy_25_protection__close_above_ema_fast     = buy_protection_params[25][\"close_above_ema_fast\"]\n    buy_25_protection__close_above_ema_fast_len = buy_protection_params[25][\"close_above_ema_fast_len\"]\n    buy_25_protection__close_above_ema_slow     = buy_protection_params[25][\"close_above_ema_slow\"]\n    buy_25_protection__close_above_ema_slow_len = buy_protection_params[25][\"close_above_ema_slow_len\"]\n    buy_25_protection__sma200_rising            = buy_protection_params[25][\"sma200_rising\"]\n    buy_25_protection__sma200_rising_val        = buy_protection_params[25][\"sma200_rising_val\"]\n    buy_25_protection__sma200_1h_rising         = buy_protection_params[25][\"sma200_1h_rising\"]\n    buy_25_protection__sma200_1h_rising_val     = buy_protection_params[25][\"sma200_1h_rising_val\"]\n    buy_25_protection__safe_dips                = buy_protection_params[25][\"safe_dips\"]\n    buy_25_protection__safe_dips_type           = buy_protection_params[25][\"safe_dips_type\"]\n    buy_25_protection__safe_pump                = buy_protection_params[25][\"safe_pump\"]\n    buy_25_protection__safe_pump_type           = buy_protection_params[25][\"safe_pump_type\"]\n    buy_25_protection__safe_pump_period         = buy_protection_params[25][\"safe_pump_period\"]\n    buy_25_protection__btc_1h_not_downtrend     = buy_protection_params[25][\"btc_1h_not_downtrend\"]\n\n    buy_condition_26_enable = buy_protection_params[26][\"enable\"]\n    buy_26_protection__ema_fast                 = buy_protection_params[26][\"ema_fast\"]\n    buy_26_protection__ema_fast_len             = buy_protection_params[26][\"ema_fast_len\"]\n    buy_26_protection__ema_slow                 = buy_protection_params[26][\"ema_slow\"]\n    buy_26_protection__ema_slow_len             = buy_protection_params[26][\"ema_slow_len\"]\n    buy_26_protection__close_above_ema_fast     = buy_protection_params[26][\"close_above_ema_fast\"]\n    buy_26_protection__close_above_ema_fast_len = buy_protection_params[26][\"close_above_ema_fast_len\"]\n    buy_26_protection__close_above_ema_slow     = buy_protection_params[26][\"close_above_ema_slow\"]\n    buy_26_protection__close_above_ema_slow_len = buy_protection_params[26][\"close_above_ema_slow_len\"]\n    buy_26_protection__sma200_rising            = buy_protection_params[26][\"sma200_rising\"]\n    buy_26_protection__sma200_rising_val        = buy_protection_params[26][\"sma200_rising_val\"]\n    buy_26_protection__sma200_1h_rising         = buy_protection_params[26][\"sma200_1h_rising\"]\n    buy_26_protection__sma200_1h_rising_val     = buy_protection_params[26][\"sma200_1h_rising_val\"]\n    buy_26_protection__safe_dips                = buy_protection_params[26][\"safe_dips\"]\n    buy_26_protection__safe_dips_type           = buy_protection_params[26][\"safe_dips_type\"]\n    buy_26_protection__safe_pump                = buy_protection_params[26][\"safe_pump\"]\n    buy_26_protection__safe_pump_type           = buy_protection_params[26][\"safe_pump_type\"]\n    buy_26_protection__safe_pump_period         = buy_protection_params[26][\"safe_pump_period\"]\n    buy_26_protection__btc_1h_not_downtrend     = buy_protection_params[26][\"btc_1h_not_downtrend\"]\n\n    buy_condition_27_enable = buy_protection_params[27][\"enable\"]\n    buy_27_protection__ema_fast                 = buy_protection_params[27][\"ema_fast\"]\n    buy_27_protection__ema_fast_len             = buy_protection_params[27][\"ema_fast_len\"]\n    buy_27_protection__ema_slow                 = buy_protection_params[27][\"ema_slow\"]\n    buy_27_protection__ema_slow_len             = buy_protection_params[27][\"ema_slow_len\"]\n    buy_27_protection__close_above_ema_fast     = buy_protection_params[27][\"close_above_ema_fast\"]\n    buy_27_protection__close_above_ema_fast_len = buy_protection_params[27][\"close_above_ema_fast_len\"]\n    buy_27_protection__close_above_ema_slow     = buy_protection_params[27][\"close_above_ema_slow\"]\n    buy_27_protection__close_above_ema_slow_len = buy_protection_params[27][\"close_above_ema_slow_len\"]\n    buy_27_protection__sma200_rising            = buy_protection_params[27][\"sma200_rising\"]\n    buy_27_protection__sma200_rising_val        = buy_protection_params[27][\"sma200_rising_val\"]\n    buy_27_protection__sma200_1h_rising         = buy_protection_params[27][\"sma200_1h_rising\"]\n    buy_27_protection__sma200_1h_rising_val     = buy_protection_params[27][\"sma200_1h_rising_val\"]\n    buy_27_protection__safe_dips                = buy_protection_params[27][\"safe_dips\"]\n    buy_27_protection__safe_dips_type           = buy_protection_params[27][\"safe_dips_type\"]\n    buy_27_protection__safe_pump                = buy_protection_params[27][\"safe_pump\"]\n    buy_27_protection__safe_pump_type           = buy_protection_params[27][\"safe_pump_type\"]\n    buy_27_protection__safe_pump_period         = buy_protection_params[27][\"safe_pump_period\"]\n    buy_27_protection__btc_1h_not_downtrend     = buy_protection_params[27][\"btc_1h_not_downtrend\"]\n\n    buy_condition_28_enable = buy_protection_params[28][\"enable\"]\n    buy_28_protection__ema_fast                 = buy_protection_params[28][\"ema_fast\"]\n    buy_28_protection__ema_fast_len             = buy_protection_params[28][\"ema_fast_len\"]\n    buy_28_protection__ema_slow                 = buy_protection_params[28][\"ema_slow\"]\n    buy_28_protection__ema_slow_len             = buy_protection_params[28][\"ema_slow_len\"]\n    buy_28_protection__close_above_ema_fast     = buy_protection_params[28][\"close_above_ema_fast\"]\n    buy_28_protection__close_above_ema_fast_len = buy_protection_params[28][\"close_above_ema_fast_len\"]\n    buy_28_protection__close_above_ema_slow     = buy_protection_params[28][\"close_above_ema_slow\"]\n    buy_28_protection__close_above_ema_slow_len = buy_protection_params[28][\"close_above_ema_slow_len\"]\n    buy_28_protection__sma200_rising            = buy_protection_params[28][\"sma200_rising\"]\n    buy_28_protection__sma200_rising_val        = buy_protection_params[28][\"sma200_rising_val\"]\n    buy_28_protection__sma200_1h_rising         = buy_protection_params[28][\"sma200_1h_rising\"]\n    buy_28_protection__sma200_1h_rising_val     = buy_protection_params[28][\"sma200_1h_rising_val\"]\n    buy_28_protection__safe_dips                = buy_protection_params[28][\"safe_dips\"]\n    buy_28_protection__safe_dips_type           = buy_protection_params[28][\"safe_dips_type\"]\n    buy_28_protection__safe_pump                = buy_protection_params[28][\"safe_pump\"]\n    buy_28_protection__safe_pump_type           = buy_protection_params[28][\"safe_pump_type\"]\n    buy_28_protection__safe_pump_period         = buy_protection_params[28][\"safe_pump_period\"]\n    buy_28_protection__btc_1h_not_downtrend     = buy_protection_params[28][\"btc_1h_not_downtrend\"]\n\n    buy_condition_29_enable = buy_protection_params[29][\"enable\"]\n    buy_29_protection__ema_fast                 = buy_protection_params[29][\"ema_fast\"]\n    buy_29_protection__ema_fast_len             = buy_protection_params[29][\"ema_fast_len\"]\n    buy_29_protection__ema_slow                 = buy_protection_params[29][\"ema_slow\"]\n    buy_29_protection__ema_slow_len             = buy_protection_params[29][\"ema_slow_len\"]\n    buy_29_protection__close_above_ema_fast     = buy_protection_params[29][\"close_above_ema_fast\"]\n    buy_29_protection__close_above_ema_fast_len = buy_protection_params[29][\"close_above_ema_fast_len\"]\n    buy_29_protection__close_above_ema_slow     = buy_protection_params[29][\"close_above_ema_slow\"]\n    buy_29_protection__close_above_ema_slow_len = buy_protection_params[29][\"close_above_ema_slow_len\"]\n    buy_29_protection__sma200_rising            = buy_protection_params[29][\"sma200_rising\"]\n    buy_29_protection__sma200_rising_val        = buy_protection_params[29][\"sma200_rising_val\"]\n    buy_29_protection__sma200_1h_rising         = buy_protection_params[29][\"sma200_1h_rising\"]\n    buy_29_protection__sma200_1h_rising_val     = buy_protection_params[29][\"sma200_1h_rising_val\"]\n    buy_29_protection__safe_dips                = buy_protection_params[29][\"safe_dips\"]\n    buy_29_protection__safe_dips_type           = buy_protection_params[29][\"safe_dips_type\"]\n    buy_29_protection__safe_pump                = buy_protection_params[29][\"safe_pump\"]\n    buy_29_protection__safe_pump_type           = buy_protection_params[29][\"safe_pump_type\"]\n    buy_29_protection__safe_pump_period         = buy_protection_params[29][\"safe_pump_period\"]\n    buy_29_protection__btc_1h_not_downtrend     = buy_protection_params[29][\"btc_1h_not_downtrend\"]\n\n    buy_condition_30_enable = buy_protection_params[30][\"enable\"]\n    buy_30_protection__ema_fast                 = buy_protection_params[30][\"ema_fast\"]\n    buy_30_protection__ema_fast_len             = buy_protection_params[30][\"ema_fast_len\"]\n    buy_30_protection__ema_slow                 = buy_protection_params[30][\"ema_slow\"]\n    buy_30_protection__ema_slow_len             = buy_protection_params[30][\"ema_slow_len\"]\n    buy_30_protection__close_above_ema_fast     = buy_protection_params[30][\"close_above_ema_fast\"]\n    buy_30_protection__close_above_ema_fast_len = buy_protection_params[30][\"close_above_ema_fast_len\"]\n    buy_30_protection__close_above_ema_slow     = buy_protection_params[30][\"close_above_ema_slow\"]\n    buy_30_protection__close_above_ema_slow_len = buy_protection_params[30][\"close_above_ema_slow_len\"]\n    buy_30_protection__sma200_rising            = buy_protection_params[30][\"sma200_rising\"]\n    buy_30_protection__sma200_rising_val        = buy_protection_params[30][\"sma200_rising_val\"]\n    buy_30_protection__sma200_1h_rising         = buy_protection_params[30][\"sma200_1h_rising\"]\n    buy_30_protection__sma200_1h_rising_val     = buy_protection_params[30][\"sma200_1h_rising_val\"]\n    buy_30_protection__safe_dips                = buy_protection_params[30][\"safe_dips\"]\n    buy_30_protection__safe_dips_type           = buy_protection_params[30][\"safe_dips_type\"]\n    buy_30_protection__safe_pump                = buy_protection_params[30][\"safe_pump\"]\n    buy_30_protection__safe_pump_type           = buy_protection_params[30][\"safe_pump_type\"]\n    buy_30_protection__safe_pump_period         = buy_protection_params[30][\"safe_pump_period\"]\n    buy_30_protection__btc_1h_not_downtrend     = buy_protection_params[30][\"btc_1h_not_downtrend\"]\n\n    buy_condition_31_enable = buy_protection_params[31][\"enable\"]\n    buy_31_protection__ema_fast                 = buy_protection_params[31][\"ema_fast\"]\n    buy_31_protection__ema_fast_len             = buy_protection_params[31][\"ema_fast_len\"]\n    buy_31_protection__ema_slow                 = buy_protection_params[31][\"ema_slow\"]\n    buy_31_protection__ema_slow_len             = buy_protection_params[31][\"ema_slow_len\"]\n    buy_31_protection__close_above_ema_fast     = buy_protection_params[31][\"close_above_ema_fast\"]\n    buy_31_protection__close_above_ema_fast_len = buy_protection_params[31][\"close_above_ema_fast_len\"]\n    buy_31_protection__close_above_ema_slow     = buy_protection_params[31][\"close_above_ema_slow\"]\n    buy_31_protection__close_above_ema_slow_len = buy_protection_params[31][\"close_above_ema_slow_len\"]\n    buy_31_protection__sma200_rising            = buy_protection_params[31][\"sma200_rising\"]\n    buy_31_protection__sma200_rising_val        = buy_protection_params[31][\"sma200_rising_val\"]\n    buy_31_protection__sma200_1h_rising         = buy_protection_params[31][\"sma200_1h_rising\"]\n    buy_31_protection__sma200_1h_rising_val     = buy_protection_params[31][\"sma200_1h_rising_val\"]\n    buy_31_protection__safe_dips                = buy_protection_params[31][\"safe_dips\"]\n    buy_31_protection__safe_dips_type           = buy_protection_params[31][\"safe_dips_type\"]\n    buy_31_protection__safe_pump                = buy_protection_params[31][\"safe_pump\"]\n    buy_31_protection__safe_pump_type           = buy_protection_params[31][\"safe_pump_type\"]\n    buy_31_protection__safe_pump_period         = buy_protection_params[31][\"safe_pump_period\"]\n    buy_31_protection__btc_1h_not_downtrend     = buy_protection_params[31][\"btc_1h_not_downtrend\"]\n\n    buy_condition_32_enable = buy_protection_params[32][\"enable\"]\n    buy_32_protection__ema_fast                 = buy_protection_params[32][\"ema_fast\"]\n    buy_32_protection__ema_fast_len             = buy_protection_params[32][\"ema_fast_len\"]\n    buy_32_protection__ema_slow                 = buy_protection_params[32][\"ema_slow\"]\n    buy_32_protection__ema_slow_len             = buy_protection_params[32][\"ema_slow_len\"]\n    buy_32_protection__close_above_ema_fast     = buy_protection_params[32][\"close_above_ema_fast\"]\n    buy_32_protection__close_above_ema_fast_len = buy_protection_params[32][\"close_above_ema_fast_len\"]\n    buy_32_protection__close_above_ema_slow     = buy_protection_params[32][\"close_above_ema_slow\"]\n    buy_32_protection__close_above_ema_slow_len = buy_protection_params[32][\"close_above_ema_slow_len\"]\n    buy_32_protection__sma200_rising            = buy_protection_params[32][\"sma200_rising\"]\n    buy_32_protection__sma200_rising_val        = buy_protection_params[32][\"sma200_rising_val\"]\n    buy_32_protection__sma200_1h_rising         = buy_protection_params[32][\"sma200_1h_rising\"]\n    buy_32_protection__sma200_1h_rising_val     = buy_protection_params[32][\"sma200_1h_rising_val\"]\n    buy_32_protection__safe_dips                = buy_protection_params[32][\"safe_dips\"]\n    buy_32_protection__safe_dips_type           = buy_protection_params[32][\"safe_dips_type\"]\n    buy_32_protection__safe_pump                = buy_protection_params[32][\"safe_pump\"]\n    buy_32_protection__safe_pump_type           = buy_protection_params[32][\"safe_pump_type\"]\n    buy_32_protection__safe_pump_period         = buy_protection_params[32][\"safe_pump_period\"]\n    buy_32_protection__btc_1h_not_downtrend     = buy_protection_params[32][\"btc_1h_not_downtrend\"]\n\n    buy_condition_33_enable = buy_protection_params[33][\"enable\"]\n    buy_33_protection__ema_fast                 = buy_protection_params[33][\"ema_fast\"]\n    buy_33_protection__ema_fast_len             = buy_protection_params[33][\"ema_fast_len\"]\n    buy_33_protection__ema_slow                 = buy_protection_params[33][\"ema_slow\"]\n    buy_33_protection__ema_slow_len             = buy_protection_params[33][\"ema_slow_len\"]\n    buy_33_protection__close_above_ema_fast     = buy_protection_params[33][\"close_above_ema_fast\"]\n    buy_33_protection__close_above_ema_fast_len = buy_protection_params[33][\"close_above_ema_fast_len\"]\n    buy_33_protection__close_above_ema_slow     = buy_protection_params[33][\"close_above_ema_slow\"]\n    buy_33_protection__close_above_ema_slow_len = buy_protection_params[33][\"close_above_ema_slow_len\"]\n    buy_33_protection__sma200_rising            = buy_protection_params[33][\"sma200_rising\"]\n    buy_33_protection__sma200_rising_val        = buy_protection_params[33][\"sma200_rising_val\"]\n    buy_33_protection__sma200_1h_rising         = buy_protection_params[33][\"sma200_1h_rising\"]\n    buy_33_protection__sma200_1h_rising_val     = buy_protection_params[33][\"sma200_1h_rising_val\"]\n    buy_33_protection__safe_dips                = buy_protection_params[33][\"safe_dips\"]\n    buy_33_protection__safe_dips_type           = buy_protection_params[33][\"safe_dips_type\"]\n    buy_33_protection__safe_pump                = buy_protection_params[33][\"safe_pump\"]\n    buy_33_protection__safe_pump_type           = buy_protection_params[33][\"safe_pump_type\"]\n    buy_33_protection__safe_pump_period         = buy_protection_params[33][\"safe_pump_period\"]\n    buy_33_protection__btc_1h_not_downtrend     = buy_protection_params[33][\"btc_1h_not_downtrend\"]\n\n    buy_condition_34_enable = buy_protection_params[34][\"enable\"]\n    buy_34_protection__ema_fast                 = buy_protection_params[34][\"ema_fast\"]\n    buy_34_protection__ema_fast_len             = buy_protection_params[34][\"ema_fast_len\"]\n    buy_34_protection__ema_slow                 = buy_protection_params[34][\"ema_slow\"]\n    buy_34_protection__ema_slow_len             = buy_protection_params[34][\"ema_slow_len\"]\n    buy_34_protection__close_above_ema_fast     = buy_protection_params[34][\"close_above_ema_fast\"]\n    buy_34_protection__close_above_ema_fast_len = buy_protection_params[34][\"close_above_ema_fast_len\"]\n    buy_34_protection__close_above_ema_slow     = buy_protection_params[34][\"close_above_ema_slow\"]\n    buy_34_protection__close_above_ema_slow_len = buy_protection_params[34][\"close_above_ema_slow_len\"]\n    buy_34_protection__sma200_rising            = buy_protection_params[34][\"sma200_rising\"]\n    buy_34_protection__sma200_rising_val        = buy_protection_params[34][\"sma200_rising_val\"]\n    buy_34_protection__sma200_1h_rising         = buy_protection_params[34][\"sma200_1h_rising\"]\n    buy_34_protection__sma200_1h_rising_val     = buy_protection_params[34][\"sma200_1h_rising_val\"]\n    buy_34_protection__safe_dips                = buy_protection_params[34][\"safe_dips\"]\n    buy_34_protection__safe_dips_type           = buy_protection_params[34][\"safe_dips_type\"]\n    buy_34_protection__safe_pump                = buy_protection_params[34][\"safe_pump\"]\n    buy_34_protection__safe_pump_type           = buy_protection_params[34][\"safe_pump_type\"]\n    buy_34_protection__safe_pump_period         = buy_protection_params[34][\"safe_pump_period\"]\n    buy_34_protection__btc_1h_not_downtrend     = buy_protection_params[34][\"btc_1h_not_downtrend\"]\n\n    buy_condition_35_enable = buy_protection_params[35][\"enable\"]\n    buy_35_protection__ema_fast                 = buy_protection_params[35][\"ema_fast\"]\n    buy_35_protection__ema_fast_len             = buy_protection_params[35][\"ema_fast_len\"]\n    buy_35_protection__ema_slow                 = buy_protection_params[35][\"ema_slow\"]\n    buy_35_protection__ema_slow_len             = buy_protection_params[35][\"ema_slow_len\"]\n    buy_35_protection__close_above_ema_fast     = buy_protection_params[35][\"close_above_ema_fast\"]\n    buy_35_protection__close_above_ema_fast_len = buy_protection_params[35][\"close_above_ema_fast_len\"]\n    buy_35_protection__close_above_ema_slow     = buy_protection_params[35][\"close_above_ema_slow\"]\n    buy_35_protection__close_above_ema_slow_len = buy_protection_params[35][\"close_above_ema_slow_len\"]\n    buy_35_protection__sma200_rising            = buy_protection_params[35][\"sma200_rising\"]\n    buy_35_protection__sma200_rising_val        = buy_protection_params[35][\"sma200_rising_val\"]\n    buy_35_protection__sma200_1h_rising         = buy_protection_params[35][\"sma200_1h_rising\"]\n    buy_35_protection__sma200_1h_rising_val     = buy_protection_params[35][\"sma200_1h_rising_val\"]\n    buy_35_protection__safe_dips                = buy_protection_params[35][\"safe_dips\"]\n    buy_35_protection__safe_dips_type           = buy_protection_params[35][\"safe_dips_type\"]\n    buy_35_protection__safe_pump                = buy_protection_params[35][\"safe_pump\"]\n    buy_35_protection__safe_pump_type           = buy_protection_params[35][\"safe_pump_type\"]\n    buy_35_protection__safe_pump_period         = buy_protection_params[35][\"safe_pump_period\"]\n    buy_35_protection__btc_1h_not_downtrend     = buy_protection_params[35][\"btc_1h_not_downtrend\"]\n\n    buy_condition_36_enable = buy_protection_params[36][\"enable\"]\n    buy_36_protection__ema_fast                 = buy_protection_params[36][\"ema_fast\"]\n    buy_36_protection__ema_fast_len             = buy_protection_params[36][\"ema_fast_len\"]\n    buy_36_protection__ema_slow                 = buy_protection_params[36][\"ema_slow\"]\n    buy_36_protection__ema_slow_len             = buy_protection_params[36][\"ema_slow_len\"]\n    buy_36_protection__close_above_ema_fast     = buy_protection_params[36][\"close_above_ema_fast\"]\n    buy_36_protection__close_above_ema_fast_len = buy_protection_params[36][\"close_above_ema_fast_len\"]\n    buy_36_protection__close_above_ema_slow     = buy_protection_params[36][\"close_above_ema_slow\"]\n    buy_36_protection__close_above_ema_slow_len = buy_protection_params[36][\"close_above_ema_slow_len\"]\n    buy_36_protection__sma200_rising            = buy_protection_params[36][\"sma200_rising\"]\n    buy_36_protection__sma200_rising_val        = buy_protection_params[36][\"sma200_rising_val\"]\n    buy_36_protection__sma200_1h_rising         = buy_protection_params[36][\"sma200_1h_rising\"]\n    buy_36_protection__sma200_1h_rising_val     = buy_protection_params[36][\"sma200_1h_rising_val\"]\n    buy_36_protection__safe_dips                = buy_protection_params[36][\"safe_dips\"]\n    buy_36_protection__safe_dips_type           = buy_protection_params[36][\"safe_dips_type\"]\n    buy_36_protection__safe_pump                = buy_protection_params[36][\"safe_pump\"]\n    buy_36_protection__safe_pump_type           = buy_protection_params[36][\"safe_pump_type\"]\n    buy_36_protection__safe_pump_period         = buy_protection_params[36][\"safe_pump_period\"]\n    buy_36_protection__btc_1h_not_downtrend     = buy_protection_params[36][\"btc_1h_not_downtrend\"]\n\n    buy_condition_37_enable = buy_protection_params[37][\"enable\"]\n    buy_37_protection__ema_fast                 = buy_protection_params[37][\"ema_fast\"]\n    buy_37_protection__ema_fast_len             = buy_protection_params[37][\"ema_fast_len\"]\n    buy_37_protection__ema_slow                 = buy_protection_params[37][\"ema_slow\"]\n    buy_37_protection__ema_slow_len             = buy_protection_params[37][\"ema_slow_len\"]\n    buy_37_protection__close_above_ema_fast     = buy_protection_params[37][\"close_above_ema_fast\"]\n    buy_37_protection__close_above_ema_fast_len = buy_protection_params[37][\"close_above_ema_fast_len\"]\n    buy_37_protection__close_above_ema_slow     = buy_protection_params[37][\"close_above_ema_slow\"]\n    buy_37_protection__close_above_ema_slow_len = buy_protection_params[37][\"close_above_ema_slow_len\"]\n    buy_37_protection__sma200_rising            = buy_protection_params[37][\"sma200_rising\"]\n    buy_37_protection__sma200_rising_val        = buy_protection_params[37][\"sma200_rising_val\"]\n    buy_37_protection__sma200_1h_rising         = buy_protection_params[37][\"sma200_1h_rising\"]\n    buy_37_protection__sma200_1h_rising_val     = buy_protection_params[37][\"sma200_1h_rising_val\"]\n    buy_37_protection__safe_dips                = buy_protection_params[37][\"safe_dips\"]\n    buy_37_protection__safe_dips_type           = buy_protection_params[37][\"safe_dips_type\"]\n    buy_37_protection__safe_pump                = buy_protection_params[37][\"safe_pump\"]\n    buy_37_protection__safe_pump_type           = buy_protection_params[37][\"safe_pump_type\"]\n    buy_37_protection__safe_pump_period         = buy_protection_params[37][\"safe_pump_period\"]\n    buy_37_protection__btc_1h_not_downtrend     = buy_protection_params[37][\"btc_1h_not_downtrend\"]\n\n    buy_condition_38_enable = buy_protection_params[38][\"enable\"]\n    buy_38_protection__ema_fast                 = buy_protection_params[38][\"ema_fast\"]\n    buy_38_protection__ema_fast_len             = buy_protection_params[38][\"ema_fast_len\"]\n    buy_38_protection__ema_slow                 = buy_protection_params[38][\"ema_slow\"]\n    buy_38_protection__ema_slow_len             = buy_protection_params[38][\"ema_slow_len\"]\n    buy_38_protection__close_above_ema_fast     = buy_protection_params[38][\"close_above_ema_fast\"]\n    buy_38_protection__close_above_ema_fast_len = buy_protection_params[38][\"close_above_ema_fast_len\"]\n    buy_38_protection__close_above_ema_slow     = buy_protection_params[38][\"close_above_ema_slow\"]\n    buy_38_protection__close_above_ema_slow_len = buy_protection_params[38][\"close_above_ema_slow_len\"]\n    buy_38_protection__sma200_rising            = buy_protection_params[38][\"sma200_rising\"]\n    buy_38_protection__sma200_rising_val        = buy_protection_params[38][\"sma200_rising_val\"]\n    buy_38_protection__sma200_1h_rising         = buy_protection_params[38][\"sma200_1h_rising\"]\n    buy_38_protection__sma200_1h_rising_val     = buy_protection_params[38][\"sma200_1h_rising_val\"]\n    buy_38_protection__safe_dips                = buy_protection_params[38][\"safe_dips\"]\n    buy_38_protection__safe_dips_type           = buy_protection_params[38][\"safe_dips_type\"]\n    buy_38_protection__safe_pump                = buy_protection_params[38][\"safe_pump\"]\n    buy_38_protection__safe_pump_type           = buy_protection_params[38][\"safe_pump_type\"]\n    buy_38_protection__safe_pump_period         = buy_protection_params[38][\"safe_pump_period\"]\n    buy_38_protection__btc_1h_not_downtrend     = buy_protection_params[38][\"btc_1h_not_downtrend\"]\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_2 = DecimalParameter(0.16, 0.3, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_3 = DecimalParameter(0.3, 0.5, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_4 = DecimalParameter(0.6, 1.0, default=0.86, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_2 = DecimalParameter(0.16, 0.34, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_3 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_4 = DecimalParameter(0.6, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=35.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_1 = DecimalParameter(-0.99, -0.5, default=-0.87, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=38.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_2 = DecimalParameter(0.6, 6.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.045, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.022, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_3 = DecimalParameter(-0.99, -0.5, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_cti_4 = DecimalParameter(-0.99, -0.5, default=-0.68, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.938, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_5 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_5 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.031, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_7 = DecimalParameter(-0.99, -0.5, default=-0.89, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_cti_8 = DecimalParameter(-0.99, -0.5, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(20.0, 50.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_8 = DecimalParameter(0.98, 1.0, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_8 = DecimalParameter(40.0, 66.0, default=64.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_8 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=44.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.907, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=34.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_13 = DecimalParameter(-0.99, -0.5, default=-0.74, space='buy', decimals=2, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-9.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_14 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.96, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.977, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_16 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_17 = DecimalParameter(-0.99, -0.5, default=-0.92, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_17 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_18 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_18 = DecimalParameter(-0.99, -0.5, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=16.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_20 = DecimalParameter(-0.99, -0.5, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_20 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=14.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_21 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.946, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=6.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.932, space='buy', optimize=False, load=True)\n    buy_26_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n    buy_26_volume = DecimalParameter(0.6, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(95, 99, default=99.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=97.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n    buy_27_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_27_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_28_ma_offset = DecimalParameter(0.90, 0.99, default=0.92, space='buy', optimize=False, load=True)\n    buy_28_ewo = DecimalParameter(2.0, 14.0, default=12.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_rsi = DecimalParameter(24.0, 44.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_cti = DecimalParameter(-0.99, -0.4, default=-0.6, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_29_ma_offset = DecimalParameter(0.90, 0.99, default=0.91, space='buy', optimize=False, load=True)\n    buy_29_ewo = DecimalParameter(-14.0, -2.0, default=-4.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_29_cti = DecimalParameter(-0.99, -0.4, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_30_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_30_ewo = DecimalParameter(2.0, 14.0, default=7.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_rsi = DecimalParameter(24.0, 48.0, default=42.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_31_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_31_ewo = DecimalParameter(-22.0, -8.0, default=-19.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_31_wr = DecimalParameter(-99.9, -95.0, default=-98.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_32_ma_offset = DecimalParameter(0.90, 0.99, default=0.946, space='buy', optimize=False, load=True)\n    buy_32_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_32_rsi = DecimalParameter(24.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_32_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_33_ma_offset = DecimalParameter(0.90, 0.99, default=0.974, space='buy', optimize=False, load=True)\n    buy_33_rsi = DecimalParameter(24.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_33_ewo = DecimalParameter(2.0, 14.0, default=9.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_34_ma_offset = DecimalParameter(0.90, 0.99, default=0.968, space='buy', optimize=False, load=True)\n    buy_34_dip = DecimalParameter(0.001, 0.02, default=0.002, space='buy', decimals=3, optimize=False, load=True)\n    buy_34_ewo = DecimalParameter(-24.0, -8.0, default=-20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_34_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_34_volume = DecimalParameter(0.6, 6.0, default=1.1, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = DecimalParameter(0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_profit_max_1 = DecimalParameter(0.0, 0.05, default=0.02, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = None\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = {}\n\n        # Update values from config file, if it exists\n        hold_trades_config_file = NostalgiaForInfinityNext.get_hold_trades_config_file()\n        if not hold_trades_config_file:\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            trade_ids = None\n            hold_trades_config = None\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                trade_ids = hold_trades_config.get(\"trade_ids\")\n\n            if not trade_ids:\n                return\n\n            open_trades = {\n                trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n            }\n\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    try:\n                        trade_id = int(trade_id)\n                    except ValueError:\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            hold_trades_config_file\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if current_profit > self.sell_custom_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_11.value:\n                    return True, 'signal_profit_11'\n            elif self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_10.value:\n                    return True, 'signal_profit_10'\n            elif self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_9.value:\n                    return True, 'signal_profit_9'\n            elif self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_8.value:\n                    return True, 'signal_profit_8'\n            elif self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_7'\n            elif self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_6'\n            elif self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_5'\n            elif self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_4'\n            elif self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_3'\n            elif self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_2'\n            elif self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_1'\n            elif self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_0'\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if current_profit > self.sell_custom_under_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_11.value:\n                    return True, 'signal_profit_u_11'\n            elif self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_10.value:\n                    return True, 'signal_profit_u_10'\n            elif self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_9.value:\n                    return True, 'signal_profit_u_9'\n            elif self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_8.value:\n                    return True, 'signal_profit_u_8'\n            elif self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_7.value:\n                    return True, 'signal_profit_u_7'\n            elif self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_6.value:\n                    return True, 'signal_profit_u_6'\n            elif self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_5.value:\n                    return True, 'signal_profit_u_5'\n            elif self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_4.value:\n                    return True, 'signal_profit_u_4'\n            elif self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_3.value:\n                    return True, 'signal_profit_u_3'\n            elif self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_2.value:\n                    return True, 'signal_profit_u_2'\n            elif self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_1.value:\n                    return True, 'signal_profit_u_1'\n            elif self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_u_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)) & (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) & (0.2 > current_profit > 0.07) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1.value > current_profit > self.sell_custom_profit_under_profit_min_1.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit > self.sell_custom_profit_under_profit_2.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime', max_loss: float, max_profit: float) -> tuple:\n        if (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < -0.2) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_stoploss_u_1'\n\n        # Under EMA200, pair & BTC negative, low max rate\n        elif (-0.1 > current_profit > -0.14) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (max_profit < 0.005) & (max_loss < 0.14) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -50.0):\n            return True, 'signal_stoploss_u_b_1'\n\n        # Under EMA200, pair & BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (-0.1 > current_profit > -0.2) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (last_candle['moderi_96'] == False) & (max_profit < 0.05) & (max_loss < 0.2) & (last_candle['sma_200_dec_24'])& (last_candle['sma_200_dec_20_1h']) & (last_candle['cmf'] < -0.45) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -97.0):\n            return True, 'signal_stoploss_u_b_2'\n\n        elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_1'\n\n        elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n            return True, 'signal_stoploss_p_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n            return True, 'signal_stoploss_p_3'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit > 0.02:\n            if last_candle['r_480'] > -1.2:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit > 0.03:\n            if last_candle['r_480'] > -1.4:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit > 0.04:\n            if last_candle['r_480'] > -1.6:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit > 0.05:\n            if last_candle['r_480'] > -1.8:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit > 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit > 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit > 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit > 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -1.5) & (last_candle['rsi'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -1.0) & (last_candle['rsi'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -2.1) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -2.3) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit > 0.05:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit > 0.06:\n            if (last_candle['r_480'] > -2.5) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit > 0.07:\n            if (last_candle['r_480'] > -34.0) & (last_candle['rsi'] > 80.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit > 0.08:\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit > 0.09:\n            if (last_candle['r_480'] > -2.8) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 81.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 81.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -29.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -30.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit > 0.012):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit > 0.02):\n            if (last_candle['r_480'] > -3.5) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit > 0.03):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit > 0.04):\n            if (last_candle['r_480'] > -4.5) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit > 0.05):\n            if (last_candle['r_480'] > -24.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit > 0.06):\n            if (last_candle['r_480'] > -26.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit > 0.07):\n            if (last_candle['r_480'] > -20.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit > 0.08):\n            if (last_candle['r_480'] > -18.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit > 0.09):\n            if (last_candle['r_480'] > -16.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit > 0.1):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit > 0.12):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit > 0.2):\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1, buy_signal_candle) -> tuple:\n        if buy_signal_candle['buy_condition_32'] or buy_signal_candle['buy_condition_33'] or buy_signal_candle['buy_condition_34'] or buy_signal_candle['buy_condition_35'] or buy_signal_candle['buy_condition_36'] or buy_signal_candle['buy_condition_37'] or buy_signal_candle['buy_condition_38']:\n            if (0.06 > current_profit > 0.02) & (last_candle['rsi'] > 79.0):\n                return True, 'signal_profit_q_1'\n\n            if (0.06 > current_profit > 0.02) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_q_2'\n\n            if (current_profit < -0.1):\n                return True, 'signal_stoploss_q_1'\n\n            if(last_candle['close'] < last_candle['atr_high_thresh']) & (previous_candle_1['close'] > previous_candle_1['atr_high_thresh']):\n                return True, 'signal_stoploss_q_atr'\n\n            if (current_profit > 0.0):\n                if (last_candle['pm'] <= last_candle['pmax_thresh']) & (last_candle['close'] > last_candle['sma_21'] * 1.039):\n                    return True, 'signal_profit_q_pmax_bull'\n                if (last_candle['pm'] > last_candle['pmax_thresh']) & (last_candle['close'] > last_candle['sma_21'] * 1.012):\n                    return True, 'signal_profit_q_pmax_bear'\n                if (last_candle['pm'] > last_candle['pmax_thresh']) & (last_candle['crsi'] >= 70):\n                    return True, 'signal_profit_q_pmax_c'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle_1 = dataframe.iloc[-2].squeeze()\n        previous_candle_2 = dataframe.iloc[-3].squeeze()\n        previous_candle_3 = dataframe.iloc[-4].squeeze()\n        previous_candle_4 = dataframe.iloc[-5].squeeze()\n        previous_candle_5 = dataframe.iloc[-6].squeeze()\n\n        trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n        buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n        if not buy_signal.empty:\n            buy_signal_candle = buy_signal.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if not buy_signal.empty:\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1, buy_signal_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, trade, current_time, max_loss, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name\n\n        # Sell signal 1\n        if self.sell_condition_1_enable.value & (last_candle['rsi'] > self.sell_rsi_bb_1.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) & (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) & (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) & (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1'\n                elif (max_loss > 0.1):\n                    return 'sell_signal_1_1_2'\n            else:\n                return 'sell_signal_1_2'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable.value) & (last_candle['rsi'] > self.sell_rsi_bb_2.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1'\n                elif (max_loss > 0.07):\n                    return 'sell_signal_2_1_2'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1'\n                elif (max_loss > 0.07):\n                    return 'sell_signal_2_2_2'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable.value & (last_candle['rsi'] > self.sell_dual_rsi_rsi_4.value) & (last_candle['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n            return 'sell_signal_4'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable.value & (last_candle['close'] < last_candle['ema_200']) & (last_candle['close'] > last_candle['ema_50']) & (last_candle['rsi'] > self.sell_rsi_under_6.value):\n            if (current_profit > 0.0):\n                    return 'sell_signal_6_1'\n            elif (max_loss > 0.08):\n                return 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable.value & (last_candle['rsi_1h'] > self.sell_rsi_1h_7.value) & (last_candle['crossed_below_ema_12_26']):\n            return 'sell_signal_7'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable.value & (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n            return 'sell_signal_8'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return (df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min()\n        elif method == 'OC':\n            return (df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return (df['open'] - df['close']) / df['close']\n        else:\n            return (df['open'].rolling(length).max() - df['close']) / df['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['open'].rolling(length).max() - df['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['close'] - df['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h.copy()\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # TSI\n        dataframe['tsi_slow'] = tsi(dataframe, window_slow=20, window_fast=5)\n        dataframe['tsi_ema_slow'] = ta.EMA(dataframe['tsi_slow'], timeperiod=5)\n\n        dataframe['tsi_fast'] = tsi(dataframe, window_slow=4, window_fast=2)\n        dataframe['tsi_ema_fast'] = ta.EMA(dataframe['tsi_fast'], timeperiod=2)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh'] = (dataframe['high'] - (dataframe['atr'] * 2.83))\n\n        dataframe['rsi_5'] = ta.RSI(dataframe, 5)\n        dataframe['streak'] = calc_streaks(dataframe[\"close\"])\n        dataframe['srsi'] = ta.RSI(dataframe['streak'], 2)\n        dataframe['roc'] = ta.ROC(dataframe, 5)\n        dataframe['crsi'] = (dataframe['rsi_5'] + dataframe['srsi'] + dataframe['roc']) / 3\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1.value, self.buy_dip_threshold_120_2.value, self.buy_dip_threshold_120_3.value, self.buy_dip_threshold_120_4.value)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1.value, self.buy_dip_threshold_130_2.value, self.buy_dip_threshold_130_3.value, self.buy_dip_threshold_130_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe.copy()\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        buy_protection_list = []\n\n        # Protections [STANDARD] - Common to every condition\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n            if global_buy_protection_params[\"ema_fast\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len'].value}\"] > dataframe['ema_200'])\n            if global_buy_protection_params[\"ema_slow\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len'].value}_1h\"] > dataframe['ema_200_1h'])\n            if global_buy_protection_params[\"close_above_ema_fast\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len'].value}\"])\n            if global_buy_protection_params[\"close_above_ema_slow\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len'].value}_1h\"])\n            if global_buy_protection_params[\"sma200_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'].value)))\n            if global_buy_protection_params[\"sma200_1h_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'].value)))\n            if global_buy_protection_params[\"safe_dips\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type'].value}\"])\n            if global_buy_protection_params[\"safe_pump\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period'].value}_{global_buy_protection_params['safe_pump_type'].value}_1h\"])\n            if global_buy_protection_params['btc_1h_not_downtrend'].value:\n                item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n            if not self.config['runmode'].value in ('live', 'dry_run'):\n                if self.has_bt_agefilter:\n                    item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n            else:\n                if self.has_downtime_protection:\n                    item_buy_protection_list.append(dataframe['live_data_ok'])\n            buy_protection_list.append(item_buy_protection_list)\n\n        # Buy Condition #1\n        dataframe.loc[:,'buy_condition_1'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_1_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[0]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_1.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_1'] = True\n\n        # Buy Condition #2\n        dataframe.loc[:,'buy_condition_2'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_2_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[1]))\n            item_buy_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_2'] = True\n\n        # Buy Condition #3\n        dataframe.loc[:,'buy_condition_3'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_3_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[2].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[2]))\n            item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n            item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n            item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n            item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n            item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n            item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_3.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_3'] = True\n\n        # Buy Condition #4\n        dataframe.loc[:,'buy_condition_4'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_4_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[3]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n            item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_4.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_4'] = True\n\n        # Buy Condition #5\n        dataframe.loc[:,'buy_condition_5'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_5_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[4].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[4]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_5.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_5'] = True\n\n        # Buy Condition #6\n        dataframe.loc[:,'buy_condition_6'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_6_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[5]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_6'] = True\n\n        # Buy Condition #7\n        dataframe.loc[:,'buy_condition_7'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_7_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[6]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_7.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_7'] = True\n\n        # Buy Condition #8\n        dataframe.loc[:,'buy_condition_8'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_8_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[7]))\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_8.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8.value))\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_8.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_8'] = True\n\n        # Buy Condition #9\n        dataframe.loc[:,'buy_condition_9'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_9_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[8].append(dataframe['ema_50'] > dataframe['ema_200'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[8]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_9'] = True\n\n        # Buy Condition #10\n        dataframe.loc[:,'buy_condition_10'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_10_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[9].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[9]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_10'] = True\n\n        # Buy Condition #11\n        dataframe.loc[:,'buy_condition_11'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_11_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[10].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[10]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_11'] = True\n\n        # Buy Condition #12\n        dataframe.loc[:,'buy_condition_12'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_12_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[11]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_12'] = True\n\n        # Buy Condition #13\n        dataframe.loc[:,'buy_condition_13'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_13_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[12].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[12]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_13.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_13'] = True\n\n        # Buy Condition #14\n        dataframe.loc[ :,'buy_condition_14'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_14_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[13]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_14.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_14'] = True\n\n        # Buy Condition #15\n        dataframe.loc[:,'buy_condition_15'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_15_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[14].append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[14]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_15'] = True\n\n        # Buy Condition #16\n        dataframe.loc[:,'buy_condition_16'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_16_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[15]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_16.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_16'] = True\n\n        # Buy Condition #17\n        dataframe.loc[:,'buy_condition_17'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_17_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[16]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_17.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_17'] = True\n\n        # Buy Condition #18\n        dataframe.loc[:,'buy_condition_18'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_18_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[17].append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n            buy_protection_list[17].append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[17]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_18.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_18'] = True\n\n        # Buy Condition #19\n        dataframe.loc[:,'buy_condition_19'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_19_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[18]))\n            item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n            item_buy_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n            item_buy_logic.append(dataframe['moderi_32'] == True)\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['moderi_96'] == True)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_19'] = True\n\n        # Buy Condition #20\n        dataframe.loc[:,'buy_condition_20'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_20_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[19]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_20.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_20'] = True\n\n        # Buy Condition #21\n        dataframe.loc[:,'buy_condition_21'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_21_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[20]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_21'] = True\n\n        # Buy Condition #22\n        dataframe.loc[:,'buy_condition_22'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_22_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[21].append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n            buy_protection_list[21].append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[21]))\n            item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n            item_buy_logic.append(dataframe['safe_dump_20_1h'])\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_22'] = True\n\n        # Buy Condition #23\n        dataframe.loc[:,'buy_condition_23'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_23_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[22]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_23'] = True\n\n        # Buy Condition #24\n        dataframe.loc[:,'buy_condition_24'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_24_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[23]))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n            item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n            item_buy_logic.append(dataframe['cmf_1h'] > 0)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_24'] = True\n\n        # Buy Condition #25\n        dataframe.loc[:,'buy_condition_25'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_25_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[24]))\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(\n                (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n            )\n            item_buy_logic.append(dataframe['cti'] < self.buy_25_cti.value)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_25'] = True\n\n        # Buy Condition #26\n        dataframe.loc[:,'buy_condition_26'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_26_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[25]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_26_cti.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_26'] = True\n\n        # Buy Condition #27\n        dataframe.loc[:,'buy_condition_27'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_27_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[26]))\n            item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n            item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] + dataframe['rsi'] < self.buy_27_rsi_max.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_27_cti.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_27'] = True\n\n        # Buy Condition #28\n        dataframe.loc[:,'buy_condition_28'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_28_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[27]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_28_rsi.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_28_cti.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_28'] = True\n\n        # Buy Condition #29\n        dataframe.loc[:,'buy_condition_29'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_29_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[28]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_29_cti.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_29'] = True\n\n        # Buy Condition #30\n        dataframe.loc[:,'buy_condition_30'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_30_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[29]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_30_rsi.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_30_cti.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_30'] = True\n\n        # Buy Condition #31\n        dataframe.loc[:,'buy_condition_31'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_31_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[30]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset.value )\n            item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo.value)\n            item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_31'] = True\n\n        # Buy Condition #32\n        dataframe.loc[:,'buy_condition_32'] = False\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_32_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[31]))\n            item_buy_logic.append(dataframe['moderi_32'])\n            item_buy_logic.append(dataframe['moderi_64'])\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_32_cti.value)\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset.value))\n            item_buy_logic.append(\n                ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_32'] = True\n\n        # Buy Condition #33\n        dataframe.loc[:,'buy_condition_33'] = False\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_33_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[32]))\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_33_cti.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_33_rsi.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_33'] = True\n\n        # Buy Condition #34\n        dataframe.loc[:,'buy_condition_34'] = False\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_34_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[33]))\n            item_buy_logic.append(dataframe['cti'] < self.buy_34_cti.value)\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_34'] = True\n\n        # Buy Condition #35\n        # PMAX0 buy\n        # -----------------------------------------------------------------------------------------\n        dataframe.loc[:,'buy_condition_35'] = False\n        if self.buy_params['buy_condition_35_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[34]))\n            item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n            item_buy_logic.append(dataframe['ewo'] > 8.2)\n            item_buy_logic.append(dataframe['rsi'] < 32.0)\n            item_buy_logic.append(dataframe['cti'] < -0.5)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_35'] = True\n\n        # Buy Condition #36\n        dataframe.loc[:,'buy_condition_36'] = False\n        # PMAX1 buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_36_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[35]))\n            item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n            item_buy_logic.append(dataframe['ewo'] < -8.0)\n            item_buy_logic.append(dataframe['cti'] < -0.8)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_36'] = True\n\n        # Buy Condition #37\n        dataframe.loc[:,'buy_condition_37'] = False\n        # PMAX2 buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_37_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[36]))\n            item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.93)\n            item_buy_logic.append(dataframe['ewo'] > 8.0)\n            item_buy_logic.append(dataframe['rsi'] < 56.0)\n            item_buy_logic.append(dataframe['cti'] < -0.84)\n            item_buy_logic.append(dataframe['safe_dump_50_1h'])\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_37'] = True\n\n        # Buy Condition #38\n        dataframe.loc[:,'buy_condition_38'] = False\n        # PMAX3 buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_38_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[37]))\n            item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.7)\n            item_buy_logic.append(dataframe['ewo'] < -2.0)\n            item_buy_logic.append(dataframe['cti'] < -0.86)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_38'] = True\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            if not self.hold_trade_ids:\n                # We have no pairs we want to hold until profit, sell\n                return True\n\n            if trade.id not in self.hold_trade_ids:\n                # This pair is not on the list to hold until profit, sell\n                return True\n\n            trade_profit_ratio = self.hold_trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return True\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return True\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return False\n        else:\n            return True\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\ndef tsi(dataframe: DataFrame, window_slow: int, window_fast: int, fillna=False) -> Series:\n    \"\"\"\n    Indicator: True Strength Index (TSI)\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param window_slow: slow smoothing period\n    :param window_fast: fast smoothing period\n    :param fillna: If True fill NaN values\n    \"\"\"\n    df = dataframe.copy()\n\n    min_periods_slow = 0 if fillna else window_slow\n    min_periods_fast = 0 if fillna else window_fast\n\n    close_diff            = df['close'].diff()\n    close_diff_abs        = close_diff.abs()\n    smooth_close_diff     = close_diff.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n    smooth_close_diff_abs = close_diff_abs.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n\n    tsi = smooth_close_diff / smooth_close_diff_abs * 100\n\n    if fillna:\n        tsi = tsi.replace([np.inf, -np.inf], np.nan).fillna(0)\n\n    return tsi\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n"
  },
  {
    "path": "strategies/NFI7MOHO/NFI7MOHO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFI7MOHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 0.01,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_optimize=False\n    offset_sma_optimize=False\n    offset_ema_optimize=False\n    offset_trima_optimize=False\n    offset_t3_optimize=False\n    offset_kama_optimize=False\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=base_nb_candles_optimize)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=base_nb_candles_optimize)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_sma_optimize)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_sma_optimize)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_ema_optimize)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_ema_optimize)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_trima_optimize)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_trima_optimize)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_t3_optimize)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_t3_optimize)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=offset_kama_optimize)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=offset_kama_optimize)\n\n    # Protection\n    ewo_low_high_optimize=False\n    ewo_fast_slow_optimize=False\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=ewo_low_high_optimize)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=ewo_low_high_optimize)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=ewo_fast_slow_optimize)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=ewo_fast_slow_optimize)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_params = {\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_01_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_01_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_01_protection__ema_fast_len\": \"26\",\n        \"buy_01_protection__ema_slow_len\": \"50\",\n        \"buy_01_protection__safe_dips_type\": \"10\",\n        \"buy_01_protection__safe_pump_period\": \"36\",\n        \"buy_01_protection__safe_pump_type\": \"50\",\n        \"buy_01_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_01_protection__sma200_rising_val\": \"50\",\n        \"buy_02_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_02_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_02_protection__ema_fast_len\": \"50\",\n        \"buy_02_protection__ema_slow_len\": \"100\",\n        \"buy_02_protection__safe_dips_type\": \"100\",\n        # \"buy_02_protection__safe_pump_period\": \"24\",\n        # \"buy_02_protection__safe_pump_type\": \"strict\",\n        \"buy_02_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_02_protection__sma200_rising_val\": \"44\",\n        \"buy_04_protection__close_above_ema_fast_len\": \"26\",\n        \"buy_04_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_04_protection__ema_fast_len\": \"50\",\n        \"buy_04_protection__ema_slow_len\": \"26\",\n        \"buy_04_protection__safe_dips_type\": \"50\",\n        # \"buy_04_protection__safe_pump_period\": \"36\",\n        # \"buy_04_protection__safe_pump_type\": \"strict\",\n        \"buy_04_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_04_protection__sma200_rising_val\": \"20\",\n        \"buy_05_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_05_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_05_protection__ema_fast_len\": \"100\",\n        \"buy_05_protection__ema_slow_len\": \"100\",\n        \"buy_05_protection__safe_dips_type\": \"50\",\n        # \"buy_05_protection__safe_pump_period\": \"48\",\n        # \"buy_05_protection__safe_pump_type\": \"strict\",\n        \"buy_05_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_05_protection__sma200_rising_val\": \"50\",\n        \"buy_11_protection__close_above_ema_fast_len\": \"20\",\n        \"buy_11_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_11_protection__ema_fast_len\": \"26\",\n        \"buy_11_protection__ema_slow_len\": \"50\",\n        \"buy_11_protection__safe_dips_type\": \"50\",\n        # \"buy_11_protection__safe_pump_period\": \"36\",\n        # \"buy_11_protection__safe_pump_type\": \"strict\",\n        \"buy_11_protection__sma200_1h_rising_val\": \"44\",\n        \"buy_11_protection__sma200_rising_val\": \"50\",\n        \"buy_14_protection__close_above_ema_fast_len\": \"26\",\n        \"buy_14_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_14_protection__ema_fast_len\": \"100\",\n        \"buy_14_protection__ema_slow_len\": \"100\",\n        \"buy_14_protection__safe_dips_type\": \"50\",\n        # \"buy_14_protection__safe_pump_period\": \"24\",\n        # \"buy_14_protection__safe_pump_type\": \"loose\",\n        \"buy_14_protection__sma200_1h_rising_val\": \"30\",\n        \"buy_14_protection__sma200_rising_val\": \"36\",\n        \"buy_15_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_15_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_15_protection__ema_fast_len\": \"200\",\n        \"buy_15_protection__ema_slow_len\": \"200\",\n        \"buy_15_protection__safe_dips_type\": \"50\",\n        # \"buy_15_protection__safe_pump_period\": \"48\",\n        # \"buy_15_protection__safe_pump_type\": \"loose\",\n        \"buy_15_protection__sma200_1h_rising_val\": \"36\",\n        \"buy_15_protection__sma200_rising_val\": \"36\",\n        \"buy_17_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_17_protection__close_above_ema_slow_len\": \"15\",\n        \"buy_17_protection__ema_fast_len\": \"26\",\n        \"buy_17_protection__ema_slow_len\": \"200\",\n        \"buy_17_protection__safe_dips_type\": \"100\",\n        # \"buy_17_protection__safe_pump_period\": \"24\",\n        # \"buy_17_protection__safe_pump_type\": \"loose\",\n        \"buy_17_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_17_protection__sma200_rising_val\": \"44\",\n        \"buy_20_protection__close_above_ema_fast_len\": \"50\",\n        \"buy_20_protection__close_above_ema_slow_len\": \"200\",\n        \"buy_20_protection__ema_fast_len\": \"200\",\n        \"buy_20_protection__ema_slow_len\": \"100\",\n        \"buy_20_protection__safe_dips_type\": \"50\",\n        # \"buy_20_protection__safe_pump_period\": \"48\",\n        # \"buy_20_protection__safe_pump_type\": \"loose\",\n        \"buy_20_protection__sma200_1h_rising_val\": \"20\",\n        \"buy_20_protection__sma200_rising_val\": \"30\",\n        \"buy_21_protection__close_above_ema_fast_len\": \"100\",\n        \"buy_21_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_21_protection__ema_fast_len\": \"200\",\n        \"buy_21_protection__ema_slow_len\": \"100\",\n        \"buy_21_protection__safe_dips_type\": \"10\",\n        # \"buy_21_protection__safe_pump_period\": \"36\",\n        # \"buy_21_protection__safe_pump_type\": \"loose\",\n        \"buy_21_protection__sma200_1h_rising_val\": \"36\",\n        \"buy_21_protection__sma200_rising_val\": \"44\",\n        \"buy_23_protection__close_above_ema_fast_len\": \"200\",\n        \"buy_23_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_23_protection__ema_fast_len\": \"50\",\n        \"buy_23_protection__ema_slow_len\": \"50\",\n        \"buy_23_protection__safe_dips_type\": \"100\",\n        # \"buy_23_protection__safe_pump_period\": \"48\",\n        # \"buy_23_protection__safe_pump_type\": \"loose\",\n        \"buy_23_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_23_protection__sma200_rising_val\": \"50\",\n        \"buy_24_protection__close_above_ema_fast_len\": \"100\",\n        \"buy_24_protection__close_above_ema_slow_len\": \"50\",\n        \"buy_24_protection__ema_fast_len\": \"200\",\n        \"buy_24_protection__ema_slow_len\": \"26\",\n        \"buy_24_protection__safe_dips_type\": \"100\",\n        # \"buy_24_protection__safe_pump_period\": \"36\",\n        # \"buy_24_protection__safe_pump_type\": \"strict\",\n        \"buy_24_protection__sma200_1h_rising_val\": \"50\",\n        \"buy_24_protection__sma200_rising_val\": \"30\",\n        \"buy_mfi_1\": 35.1,\n        \"buy_min_inc_1\": 0.027,\n        \"buy_rsi_1\": 36.4,\n        \"buy_rsi_1h_max_1\": 80.8,\n        \"buy_rsi_1h_min_1\": 27.1,\n        \"buy_bb_offset_2\": 0.99,\n        \"buy_mfi_2\": 51.3,\n        \"buy_rsi_1h_diff_2\": 44.1,\n        \"buy_rsi_1h_max_2\": 70.7,\n        \"buy_rsi_1h_min_2\": 31.2,\n        \"buy_bb40_bbdelta_close_3\": 0.049,\n        \"buy_bb40_closedelta_close_3\": 0.021,\n        \"buy_bb40_tail_bbdelta_3\": 0.429,\n        \"buy_ema_rel_3\": 0.983,\n        \"buy_bb_offset_5\": 1.0,\n        \"buy_ema_open_mult_5\": 0.018,\n        \"buy_ema_rel_5\": 0.978,\n        \"buy_bb_offset_6\": 0.996,\n        \"buy_ema_open_mult_6\": 0.02,\n        \"buy_rsi_8\": 30.0,\n        \"buy_tail_diff_8\": 8.4,\n        \"buy_volume_8\": 6.0,\n        \"buy_bb_offset_10\": 0.988,\n        \"buy_ma_offset_10\": 0.942,\n        \"buy_rsi_1h_10\": 40.0,\n        \"buy_ma_offset_11\": 0.955,\n        \"buy_mfi_11\": 32.1,\n        \"buy_min_inc_11\": 0.006,\n        \"buy_rsi_11\": 48.8,\n        \"buy_rsi_1h_max_11\": 76.5,\n        \"buy_rsi_1h_min_11\": 59.0,\n        \"buy_ewo_12\": 5.1,\n        \"buy_ma_offset_12\": 0.936,\n        \"buy_rsi_12\": 39.9,\n        \"buy_ewo_13\": -12.2,\n        \"buy_ma_offset_13\": 0.93,\n        \"buy_bb_offset_14\": 0.986,\n        \"buy_ema_open_mult_14\": 0.012,\n        \"buy_ma_offset_14\": 0.989,\n        \"buy_ewo_17\": -14.5,\n        \"buy_ma_offset_17\": 0.979,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 28,\n        \"low_offset_ema\": 0.912,\n        \"low_offset_sma\": 0.921,\n        \"buy_chop_min_19\": 41.0,\n        \"buy_rsi_1h_min_19\": 50.9,\n        \"ewo_high\": 3.209,\n        \"ewo_low\": -19.71,\n        \"fast_ewo\": 37,\n        \"slow_ewo\": 116,\n        \"low_offset_kama\": 0.919,\n        \"low_offset_t3\": 0.977,\n        \"low_offset_trima\": 0.952,\n    }\n\n    sell_params = {\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    #############################################################\n    buy_01_protections_optimize=False\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=buy_01_protections_optimize, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=buy_01_protections_optimize, load=True)\n\n    buy_02_protections_optimize=True\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_02_protections_optimize, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_02_protections_optimize, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NFINextMOHO/NFINextMOHO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFINextMOHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n    res_timeframe = '30m'\n    info_timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 47,\n        \"buy_chop_min_19\": 41.0,\n        \"buy_rsi_1h_min_19\": 50.9,\n        \"ewo_high\": 3.28,\n        \"ewo_low\": -16.004,\n        \"low_offset_ema\": 0.93,\n        \"low_offset_kama\": 0.985,\n        \"low_offset_sma\": 0.9,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.973,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n            elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_t_4'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_24_1_1h']) & (0.1 > current_profit > 0.07) & (last_candle['rsi'] < 56.0) & (current_time - timedelta(minutes=20) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Pump protections NFI5\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['lower'] = bb_40_std2['lower']\n        dataframe['mid'] = bb_40_std2['mid']\n        dataframe['bbdelta'] = (bb_40_std2['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bb_20_std2['lower']\n        dataframe['bb_middleband'] = bb_20_std2['mid']\n        dataframe['bb_upperband'] = bb_20_std2['upper']\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n        btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n        btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        # populate informative indicators\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        # Merge informative into dataframe\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        # resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n        # resampled = self.resampled_tf_indicators(resampled, metadata)\n        # # Merge resampled info dataframe\n        # dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n        # dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n        # dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n        # drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n        # dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NFINextMOHO2/NFINextMOHO2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFINextMOHO2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 0.01,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n    res_timeframe = '30m'\n    info_timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 47,\n        \"buy_chop_min_19\": 41.0,\n        \"buy_rsi_1h_min_19\": 50.9,\n        \"ewo_high\": 3.28,\n        \"ewo_low\": -16.004,\n        \"low_offset_ema\": 0.93,\n        \"low_offset_kama\": 0.985,\n        \"low_offset_sma\": 0.9,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.973,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n            elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n                return 'signal_profit_t_4'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_24_1_1h']) & (0.1 > current_profit > 0.07) & (last_candle['rsi'] < 56.0) & (current_time - timedelta(minutes=20) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Pump protections NFI5\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['lower'] = bb_40_std2['lower']\n        dataframe['mid'] = bb_40_std2['mid']\n        dataframe['bbdelta'] = (bb_40_std2['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bb_20_std2['lower']\n        dataframe['bb_middleband'] = bb_20_std2['mid']\n        dataframe['bb_upperband'] = bb_20_std2['upper']\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n        btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n        btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n        dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        # populate informative indicators\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        # Merge informative into dataframe\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n        drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        # resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n        # resampled = self.resampled_tf_indicators(resampled, metadata)\n        # # Merge resampled info dataframe\n        # dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n        # dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n        # dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n        # drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n        # dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NFINextMultiOffsetAndHO/NFINextMultiOffsetAndHO.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7, ...], \"profit_ratio\": 0.005}                                                ##\n##                                                                                                       ##\n##                                                                                                       ##\n##   DO NOTE that `trade_ids` is a list of integers, the trade ID's, which you can get from the logs     ##\n##   or from the output of the telegram status command.                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFINextMultiOffsetAndHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        #############\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 71,\n        \"ewo_high\": 3.401,\n        \"ewo_low\": -9.459,\n        \"low_offset_ema\": 0.982,\n        \"low_offset_kama\": 0.984,\n        \"low_offset_sma\": 0.942,\n        \"low_offset_t3\": 0.973,\n        \"low_offset_trima\": 0.964,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 65,\n        \"high_offset_ema\": 1.061,\n        \"high_offset_kama\": 1.094,\n        \"high_offset_sma\": 1.059,\n        \"high_offset_t3\": 1.098,\n        \"high_offset_trima\": 1.086,\n    }\n\n   # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"26\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"28\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        2: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        3: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        4: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        5: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        6: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        7: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        8: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        9: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        10: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        11: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        12: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        13: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        14: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        15: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        16: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        17: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        18: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"44\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"72\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        19: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        20: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        21: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"90\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        22: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        23: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        24: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        25: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        26: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        27: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        28: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        29: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        30: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        31: {\n            \"enable\": CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\": CategoricalParameter([\"26\", \"50\", \"100\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\": CategoricalParameter([\"12\", \"20\", \"26\", \"50\", \"100\", \"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\": CategoricalParameter([\"15\", \"50\", \"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\": CategoricalParameter([\"20\", \"30\", \"36\", \"44\", \"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\": CategoricalParameter([\"10\", \"50\", \"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\": CategoricalParameter([\"24\", \"36\", \"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\": CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        }\n    }\n\n    buy_condition_1_enable = buy_protection_params[1][\"enable\"]\n    buy_1_protection__ema_fast = buy_protection_params[1][\"ema_fast\"]\n    buy_1_protection__ema_fast_len = buy_protection_params[1][\"ema_fast_len\"]\n    buy_1_protection__ema_slow = buy_protection_params[1][\"ema_slow\"]\n    buy_1_protection__ema_slow_len = buy_protection_params[1][\"ema_slow_len\"]\n    buy_1_protection__close_above_ema_fast = buy_protection_params[1][\"close_above_ema_fast\"]\n    buy_1_protection__close_above_ema_fast_len = buy_protection_params[1][\"close_above_ema_fast_len\"]\n    buy_1_protection__close_above_ema_slow = buy_protection_params[1][\"close_above_ema_slow\"]\n    buy_1_protection__close_above_ema_slow_len = buy_protection_params[1][\"close_above_ema_slow_len\"]\n    buy_1_protection__sma200_rising = buy_protection_params[1][\"sma200_rising\"]\n    buy_1_protection__sma200_rising_val = buy_protection_params[1][\"sma200_rising_val\"]\n    buy_1_protection__sma200_1h_rising = buy_protection_params[1][\"sma200_1h_rising\"]\n    buy_1_protection__sma200_1h_rising_val = buy_protection_params[1][\"sma200_1h_rising_val\"]\n    buy_1_protection__safe_dips = buy_protection_params[1][\"safe_dips\"]\n    buy_1_protection__safe_dips_type = buy_protection_params[1][\"safe_dips_type\"]\n    buy_1_protection__safe_pump = buy_protection_params[1][\"safe_pump\"]\n    buy_1_protection__safe_pump_type = buy_protection_params[1][\"safe_pump_type\"]\n    buy_1_protection__safe_pump_period = buy_protection_params[1][\"safe_pump_period\"]\n    buy_1_protection__btc_1h_not_downtrend = buy_protection_params[1][\"btc_1h_not_downtrend\"]\n\n    buy_condition_2_enable = buy_protection_params[2][\"enable\"]\n    buy_2_protection__ema_fast = buy_protection_params[2][\"ema_fast\"]\n    buy_2_protection__ema_fast_len = buy_protection_params[2][\"ema_fast_len\"]\n    buy_2_protection__ema_slow = buy_protection_params[2][\"ema_slow\"]\n    buy_2_protection__ema_slow_len = buy_protection_params[2][\"ema_slow_len\"]\n    buy_2_protection__close_above_ema_fast = buy_protection_params[2][\"close_above_ema_fast\"]\n    buy_2_protection__close_above_ema_fast_len = buy_protection_params[2][\"close_above_ema_fast_len\"]\n    buy_2_protection__close_above_ema_slow = buy_protection_params[2][\"close_above_ema_slow\"]\n    buy_2_protection__close_above_ema_slow_len = buy_protection_params[2][\"close_above_ema_slow_len\"]\n    buy_2_protection__sma200_rising = buy_protection_params[2][\"sma200_rising\"]\n    buy_2_protection__sma200_rising_val = buy_protection_params[2][\"sma200_rising_val\"]\n    buy_2_protection__sma200_1h_rising = buy_protection_params[2][\"sma200_1h_rising\"]\n    buy_2_protection__sma200_1h_rising_val = buy_protection_params[2][\"sma200_1h_rising_val\"]\n    buy_2_protection__safe_dips = buy_protection_params[2][\"safe_dips\"]\n    buy_2_protection__safe_dips_type = buy_protection_params[2][\"safe_dips_type\"]\n    buy_2_protection__safe_pump = buy_protection_params[2][\"safe_pump\"]\n    buy_2_protection__safe_pump_type = buy_protection_params[2][\"safe_pump_type\"]\n    buy_2_protection__safe_pump_period = buy_protection_params[2][\"safe_pump_period\"]\n    buy_2_protection__btc_1h_not_downtrend = buy_protection_params[2][\"btc_1h_not_downtrend\"]\n\n    buy_condition_3_enable = buy_protection_params[3][\"enable\"]\n    buy_3_protection__ema_fast = buy_protection_params[3][\"ema_fast\"]\n    buy_3_protection__ema_fast_len = buy_protection_params[3][\"ema_fast_len\"]\n    buy_3_protection__ema_slow = buy_protection_params[3][\"ema_slow\"]\n    buy_3_protection__ema_slow_len = buy_protection_params[3][\"ema_slow_len\"]\n    buy_3_protection__close_above_ema_fast = buy_protection_params[3][\"close_above_ema_fast\"]\n    buy_3_protection__close_above_ema_fast_len = buy_protection_params[3][\"close_above_ema_fast_len\"]\n    buy_3_protection__close_above_ema_slow = buy_protection_params[3][\"close_above_ema_slow\"]\n    buy_3_protection__close_above_ema_slow_len = buy_protection_params[3][\"close_above_ema_slow_len\"]\n    buy_3_protection__sma200_rising = buy_protection_params[3][\"sma200_rising\"]\n    buy_3_protection__sma200_rising_val = buy_protection_params[3][\"sma200_rising_val\"]\n    buy_3_protection__sma200_1h_rising = buy_protection_params[3][\"sma200_1h_rising\"]\n    buy_3_protection__sma200_1h_rising_val = buy_protection_params[3][\"sma200_1h_rising_val\"]\n    buy_3_protection__safe_dips = buy_protection_params[3][\"safe_dips\"]\n    buy_3_protection__safe_dips_type = buy_protection_params[3][\"safe_dips_type\"]\n    buy_3_protection__safe_pump = buy_protection_params[3][\"safe_pump\"]\n    buy_3_protection__safe_pump_type = buy_protection_params[3][\"safe_pump_type\"]\n    buy_3_protection__safe_pump_period = buy_protection_params[3][\"safe_pump_period\"]\n    buy_3_protection__btc_1h_not_downtrend = buy_protection_params[3][\"btc_1h_not_downtrend\"]\n\n    buy_condition_4_enable = buy_protection_params[4][\"enable\"]\n    buy_4_protection__ema_fast = buy_protection_params[4][\"ema_fast\"]\n    buy_4_protection__ema_fast_len = buy_protection_params[4][\"ema_fast_len\"]\n    buy_4_protection__ema_slow = buy_protection_params[4][\"ema_slow\"]\n    buy_4_protection__ema_slow_len = buy_protection_params[4][\"ema_slow_len\"]\n    buy_4_protection__close_above_ema_fast = buy_protection_params[4][\"close_above_ema_fast\"]\n    buy_4_protection__close_above_ema_fast_len = buy_protection_params[4][\"close_above_ema_fast_len\"]\n    buy_4_protection__close_above_ema_slow = buy_protection_params[4][\"close_above_ema_slow\"]\n    buy_4_protection__close_above_ema_slow_len = buy_protection_params[4][\"close_above_ema_slow_len\"]\n    buy_4_protection__sma200_rising = buy_protection_params[4][\"sma200_rising\"]\n    buy_4_protection__sma200_rising_val = buy_protection_params[4][\"sma200_rising_val\"]\n    buy_4_protection__sma200_1h_rising = buy_protection_params[4][\"sma200_1h_rising\"]\n    buy_4_protection__sma200_1h_rising_val = buy_protection_params[4][\"sma200_1h_rising_val\"]\n    buy_4_protection__safe_dips = buy_protection_params[4][\"safe_dips\"]\n    buy_4_protection__safe_dips_type = buy_protection_params[4][\"safe_dips_type\"]\n    buy_4_protection__safe_pump = buy_protection_params[4][\"safe_pump\"]\n    buy_4_protection__safe_pump_type = buy_protection_params[4][\"safe_pump_type\"]\n    buy_4_protection__safe_pump_period = buy_protection_params[4][\"safe_pump_period\"]\n    buy_4_protection__btc_1h_not_downtrend = buy_protection_params[4][\"btc_1h_not_downtrend\"]\n\n    buy_condition_5_enable = buy_protection_params[5][\"enable\"]\n    buy_5_protection__ema_fast = buy_protection_params[5][\"ema_fast\"]\n    buy_5_protection__ema_fast_len = buy_protection_params[5][\"ema_fast_len\"]\n    buy_5_protection__ema_slow = buy_protection_params[5][\"ema_slow\"]\n    buy_5_protection__ema_slow_len = buy_protection_params[5][\"ema_slow_len\"]\n    buy_5_protection__close_above_ema_fast = buy_protection_params[5][\"close_above_ema_fast\"]\n    buy_5_protection__close_above_ema_fast_len = buy_protection_params[5][\"close_above_ema_fast_len\"]\n    buy_5_protection__close_above_ema_slow = buy_protection_params[5][\"close_above_ema_slow\"]\n    buy_5_protection__close_above_ema_slow_len = buy_protection_params[5][\"close_above_ema_slow_len\"]\n    buy_5_protection__sma200_rising = buy_protection_params[5][\"sma200_rising\"]\n    buy_5_protection__sma200_rising_val = buy_protection_params[5][\"sma200_rising_val\"]\n    buy_5_protection__sma200_1h_rising = buy_protection_params[5][\"sma200_1h_rising\"]\n    buy_5_protection__sma200_1h_rising_val = buy_protection_params[5][\"sma200_1h_rising_val\"]\n    buy_5_protection__safe_dips = buy_protection_params[5][\"safe_dips\"]\n    buy_5_protection__safe_dips_type = buy_protection_params[5][\"safe_dips_type\"]\n    buy_5_protection__safe_pump = buy_protection_params[5][\"safe_pump\"]\n    buy_5_protection__safe_pump_type = buy_protection_params[5][\"safe_pump_type\"]\n    buy_5_protection__safe_pump_period = buy_protection_params[5][\"safe_pump_period\"]\n    buy_5_protection__btc_1h_not_downtrend = buy_protection_params[5][\"btc_1h_not_downtrend\"]\n\n    buy_condition_6_enable = buy_protection_params[6][\"enable\"]\n    buy_6_protection__ema_fast = buy_protection_params[6][\"ema_fast\"]\n    buy_6_protection__ema_fast_len = buy_protection_params[6][\"ema_fast_len\"]\n    buy_6_protection__ema_slow = buy_protection_params[6][\"ema_slow\"]\n    buy_6_protection__ema_slow_len = buy_protection_params[6][\"ema_slow_len\"]\n    buy_6_protection__close_above_ema_fast = buy_protection_params[6][\"close_above_ema_fast\"]\n    buy_6_protection__close_above_ema_fast_len = buy_protection_params[6][\"close_above_ema_fast_len\"]\n    buy_6_protection__close_above_ema_slow = buy_protection_params[6][\"close_above_ema_slow\"]\n    buy_6_protection__close_above_ema_slow_len = buy_protection_params[6][\"close_above_ema_slow_len\"]\n    buy_6_protection__sma200_rising = buy_protection_params[6][\"sma200_rising\"]\n    buy_6_protection__sma200_rising_val = buy_protection_params[6][\"sma200_rising_val\"]\n    buy_6_protection__sma200_1h_rising = buy_protection_params[6][\"sma200_1h_rising\"]\n    buy_6_protection__sma200_1h_rising_val = buy_protection_params[6][\"sma200_1h_rising_val\"]\n    buy_6_protection__safe_dips = buy_protection_params[6][\"safe_dips\"]\n    buy_6_protection__safe_dips_type = buy_protection_params[6][\"safe_dips_type\"]\n    buy_6_protection__safe_pump = buy_protection_params[6][\"safe_pump\"]\n    buy_6_protection__safe_pump_type = buy_protection_params[6][\"safe_pump_type\"]\n    buy_6_protection__safe_pump_period = buy_protection_params[6][\"safe_pump_period\"]\n    buy_6_protection__btc_1h_not_downtrend = buy_protection_params[6][\"btc_1h_not_downtrend\"]\n\n    buy_condition_7_enable = buy_protection_params[7][\"enable\"]\n    buy_7_protection__ema_fast = buy_protection_params[7][\"ema_fast\"]\n    buy_7_protection__ema_fast_len = buy_protection_params[7][\"ema_fast_len\"]\n    buy_7_protection__ema_slow = buy_protection_params[7][\"ema_slow\"]\n    buy_7_protection__ema_slow_len = buy_protection_params[7][\"ema_slow_len\"]\n    buy_7_protection__close_above_ema_fast = buy_protection_params[7][\"close_above_ema_fast\"]\n    buy_7_protection__close_above_ema_fast_len = buy_protection_params[7][\"close_above_ema_fast_len\"]\n    buy_7_protection__close_above_ema_slow = buy_protection_params[7][\"close_above_ema_slow\"]\n    buy_7_protection__close_above_ema_slow_len = buy_protection_params[7][\"close_above_ema_slow_len\"]\n    buy_7_protection__sma200_rising = buy_protection_params[7][\"sma200_rising\"]\n    buy_7_protection__sma200_rising_val = buy_protection_params[7][\"sma200_rising_val\"]\n    buy_7_protection__sma200_1h_rising = buy_protection_params[7][\"sma200_1h_rising\"]\n    buy_7_protection__sma200_1h_rising_val = buy_protection_params[7][\"sma200_1h_rising_val\"]\n    buy_7_protection__safe_dips = buy_protection_params[7][\"safe_dips\"]\n    buy_7_protection__safe_dips_type = buy_protection_params[7][\"safe_dips_type\"]\n    buy_7_protection__safe_pump = buy_protection_params[7][\"safe_pump\"]\n    buy_7_protection__safe_pump_type = buy_protection_params[7][\"safe_pump_type\"]\n    buy_7_protection__safe_pump_period = buy_protection_params[7][\"safe_pump_period\"]\n    buy_7_protection__btc_1h_not_downtrend = buy_protection_params[7][\"btc_1h_not_downtrend\"]\n\n    buy_condition_8_enable = buy_protection_params[8][\"enable\"]\n    buy_8_protection__ema_fast = buy_protection_params[8][\"ema_fast\"]\n    buy_8_protection__ema_fast_len = buy_protection_params[8][\"ema_fast_len\"]\n    buy_8_protection__ema_slow = buy_protection_params[8][\"ema_slow\"]\n    buy_8_protection__ema_slow_len = buy_protection_params[8][\"ema_slow_len\"]\n    buy_8_protection__close_above_ema_fast = buy_protection_params[8][\"close_above_ema_fast\"]\n    buy_8_protection__close_above_ema_fast_len = buy_protection_params[8][\"close_above_ema_fast_len\"]\n    buy_8_protection__close_above_ema_slow = buy_protection_params[8][\"close_above_ema_slow\"]\n    buy_8_protection__close_above_ema_slow_len = buy_protection_params[8][\"close_above_ema_slow_len\"]\n    buy_8_protection__sma200_rising = buy_protection_params[8][\"sma200_rising\"]\n    buy_8_protection__sma200_rising_val = buy_protection_params[8][\"sma200_rising_val\"]\n    buy_8_protection__sma200_1h_rising = buy_protection_params[8][\"sma200_1h_rising\"]\n    buy_8_protection__sma200_1h_rising_val = buy_protection_params[8][\"sma200_1h_rising_val\"]\n    buy_8_protection__safe_dips = buy_protection_params[8][\"safe_dips\"]\n    buy_8_protection__safe_dips_type = buy_protection_params[8][\"safe_dips_type\"]\n    buy_8_protection__safe_pump = buy_protection_params[8][\"safe_pump\"]\n    buy_8_protection__safe_pump_type = buy_protection_params[8][\"safe_pump_type\"]\n    buy_8_protection__safe_pump_period = buy_protection_params[8][\"safe_pump_period\"]\n    buy_8_protection__btc_1h_not_downtrend = buy_protection_params[8][\"btc_1h_not_downtrend\"]\n\n    buy_condition_9_enable = buy_protection_params[9][\"enable\"]\n    buy_9_protection__ema_fast = buy_protection_params[9][\"ema_fast\"]\n    buy_9_protection__ema_fast_len = buy_protection_params[9][\"ema_fast_len\"]\n    buy_9_protection__ema_slow = buy_protection_params[9][\"ema_slow\"]\n    buy_9_protection__ema_slow_len = buy_protection_params[9][\"ema_slow_len\"]\n    buy_9_protection__close_above_ema_fast = buy_protection_params[9][\"close_above_ema_fast\"]\n    buy_9_protection__close_above_ema_fast_len = buy_protection_params[9][\"close_above_ema_fast_len\"]\n    buy_9_protection__close_above_ema_slow = buy_protection_params[9][\"close_above_ema_slow\"]\n    buy_9_protection__close_above_ema_slow_len = buy_protection_params[9][\"close_above_ema_slow_len\"]\n    buy_9_protection__sma200_rising = buy_protection_params[9][\"sma200_rising\"]\n    buy_9_protection__sma200_rising_val = buy_protection_params[9][\"sma200_rising_val\"]\n    buy_9_protection__sma200_1h_rising = buy_protection_params[9][\"sma200_1h_rising\"]\n    buy_9_protection__sma200_1h_rising_val = buy_protection_params[9][\"sma200_1h_rising_val\"]\n    buy_9_protection__safe_dips = buy_protection_params[9][\"safe_dips\"]\n    buy_9_protection__safe_dips_type = buy_protection_params[9][\"safe_dips_type\"]\n    buy_9_protection__safe_pump = buy_protection_params[9][\"safe_pump\"]\n    buy_9_protection__safe_pump_type = buy_protection_params[9][\"safe_pump_type\"]\n    buy_9_protection__safe_pump_period = buy_protection_params[9][\"safe_pump_period\"]\n    buy_9_protection__btc_1h_not_downtrend = buy_protection_params[9][\"btc_1h_not_downtrend\"]\n\n    buy_condition_10_enable = buy_protection_params[10][\"enable\"]\n    buy_10_protection__ema_fast = buy_protection_params[10][\"ema_fast\"]\n    buy_10_protection__ema_fast_len = buy_protection_params[10][\"ema_fast_len\"]\n    buy_10_protection__ema_slow = buy_protection_params[10][\"ema_slow\"]\n    buy_10_protection__ema_slow_len = buy_protection_params[10][\"ema_slow_len\"]\n    buy_10_protection__close_above_ema_fast = buy_protection_params[10][\"close_above_ema_fast\"]\n    buy_10_protection__close_above_ema_fast_len = buy_protection_params[10][\"close_above_ema_fast_len\"]\n    buy_10_protection__close_above_ema_slow = buy_protection_params[10][\"close_above_ema_slow\"]\n    buy_10_protection__close_above_ema_slow_len = buy_protection_params[10][\"close_above_ema_slow_len\"]\n    buy_10_protection__sma200_rising = buy_protection_params[10][\"sma200_rising\"]\n    buy_10_protection__sma200_rising_val = buy_protection_params[10][\"sma200_rising_val\"]\n    buy_10_protection__sma200_1h_rising = buy_protection_params[10][\"sma200_1h_rising\"]\n    buy_10_protection__sma200_1h_rising_val = buy_protection_params[10][\"sma200_1h_rising_val\"]\n    buy_10_protection__safe_dips = buy_protection_params[10][\"safe_dips\"]\n    buy_10_protection__safe_dips_type = buy_protection_params[10][\"safe_dips_type\"]\n    buy_10_protection__safe_pump = buy_protection_params[10][\"safe_pump\"]\n    buy_10_protection__safe_pump_type = buy_protection_params[10][\"safe_pump_type\"]\n    buy_10_protection__safe_pump_period = buy_protection_params[10][\"safe_pump_period\"]\n    buy_10_protection__btc_1h_not_downtrend = buy_protection_params[10][\"btc_1h_not_downtrend\"]\n\n    buy_condition_11_enable = buy_protection_params[11][\"enable\"]\n    buy_11_protection__ema_fast = buy_protection_params[11][\"ema_fast\"]\n    buy_11_protection__ema_fast_len = buy_protection_params[11][\"ema_fast_len\"]\n    buy_11_protection__ema_slow = buy_protection_params[11][\"ema_slow\"]\n    buy_11_protection__ema_slow_len = buy_protection_params[11][\"ema_slow_len\"]\n    buy_11_protection__close_above_ema_fast = buy_protection_params[11][\"close_above_ema_fast\"]\n    buy_11_protection__close_above_ema_fast_len = buy_protection_params[11][\"close_above_ema_fast_len\"]\n    buy_11_protection__close_above_ema_slow = buy_protection_params[11][\"close_above_ema_slow\"]\n    buy_11_protection__close_above_ema_slow_len = buy_protection_params[11][\"close_above_ema_slow_len\"]\n    buy_11_protection__sma200_rising = buy_protection_params[11][\"sma200_rising\"]\n    buy_11_protection__sma200_rising_val = buy_protection_params[11][\"sma200_rising_val\"]\n    buy_11_protection__sma200_1h_rising = buy_protection_params[11][\"sma200_1h_rising\"]\n    buy_11_protection__sma200_1h_rising_val = buy_protection_params[11][\"sma200_1h_rising_val\"]\n    buy_11_protection__safe_dips = buy_protection_params[11][\"safe_dips\"]\n    buy_11_protection__safe_dips_type = buy_protection_params[11][\"safe_dips_type\"]\n    buy_11_protection__safe_pump = buy_protection_params[11][\"safe_pump\"]\n    buy_11_protection__safe_pump_type = buy_protection_params[11][\"safe_pump_type\"]\n    buy_11_protection__safe_pump_period = buy_protection_params[11][\"safe_pump_period\"]\n    buy_11_protection__btc_1h_not_downtrend = buy_protection_params[11][\"btc_1h_not_downtrend\"]\n\n    buy_condition_12_enable = buy_protection_params[12][\"enable\"]\n    buy_12_protection__ema_fast = buy_protection_params[12][\"ema_fast\"]\n    buy_12_protection__ema_fast_len = buy_protection_params[12][\"ema_fast_len\"]\n    buy_12_protection__ema_slow = buy_protection_params[12][\"ema_slow\"]\n    buy_12_protection__ema_slow_len = buy_protection_params[12][\"ema_slow_len\"]\n    buy_12_protection__close_above_ema_fast = buy_protection_params[12][\"close_above_ema_fast\"]\n    buy_12_protection__close_above_ema_fast_len = buy_protection_params[12][\"close_above_ema_fast_len\"]\n    buy_12_protection__close_above_ema_slow = buy_protection_params[12][\"close_above_ema_slow\"]\n    buy_12_protection__close_above_ema_slow_len = buy_protection_params[12][\"close_above_ema_slow_len\"]\n    buy_12_protection__sma200_rising = buy_protection_params[12][\"sma200_rising\"]\n    buy_12_protection__sma200_rising_val = buy_protection_params[12][\"sma200_rising_val\"]\n    buy_12_protection__sma200_1h_rising = buy_protection_params[12][\"sma200_1h_rising\"]\n    buy_12_protection__sma200_1h_rising_val = buy_protection_params[12][\"sma200_1h_rising_val\"]\n    buy_12_protection__safe_dips = buy_protection_params[12][\"safe_dips\"]\n    buy_12_protection__safe_dips_type = buy_protection_params[12][\"safe_dips_type\"]\n    buy_12_protection__safe_pump = buy_protection_params[12][\"safe_pump\"]\n    buy_12_protection__safe_pump_type = buy_protection_params[12][\"safe_pump_type\"]\n    buy_12_protection__safe_pump_period = buy_protection_params[12][\"safe_pump_period\"]\n    buy_12_protection__btc_1h_not_downtrend = buy_protection_params[12][\"btc_1h_not_downtrend\"]\n\n    buy_condition_13_enable = buy_protection_params[13][\"enable\"]\n    buy_13_protection__ema_fast = buy_protection_params[13][\"ema_fast\"]\n    buy_13_protection__ema_fast_len = buy_protection_params[13][\"ema_fast_len\"]\n    buy_13_protection__ema_slow = buy_protection_params[13][\"ema_slow\"]\n    buy_13_protection__ema_slow_len = buy_protection_params[13][\"ema_slow_len\"]\n    buy_13_protection__close_above_ema_fast = buy_protection_params[13][\"close_above_ema_fast\"]\n    buy_13_protection__close_above_ema_fast_len = buy_protection_params[13][\"close_above_ema_fast_len\"]\n    buy_13_protection__close_above_ema_slow = buy_protection_params[13][\"close_above_ema_slow\"]\n    buy_13_protection__close_above_ema_slow_len = buy_protection_params[13][\"close_above_ema_slow_len\"]\n    buy_13_protection__sma200_rising = buy_protection_params[13][\"sma200_rising\"]\n    buy_13_protection__sma200_rising_val = buy_protection_params[13][\"sma200_rising_val\"]\n    buy_13_protection__sma200_1h_rising = buy_protection_params[13][\"sma200_1h_rising\"]\n    buy_13_protection__sma200_1h_rising_val = buy_protection_params[13][\"sma200_1h_rising_val\"]\n    buy_13_protection__safe_dips = buy_protection_params[13][\"safe_dips\"]\n    buy_13_protection__safe_dips_type = buy_protection_params[13][\"safe_dips_type\"]\n    buy_13_protection__safe_pump = buy_protection_params[13][\"safe_pump\"]\n    buy_13_protection__safe_pump_type = buy_protection_params[13][\"safe_pump_type\"]\n    buy_13_protection__safe_pump_period = buy_protection_params[13][\"safe_pump_period\"]\n    buy_13_protection__btc_1h_not_downtrend = buy_protection_params[13][\"btc_1h_not_downtrend\"]\n\n    buy_condition_14_enable = buy_protection_params[14][\"enable\"]\n    buy_14_protection__ema_fast = buy_protection_params[14][\"ema_fast\"]\n    buy_14_protection__ema_fast_len = buy_protection_params[14][\"ema_fast_len\"]\n    buy_14_protection__ema_slow = buy_protection_params[14][\"ema_slow\"]\n    buy_14_protection__ema_slow_len = buy_protection_params[14][\"ema_slow_len\"]\n    buy_14_protection__close_above_ema_fast = buy_protection_params[14][\"close_above_ema_fast\"]\n    buy_14_protection__close_above_ema_fast_len = buy_protection_params[14][\"close_above_ema_fast_len\"]\n    buy_14_protection__close_above_ema_slow = buy_protection_params[14][\"close_above_ema_slow\"]\n    buy_14_protection__close_above_ema_slow_len = buy_protection_params[14][\"close_above_ema_slow_len\"]\n    buy_14_protection__sma200_rising = buy_protection_params[14][\"sma200_rising\"]\n    buy_14_protection__sma200_rising_val = buy_protection_params[14][\"sma200_rising_val\"]\n    buy_14_protection__sma200_1h_rising = buy_protection_params[14][\"sma200_1h_rising\"]\n    buy_14_protection__sma200_1h_rising_val = buy_protection_params[14][\"sma200_1h_rising_val\"]\n    buy_14_protection__safe_dips = buy_protection_params[14][\"safe_dips\"]\n    buy_14_protection__safe_dips_type = buy_protection_params[14][\"safe_dips_type\"]\n    buy_14_protection__safe_pump = buy_protection_params[14][\"safe_pump\"]\n    buy_14_protection__safe_pump_type = buy_protection_params[14][\"safe_pump_type\"]\n    buy_14_protection__safe_pump_period = buy_protection_params[14][\"safe_pump_period\"]\n    buy_14_protection__btc_1h_not_downtrend = buy_protection_params[14][\"btc_1h_not_downtrend\"]\n\n    buy_condition_15_enable = buy_protection_params[15][\"enable\"]\n    buy_15_protection__ema_fast = buy_protection_params[15][\"ema_fast\"]\n    buy_15_protection__ema_fast_len = buy_protection_params[15][\"ema_fast_len\"]\n    buy_15_protection__ema_slow = buy_protection_params[15][\"ema_slow\"]\n    buy_15_protection__ema_slow_len = buy_protection_params[15][\"ema_slow_len\"]\n    buy_15_protection__close_above_ema_fast = buy_protection_params[15][\"close_above_ema_fast\"]\n    buy_15_protection__close_above_ema_fast_len = buy_protection_params[15][\"close_above_ema_fast_len\"]\n    buy_15_protection__close_above_ema_slow = buy_protection_params[15][\"close_above_ema_slow\"]\n    buy_15_protection__close_above_ema_slow_len = buy_protection_params[15][\"close_above_ema_slow_len\"]\n    buy_15_protection__sma200_rising = buy_protection_params[15][\"sma200_rising\"]\n    buy_15_protection__sma200_rising_val = buy_protection_params[15][\"sma200_rising_val\"]\n    buy_15_protection__sma200_1h_rising = buy_protection_params[15][\"sma200_1h_rising\"]\n    buy_15_protection__sma200_1h_rising_val = buy_protection_params[15][\"sma200_1h_rising_val\"]\n    buy_15_protection__safe_dips = buy_protection_params[15][\"safe_dips\"]\n    buy_15_protection__safe_dips_type = buy_protection_params[15][\"safe_dips_type\"]\n    buy_15_protection__safe_pump = buy_protection_params[15][\"safe_pump\"]\n    buy_15_protection__safe_pump_type = buy_protection_params[15][\"safe_pump_type\"]\n    buy_15_protection__safe_pump_period = buy_protection_params[15][\"safe_pump_period\"]\n    buy_15_protection__btc_1h_not_downtrend = buy_protection_params[15][\"btc_1h_not_downtrend\"]\n\n    buy_condition_16_enable = buy_protection_params[16][\"enable\"]\n    buy_16_protection__ema_fast = buy_protection_params[16][\"ema_fast\"]\n    buy_16_protection__ema_fast_len = buy_protection_params[16][\"ema_fast_len\"]\n    buy_16_protection__ema_slow = buy_protection_params[16][\"ema_slow\"]\n    buy_16_protection__ema_slow_len = buy_protection_params[16][\"ema_slow_len\"]\n    buy_16_protection__close_above_ema_fast = buy_protection_params[16][\"close_above_ema_fast\"]\n    buy_16_protection__close_above_ema_fast_len = buy_protection_params[16][\"close_above_ema_fast_len\"]\n    buy_16_protection__close_above_ema_slow = buy_protection_params[16][\"close_above_ema_slow\"]\n    buy_16_protection__close_above_ema_slow_len = buy_protection_params[16][\"close_above_ema_slow_len\"]\n    buy_16_protection__sma200_rising = buy_protection_params[16][\"sma200_rising\"]\n    buy_16_protection__sma200_rising_val = buy_protection_params[16][\"sma200_rising_val\"]\n    buy_16_protection__sma200_1h_rising = buy_protection_params[16][\"sma200_1h_rising\"]\n    buy_16_protection__sma200_1h_rising_val = buy_protection_params[16][\"sma200_1h_rising_val\"]\n    buy_16_protection__safe_dips = buy_protection_params[16][\"safe_dips\"]\n    buy_16_protection__safe_dips_type = buy_protection_params[16][\"safe_dips_type\"]\n    buy_16_protection__safe_pump = buy_protection_params[16][\"safe_pump\"]\n    buy_16_protection__safe_pump_type = buy_protection_params[16][\"safe_pump_type\"]\n    buy_16_protection__safe_pump_period = buy_protection_params[16][\"safe_pump_period\"]\n    buy_16_protection__btc_1h_not_downtrend = buy_protection_params[16][\"btc_1h_not_downtrend\"]\n\n    buy_condition_17_enable = buy_protection_params[17][\"enable\"]\n    buy_17_protection__ema_fast = buy_protection_params[17][\"ema_fast\"]\n    buy_17_protection__ema_fast_len = buy_protection_params[17][\"ema_fast_len\"]\n    buy_17_protection__ema_slow = buy_protection_params[17][\"ema_slow\"]\n    buy_17_protection__ema_slow_len = buy_protection_params[17][\"ema_slow_len\"]\n    buy_17_protection__close_above_ema_fast = buy_protection_params[17][\"close_above_ema_fast\"]\n    buy_17_protection__close_above_ema_fast_len = buy_protection_params[17][\"close_above_ema_fast_len\"]\n    buy_17_protection__close_above_ema_slow = buy_protection_params[17][\"close_above_ema_slow\"]\n    buy_17_protection__close_above_ema_slow_len = buy_protection_params[17][\"close_above_ema_slow_len\"]\n    buy_17_protection__sma200_rising = buy_protection_params[17][\"sma200_rising\"]\n    buy_17_protection__sma200_rising_val = buy_protection_params[17][\"sma200_rising_val\"]\n    buy_17_protection__sma200_1h_rising = buy_protection_params[17][\"sma200_1h_rising\"]\n    buy_17_protection__sma200_1h_rising_val = buy_protection_params[17][\"sma200_1h_rising_val\"]\n    buy_17_protection__safe_dips = buy_protection_params[17][\"safe_dips\"]\n    buy_17_protection__safe_dips_type = buy_protection_params[17][\"safe_dips_type\"]\n    buy_17_protection__safe_pump = buy_protection_params[17][\"safe_pump\"]\n    buy_17_protection__safe_pump_type = buy_protection_params[17][\"safe_pump_type\"]\n    buy_17_protection__safe_pump_period = buy_protection_params[17][\"safe_pump_period\"]\n    buy_17_protection__btc_1h_not_downtrend = buy_protection_params[17][\"btc_1h_not_downtrend\"]\n\n    buy_condition_18_enable = buy_protection_params[18][\"enable\"]\n    buy_18_protection__ema_fast = buy_protection_params[18][\"ema_fast\"]\n    buy_18_protection__ema_fast_len = buy_protection_params[18][\"ema_fast_len\"]\n    buy_18_protection__ema_slow = buy_protection_params[18][\"ema_slow\"]\n    buy_18_protection__ema_slow_len = buy_protection_params[18][\"ema_slow_len\"]\n    buy_18_protection__close_above_ema_fast = buy_protection_params[18][\"close_above_ema_fast\"]\n    buy_18_protection__close_above_ema_fast_len = buy_protection_params[18][\"close_above_ema_fast_len\"]\n    buy_18_protection__close_above_ema_slow = buy_protection_params[18][\"close_above_ema_slow\"]\n    buy_18_protection__close_above_ema_slow_len = buy_protection_params[18][\"close_above_ema_slow_len\"]\n    buy_18_protection__sma200_rising = buy_protection_params[18][\"sma200_rising\"]\n    buy_18_protection__sma200_rising_val = buy_protection_params[18][\"sma200_rising_val\"]\n    buy_18_protection__sma200_1h_rising = buy_protection_params[18][\"sma200_1h_rising\"]\n    buy_18_protection__sma200_1h_rising_val = buy_protection_params[18][\"sma200_1h_rising_val\"]\n    buy_18_protection__safe_dips = buy_protection_params[18][\"safe_dips\"]\n    buy_18_protection__safe_dips_type = buy_protection_params[18][\"safe_dips_type\"]\n    buy_18_protection__safe_pump = buy_protection_params[18][\"safe_pump\"]\n    buy_18_protection__safe_pump_type = buy_protection_params[18][\"safe_pump_type\"]\n    buy_18_protection__safe_pump_period = buy_protection_params[18][\"safe_pump_period\"]\n    buy_18_protection__btc_1h_not_downtrend = buy_protection_params[18][\"btc_1h_not_downtrend\"]\n\n    buy_condition_19_enable = buy_protection_params[19][\"enable\"]\n    buy_19_protection__ema_fast = buy_protection_params[19][\"ema_fast\"]\n    buy_19_protection__ema_fast_len = buy_protection_params[19][\"ema_fast_len\"]\n    buy_19_protection__ema_slow = buy_protection_params[19][\"ema_slow\"]\n    buy_19_protection__ema_slow_len = buy_protection_params[19][\"ema_slow_len\"]\n    buy_19_protection__close_above_ema_fast = buy_protection_params[19][\"close_above_ema_fast\"]\n    buy_19_protection__close_above_ema_fast_len = buy_protection_params[19][\"close_above_ema_fast_len\"]\n    buy_19_protection__close_above_ema_slow = buy_protection_params[19][\"close_above_ema_slow\"]\n    buy_19_protection__close_above_ema_slow_len = buy_protection_params[19][\"close_above_ema_slow_len\"]\n    buy_19_protection__sma200_rising = buy_protection_params[19][\"sma200_rising\"]\n    buy_19_protection__sma200_rising_val = buy_protection_params[19][\"sma200_rising_val\"]\n    buy_19_protection__sma200_1h_rising = buy_protection_params[19][\"sma200_1h_rising\"]\n    buy_19_protection__sma200_1h_rising_val = buy_protection_params[19][\"sma200_1h_rising_val\"]\n    buy_19_protection__safe_dips = buy_protection_params[19][\"safe_dips\"]\n    buy_19_protection__safe_dips_type = buy_protection_params[19][\"safe_dips_type\"]\n    buy_19_protection__safe_pump = buy_protection_params[19][\"safe_pump\"]\n    buy_19_protection__safe_pump_type = buy_protection_params[19][\"safe_pump_type\"]\n    buy_19_protection__safe_pump_period = buy_protection_params[19][\"safe_pump_period\"]\n    buy_19_protection__btc_1h_not_downtrend = buy_protection_params[19][\"btc_1h_not_downtrend\"]\n\n    buy_condition_20_enable = buy_protection_params[20][\"enable\"]\n    buy_20_protection__ema_fast = buy_protection_params[20][\"ema_fast\"]\n    buy_20_protection__ema_fast_len = buy_protection_params[20][\"ema_fast_len\"]\n    buy_20_protection__ema_slow = buy_protection_params[20][\"ema_slow\"]\n    buy_20_protection__ema_slow_len = buy_protection_params[20][\"ema_slow_len\"]\n    buy_20_protection__close_above_ema_fast = buy_protection_params[20][\"close_above_ema_fast\"]\n    buy_20_protection__close_above_ema_fast_len = buy_protection_params[20][\"close_above_ema_fast_len\"]\n    buy_20_protection__close_above_ema_slow = buy_protection_params[20][\"close_above_ema_slow\"]\n    buy_20_protection__close_above_ema_slow_len = buy_protection_params[20][\"close_above_ema_slow_len\"]\n    buy_20_protection__sma200_rising = buy_protection_params[20][\"sma200_rising\"]\n    buy_20_protection__sma200_rising_val = buy_protection_params[20][\"sma200_rising_val\"]\n    buy_20_protection__sma200_1h_rising = buy_protection_params[20][\"sma200_1h_rising\"]\n    buy_20_protection__sma200_1h_rising_val = buy_protection_params[20][\"sma200_1h_rising_val\"]\n    buy_20_protection__safe_dips = buy_protection_params[20][\"safe_dips\"]\n    buy_20_protection__safe_dips_type = buy_protection_params[20][\"safe_dips_type\"]\n    buy_20_protection__safe_pump = buy_protection_params[20][\"safe_pump\"]\n    buy_20_protection__safe_pump_type = buy_protection_params[20][\"safe_pump_type\"]\n    buy_20_protection__safe_pump_period = buy_protection_params[20][\"safe_pump_period\"]\n    buy_20_protection__btc_1h_not_downtrend = buy_protection_params[20][\"btc_1h_not_downtrend\"]\n\n    buy_condition_21_enable = buy_protection_params[21][\"enable\"]\n    buy_21_protection__ema_fast = buy_protection_params[21][\"ema_fast\"]\n    buy_21_protection__ema_fast_len = buy_protection_params[21][\"ema_fast_len\"]\n    buy_21_protection__ema_slow = buy_protection_params[21][\"ema_slow\"]\n    buy_21_protection__ema_slow_len = buy_protection_params[21][\"ema_slow_len\"]\n    buy_21_protection__close_above_ema_fast = buy_protection_params[21][\"close_above_ema_fast\"]\n    buy_21_protection__close_above_ema_fast_len = buy_protection_params[21][\"close_above_ema_fast_len\"]\n    buy_21_protection__close_above_ema_slow = buy_protection_params[21][\"close_above_ema_slow\"]\n    buy_21_protection__close_above_ema_slow_len = buy_protection_params[21][\"close_above_ema_slow_len\"]\n    buy_21_protection__sma200_rising = buy_protection_params[21][\"sma200_rising\"]\n    buy_21_protection__sma200_rising_val = buy_protection_params[21][\"sma200_rising_val\"]\n    buy_21_protection__sma200_1h_rising = buy_protection_params[21][\"sma200_1h_rising\"]\n    buy_21_protection__sma200_1h_rising_val = buy_protection_params[21][\"sma200_1h_rising_val\"]\n    buy_21_protection__safe_dips = buy_protection_params[21][\"safe_dips\"]\n    buy_21_protection__safe_dips_type = buy_protection_params[21][\"safe_dips_type\"]\n    buy_21_protection__safe_pump = buy_protection_params[21][\"safe_pump\"]\n    buy_21_protection__safe_pump_type = buy_protection_params[21][\"safe_pump_type\"]\n    buy_21_protection__safe_pump_period = buy_protection_params[21][\"safe_pump_period\"]\n    buy_21_protection__btc_1h_not_downtrend = buy_protection_params[21][\"btc_1h_not_downtrend\"]\n\n    buy_condition_22_enable = buy_protection_params[22][\"enable\"]\n    buy_22_protection__ema_fast = buy_protection_params[22][\"ema_fast\"]\n    buy_22_protection__ema_fast_len = buy_protection_params[22][\"ema_fast_len\"]\n    buy_22_protection__ema_slow = buy_protection_params[22][\"ema_slow\"]\n    buy_22_protection__ema_slow_len = buy_protection_params[22][\"ema_slow_len\"]\n    buy_22_protection__close_above_ema_fast = buy_protection_params[22][\"close_above_ema_fast\"]\n    buy_22_protection__close_above_ema_fast_len = buy_protection_params[22][\"close_above_ema_fast_len\"]\n    buy_22_protection__close_above_ema_slow = buy_protection_params[22][\"close_above_ema_slow\"]\n    buy_22_protection__close_above_ema_slow_len = buy_protection_params[22][\"close_above_ema_slow_len\"]\n    buy_22_protection__sma200_rising = buy_protection_params[22][\"sma200_rising\"]\n    buy_22_protection__sma200_rising_val = buy_protection_params[22][\"sma200_rising_val\"]\n    buy_22_protection__sma200_1h_rising = buy_protection_params[22][\"sma200_1h_rising\"]\n    buy_22_protection__sma200_1h_rising_val = buy_protection_params[22][\"sma200_1h_rising_val\"]\n    buy_22_protection__safe_dips = buy_protection_params[22][\"safe_dips\"]\n    buy_22_protection__safe_dips_type = buy_protection_params[22][\"safe_dips_type\"]\n    buy_22_protection__safe_pump = buy_protection_params[22][\"safe_pump\"]\n    buy_22_protection__safe_pump_type = buy_protection_params[22][\"safe_pump_type\"]\n    buy_22_protection__safe_pump_period = buy_protection_params[22][\"safe_pump_period\"]\n    buy_22_protection__btc_1h_not_downtrend = buy_protection_params[22][\"btc_1h_not_downtrend\"]\n\n    buy_condition_23_enable = buy_protection_params[23][\"enable\"]\n    buy_23_protection__ema_fast = buy_protection_params[23][\"ema_fast\"]\n    buy_23_protection__ema_fast_len = buy_protection_params[23][\"ema_fast_len\"]\n    buy_23_protection__ema_slow = buy_protection_params[23][\"ema_slow\"]\n    buy_23_protection__ema_slow_len = buy_protection_params[23][\"ema_slow_len\"]\n    buy_23_protection__close_above_ema_fast = buy_protection_params[23][\"close_above_ema_fast\"]\n    buy_23_protection__close_above_ema_fast_len = buy_protection_params[23][\"close_above_ema_fast_len\"]\n    buy_23_protection__close_above_ema_slow = buy_protection_params[23][\"close_above_ema_slow\"]\n    buy_23_protection__close_above_ema_slow_len = buy_protection_params[23][\"close_above_ema_slow_len\"]\n    buy_23_protection__sma200_rising = buy_protection_params[23][\"sma200_rising\"]\n    buy_23_protection__sma200_rising_val = buy_protection_params[23][\"sma200_rising_val\"]\n    buy_23_protection__sma200_1h_rising = buy_protection_params[23][\"sma200_1h_rising\"]\n    buy_23_protection__sma200_1h_rising_val = buy_protection_params[23][\"sma200_1h_rising_val\"]\n    buy_23_protection__safe_dips = buy_protection_params[23][\"safe_dips\"]\n    buy_23_protection__safe_dips_type = buy_protection_params[23][\"safe_dips_type\"]\n    buy_23_protection__safe_pump = buy_protection_params[23][\"safe_pump\"]\n    buy_23_protection__safe_pump_type = buy_protection_params[23][\"safe_pump_type\"]\n    buy_23_protection__safe_pump_period = buy_protection_params[23][\"safe_pump_period\"]\n    buy_23_protection__btc_1h_not_downtrend = buy_protection_params[23][\"btc_1h_not_downtrend\"]\n\n    buy_condition_24_enable = buy_protection_params[24][\"enable\"]\n    buy_24_protection__ema_fast = buy_protection_params[24][\"ema_fast\"]\n    buy_24_protection__ema_fast_len = buy_protection_params[24][\"ema_fast_len\"]\n    buy_24_protection__ema_slow = buy_protection_params[24][\"ema_slow\"]\n    buy_24_protection__ema_slow_len = buy_protection_params[24][\"ema_slow_len\"]\n    buy_24_protection__close_above_ema_fast = buy_protection_params[24][\"close_above_ema_fast\"]\n    buy_24_protection__close_above_ema_fast_len = buy_protection_params[24][\"close_above_ema_fast_len\"]\n    buy_24_protection__close_above_ema_slow = buy_protection_params[24][\"close_above_ema_slow\"]\n    buy_24_protection__close_above_ema_slow_len = buy_protection_params[24][\"close_above_ema_slow_len\"]\n    buy_24_protection__sma200_rising = buy_protection_params[24][\"sma200_rising\"]\n    buy_24_protection__sma200_rising_val = buy_protection_params[24][\"sma200_rising_val\"]\n    buy_24_protection__sma200_1h_rising = buy_protection_params[24][\"sma200_1h_rising\"]\n    buy_24_protection__sma200_1h_rising_val = buy_protection_params[24][\"sma200_1h_rising_val\"]\n    buy_24_protection__safe_dips = buy_protection_params[24][\"safe_dips\"]\n    buy_24_protection__safe_dips_type = buy_protection_params[24][\"safe_dips_type\"]\n    buy_24_protection__safe_pump = buy_protection_params[24][\"safe_pump\"]\n    buy_24_protection__safe_pump_type = buy_protection_params[24][\"safe_pump_type\"]\n    buy_24_protection__safe_pump_period = buy_protection_params[24][\"safe_pump_period\"]\n    buy_24_protection__btc_1h_not_downtrend = buy_protection_params[24][\"btc_1h_not_downtrend\"]\n\n    buy_condition_25_enable = buy_protection_params[25][\"enable\"]\n    buy_25_protection__ema_fast = buy_protection_params[25][\"ema_fast\"]\n    buy_25_protection__ema_fast_len = buy_protection_params[25][\"ema_fast_len\"]\n    buy_25_protection__ema_slow = buy_protection_params[25][\"ema_slow\"]\n    buy_25_protection__ema_slow_len = buy_protection_params[25][\"ema_slow_len\"]\n    buy_25_protection__close_above_ema_fast = buy_protection_params[25][\"close_above_ema_fast\"]\n    buy_25_protection__close_above_ema_fast_len = buy_protection_params[25][\"close_above_ema_fast_len\"]\n    buy_25_protection__close_above_ema_slow = buy_protection_params[25][\"close_above_ema_slow\"]\n    buy_25_protection__close_above_ema_slow_len = buy_protection_params[25][\"close_above_ema_slow_len\"]\n    buy_25_protection__sma200_rising = buy_protection_params[25][\"sma200_rising\"]\n    buy_25_protection__sma200_rising_val = buy_protection_params[25][\"sma200_rising_val\"]\n    buy_25_protection__sma200_1h_rising = buy_protection_params[25][\"sma200_1h_rising\"]\n    buy_25_protection__sma200_1h_rising_val = buy_protection_params[25][\"sma200_1h_rising_val\"]\n    buy_25_protection__safe_dips = buy_protection_params[25][\"safe_dips\"]\n    buy_25_protection__safe_dips_type = buy_protection_params[25][\"safe_dips_type\"]\n    buy_25_protection__safe_pump = buy_protection_params[25][\"safe_pump\"]\n    buy_25_protection__safe_pump_type = buy_protection_params[25][\"safe_pump_type\"]\n    buy_25_protection__safe_pump_period = buy_protection_params[25][\"safe_pump_period\"]\n    buy_25_protection__btc_1h_not_downtrend = buy_protection_params[25][\"btc_1h_not_downtrend\"]\n\n    buy_condition_26_enable = buy_protection_params[26][\"enable\"]\n    buy_26_protection__ema_fast = buy_protection_params[26][\"ema_fast\"]\n    buy_26_protection__ema_fast_len = buy_protection_params[26][\"ema_fast_len\"]\n    buy_26_protection__ema_slow = buy_protection_params[26][\"ema_slow\"]\n    buy_26_protection__ema_slow_len = buy_protection_params[26][\"ema_slow_len\"]\n    buy_26_protection__close_above_ema_fast = buy_protection_params[26][\"close_above_ema_fast\"]\n    buy_26_protection__close_above_ema_fast_len = buy_protection_params[26][\"close_above_ema_fast_len\"]\n    buy_26_protection__close_above_ema_slow = buy_protection_params[26][\"close_above_ema_slow\"]\n    buy_26_protection__close_above_ema_slow_len = buy_protection_params[26][\"close_above_ema_slow_len\"]\n    buy_26_protection__sma200_rising = buy_protection_params[26][\"sma200_rising\"]\n    buy_26_protection__sma200_rising_val = buy_protection_params[26][\"sma200_rising_val\"]\n    buy_26_protection__sma200_1h_rising = buy_protection_params[26][\"sma200_1h_rising\"]\n    buy_26_protection__sma200_1h_rising_val = buy_protection_params[26][\"sma200_1h_rising_val\"]\n    buy_26_protection__safe_dips = buy_protection_params[26][\"safe_dips\"]\n    buy_26_protection__safe_dips_type = buy_protection_params[26][\"safe_dips_type\"]\n    buy_26_protection__safe_pump = buy_protection_params[26][\"safe_pump\"]\n    buy_26_protection__safe_pump_type = buy_protection_params[26][\"safe_pump_type\"]\n    buy_26_protection__safe_pump_period = buy_protection_params[26][\"safe_pump_period\"]\n    buy_26_protection__btc_1h_not_downtrend = buy_protection_params[26][\"btc_1h_not_downtrend\"]\n\n    buy_condition_27_enable = buy_protection_params[27][\"enable\"]\n    buy_27_protection__ema_fast = buy_protection_params[27][\"ema_fast\"]\n    buy_27_protection__ema_fast_len = buy_protection_params[27][\"ema_fast_len\"]\n    buy_27_protection__ema_slow = buy_protection_params[27][\"ema_slow\"]\n    buy_27_protection__ema_slow_len = buy_protection_params[27][\"ema_slow_len\"]\n    buy_27_protection__close_above_ema_fast = buy_protection_params[27][\"close_above_ema_fast\"]\n    buy_27_protection__close_above_ema_fast_len = buy_protection_params[27][\"close_above_ema_fast_len\"]\n    buy_27_protection__close_above_ema_slow = buy_protection_params[27][\"close_above_ema_slow\"]\n    buy_27_protection__close_above_ema_slow_len = buy_protection_params[27][\"close_above_ema_slow_len\"]\n    buy_27_protection__sma200_rising = buy_protection_params[27][\"sma200_rising\"]\n    buy_27_protection__sma200_rising_val = buy_protection_params[27][\"sma200_rising_val\"]\n    buy_27_protection__sma200_1h_rising = buy_protection_params[27][\"sma200_1h_rising\"]\n    buy_27_protection__sma200_1h_rising_val = buy_protection_params[27][\"sma200_1h_rising_val\"]\n    buy_27_protection__safe_dips = buy_protection_params[27][\"safe_dips\"]\n    buy_27_protection__safe_dips_type = buy_protection_params[27][\"safe_dips_type\"]\n    buy_27_protection__safe_pump = buy_protection_params[27][\"safe_pump\"]\n    buy_27_protection__safe_pump_type = buy_protection_params[27][\"safe_pump_type\"]\n    buy_27_protection__safe_pump_period = buy_protection_params[27][\"safe_pump_period\"]\n    buy_27_protection__btc_1h_not_downtrend = buy_protection_params[27][\"btc_1h_not_downtrend\"]\n\n    buy_condition_28_enable = buy_protection_params[28][\"enable\"]\n    buy_28_protection__ema_fast = buy_protection_params[28][\"ema_fast\"]\n    buy_28_protection__ema_fast_len = buy_protection_params[28][\"ema_fast_len\"]\n    buy_28_protection__ema_slow = buy_protection_params[28][\"ema_slow\"]\n    buy_28_protection__ema_slow_len = buy_protection_params[28][\"ema_slow_len\"]\n    buy_28_protection__close_above_ema_fast = buy_protection_params[28][\"close_above_ema_fast\"]\n    buy_28_protection__close_above_ema_fast_len = buy_protection_params[28][\"close_above_ema_fast_len\"]\n    buy_28_protection__close_above_ema_slow = buy_protection_params[28][\"close_above_ema_slow\"]\n    buy_28_protection__close_above_ema_slow_len = buy_protection_params[28][\"close_above_ema_slow_len\"]\n    buy_28_protection__sma200_rising = buy_protection_params[28][\"sma200_rising\"]\n    buy_28_protection__sma200_rising_val = buy_protection_params[28][\"sma200_rising_val\"]\n    buy_28_protection__sma200_1h_rising = buy_protection_params[28][\"sma200_1h_rising\"]\n    buy_28_protection__sma200_1h_rising_val = buy_protection_params[28][\"sma200_1h_rising_val\"]\n    buy_28_protection__safe_dips = buy_protection_params[28][\"safe_dips\"]\n    buy_28_protection__safe_dips_type = buy_protection_params[28][\"safe_dips_type\"]\n    buy_28_protection__safe_pump = buy_protection_params[28][\"safe_pump\"]\n    buy_28_protection__safe_pump_type = buy_protection_params[28][\"safe_pump_type\"]\n    buy_28_protection__safe_pump_period = buy_protection_params[28][\"safe_pump_period\"]\n    buy_28_protection__btc_1h_not_downtrend = buy_protection_params[28][\"btc_1h_not_downtrend\"]\n\n    buy_condition_29_enable = buy_protection_params[29][\"enable\"]\n    buy_29_protection__ema_fast = buy_protection_params[29][\"ema_fast\"]\n    buy_29_protection__ema_fast_len = buy_protection_params[29][\"ema_fast_len\"]\n    buy_29_protection__ema_slow = buy_protection_params[29][\"ema_slow\"]\n    buy_29_protection__ema_slow_len = buy_protection_params[29][\"ema_slow_len\"]\n    buy_29_protection__close_above_ema_fast = buy_protection_params[29][\"close_above_ema_fast\"]\n    buy_29_protection__close_above_ema_fast_len = buy_protection_params[29][\"close_above_ema_fast_len\"]\n    buy_29_protection__close_above_ema_slow = buy_protection_params[29][\"close_above_ema_slow\"]\n    buy_29_protection__close_above_ema_slow_len = buy_protection_params[29][\"close_above_ema_slow_len\"]\n    buy_29_protection__sma200_rising = buy_protection_params[29][\"sma200_rising\"]\n    buy_29_protection__sma200_rising_val = buy_protection_params[29][\"sma200_rising_val\"]\n    buy_29_protection__sma200_1h_rising = buy_protection_params[29][\"sma200_1h_rising\"]\n    buy_29_protection__sma200_1h_rising_val = buy_protection_params[29][\"sma200_1h_rising_val\"]\n    buy_29_protection__safe_dips = buy_protection_params[29][\"safe_dips\"]\n    buy_29_protection__safe_dips_type = buy_protection_params[29][\"safe_dips_type\"]\n    buy_29_protection__safe_pump = buy_protection_params[29][\"safe_pump\"]\n    buy_29_protection__safe_pump_type = buy_protection_params[29][\"safe_pump_type\"]\n    buy_29_protection__safe_pump_period = buy_protection_params[29][\"safe_pump_period\"]\n    buy_29_protection__btc_1h_not_downtrend = buy_protection_params[29][\"btc_1h_not_downtrend\"]\n\n    buy_condition_30_enable = buy_protection_params[30][\"enable\"]\n    buy_30_protection__ema_fast = buy_protection_params[30][\"ema_fast\"]\n    buy_30_protection__ema_fast_len = buy_protection_params[30][\"ema_fast_len\"]\n    buy_30_protection__ema_slow = buy_protection_params[30][\"ema_slow\"]\n    buy_30_protection__ema_slow_len = buy_protection_params[30][\"ema_slow_len\"]\n    buy_30_protection__close_above_ema_fast = buy_protection_params[30][\"close_above_ema_fast\"]\n    buy_30_protection__close_above_ema_fast_len = buy_protection_params[30][\"close_above_ema_fast_len\"]\n    buy_30_protection__close_above_ema_slow = buy_protection_params[30][\"close_above_ema_slow\"]\n    buy_30_protection__close_above_ema_slow_len = buy_protection_params[30][\"close_above_ema_slow_len\"]\n    buy_30_protection__sma200_rising = buy_protection_params[30][\"sma200_rising\"]\n    buy_30_protection__sma200_rising_val = buy_protection_params[30][\"sma200_rising_val\"]\n    buy_30_protection__sma200_1h_rising = buy_protection_params[30][\"sma200_1h_rising\"]\n    buy_30_protection__sma200_1h_rising_val = buy_protection_params[30][\"sma200_1h_rising_val\"]\n    buy_30_protection__safe_dips = buy_protection_params[30][\"safe_dips\"]\n    buy_30_protection__safe_dips_type = buy_protection_params[30][\"safe_dips_type\"]\n    buy_30_protection__safe_pump = buy_protection_params[30][\"safe_pump\"]\n    buy_30_protection__safe_pump_type = buy_protection_params[30][\"safe_pump_type\"]\n    buy_30_protection__safe_pump_period = buy_protection_params[30][\"safe_pump_period\"]\n    buy_30_protection__btc_1h_not_downtrend = buy_protection_params[30][\"btc_1h_not_downtrend\"]\n\n    buy_condition_31_enable = buy_protection_params[31][\"enable\"]\n    buy_31_protection__ema_fast = buy_protection_params[31][\"ema_fast\"]\n    buy_31_protection__ema_fast_len = buy_protection_params[31][\"ema_fast_len\"]\n    buy_31_protection__ema_slow = buy_protection_params[31][\"ema_slow\"]\n    buy_31_protection__ema_slow_len = buy_protection_params[31][\"ema_slow_len\"]\n    buy_31_protection__close_above_ema_fast = buy_protection_params[31][\"close_above_ema_fast\"]\n    buy_31_protection__close_above_ema_fast_len = buy_protection_params[31][\"close_above_ema_fast_len\"]\n    buy_31_protection__close_above_ema_slow = buy_protection_params[31][\"close_above_ema_slow\"]\n    buy_31_protection__close_above_ema_slow_len = buy_protection_params[31][\"close_above_ema_slow_len\"]\n    buy_31_protection__sma200_rising = buy_protection_params[31][\"sma200_rising\"]\n    buy_31_protection__sma200_rising_val = buy_protection_params[31][\"sma200_rising_val\"]\n    buy_31_protection__sma200_1h_rising = buy_protection_params[31][\"sma200_1h_rising\"]\n    buy_31_protection__sma200_1h_rising_val = buy_protection_params[31][\"sma200_1h_rising_val\"]\n    buy_31_protection__safe_dips = buy_protection_params[31][\"safe_dips\"]\n    buy_31_protection__safe_dips_type = buy_protection_params[31][\"safe_dips_type\"]\n    buy_31_protection__safe_pump = buy_protection_params[31][\"safe_pump\"]\n    buy_31_protection__safe_pump_type = buy_protection_params[31][\"safe_pump_type\"]\n    buy_31_protection__safe_pump_period = buy_protection_params[31][\"safe_pump_period\"]\n    buy_31_protection__btc_1h_not_downtrend = buy_protection_params[31][\"btc_1h_not_downtrend\"]\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(\n        0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(\n        0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(\n        0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(\n        0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(\n        0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(\n        0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(\n        0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(\n        0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(\n        0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(\n        0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(\n        0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(\n        0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(\n        0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(\n        0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(\n        0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(\n        0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(\n        0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(\n        0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(\n        0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(\n        0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(\n        0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(\n        0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(\n        0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(\n        0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(\n        0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(\n        0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(\n        0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(\n        0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(\n        0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(\n        0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(\n        0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(\n        0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(\n        0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(\n        0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(\n        0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(\n        0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(\n        0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(\n        0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(\n        0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(\n        0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(\n        0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(\n        0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(\n        0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(\n        0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(\n        1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(\n        0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(\n        0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(\n        0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(\n        1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(\n        0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(\n        0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(\n        0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(\n        1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(\n        0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(\n        0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(\n        0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(\n        1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(\n        0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(\n        0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(\n        1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(\n        0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(\n        0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(\n        0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(\n        0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(\n        0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(\n        0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(\n        0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(\n        0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(\n        0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(\n        0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(\n        0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(\n        0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(\n        0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(\n        0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(\n        0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(\n        1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(\n        0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(\n        1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(\n        0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(\n        1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(\n        0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(\n        1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(\n        0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(\n        1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(\n        0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(\n        1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(\n        0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(\n        1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(\n        1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(\n        1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(\n        0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(\n        1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(\n        0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(\n        1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(\n        1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(\n        0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(\n        0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(\n        0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(\n        0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(\n        0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(\n        0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022,\n                                     space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(\n        25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(\n        70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy',\n                                 decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=44.0, space='buy',\n                                 decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(\n        30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(\n        70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(\n        30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy',\n                                 decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(\n        0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(\n        0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(\n        0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(\n        0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986,\n                                     space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(\n        0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(\n        1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(\n        0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(\n        0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944,\n                                     space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(\n        0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(\n        0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(\n        0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy',\n                                 decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy',\n                                    decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy',\n                                 decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(\n        3.0, 10.0, default=2.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922,\n                                       space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942,\n                                       space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(\n        26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(\n        70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy',\n                                 decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(\n        0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(\n        0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0,\n                                     space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(\n        0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01,\n                                      space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(\n        40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(\n        70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(\n        0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy',\n                                  decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(\n        0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy',\n                                  decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(\n        0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(\n        0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(\n        0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(\n        0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(\n        0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988,\n                                      space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(\n        0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy',\n                                  decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(\n        0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8,\n                                  space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(\n        0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(\n        40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(\n        20.0, 60.0, default=22.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0,\n                                     space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0,\n                                     space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy',\n                                  decimals=2, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy',\n                                     decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(\n        0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(\n        0.93, 0.98, default=0.941, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(\n        0.97, 1.0, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy',\n                                  decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0,\n                                     space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0,\n                                      space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(\n        40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(\n        0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_14 = DecimalParameter(26.0, 40.0, default=38.0,\n                                     space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(\n        0.90, 0.99, default=0.93, space='buy', optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(95, 99, default=95.4, space='buy',\n                                     decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(\n        90, 99, default=97.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(\n        40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter(\n        [True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(\n        0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(\n        0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(\n        0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(\n        0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(\n        3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(\n        0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(\n        0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(\n        0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(\n        0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5,\n                                     space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(\n        72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(\n        77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(\n        72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(\n        78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(\n        0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(\n        0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(\n        72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7,\n                                     space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(\n        1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_0 = DecimalParameter(\n        0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(\n        30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(\n        0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(\n        30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(\n        0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(\n        30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(\n        0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(\n        30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(\n        0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(\n        35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(\n        0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(\n        35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(\n        0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(\n        38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(\n        0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(\n        40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(\n        0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(\n        40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(\n        0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(\n        40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(\n        0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(\n        38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(\n        0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(\n        28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(\n        0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(\n        28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(\n        0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(\n        36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(\n        0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(\n        46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(\n        0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(\n        50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(\n        0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(\n        50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(\n        0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(\n        46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(\n        0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(\n        44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(\n        0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(\n        46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(\n        0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(\n        40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(\n        0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(\n        40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(\n        0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(\n        30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(\n        0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(\n        24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(\n        26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(\n        0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(\n        36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(\n        0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(\n        38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(\n        0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(\n        36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(\n        0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(\n        20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(\n        26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(\n        0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(\n        36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(\n        0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(\n        38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(\n        0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(\n        36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(\n        0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(\n        20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(\n        0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(\n        26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(\n        0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(\n        34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(\n        0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(\n        38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(\n        0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(\n        36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(\n        0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(\n        20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(\n        0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(\n        0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(\n        0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(\n        0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(\n        0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(\n        0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(\n        0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(\n        16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(\n        30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(\n        0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(\n        0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(\n        0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(\n        16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(\n        30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(\n        0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(\n        0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(\n        0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(\n        0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(\n        0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(\n        0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_1 = DecimalParameter(\n        0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(\n        0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(\n        0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(\n        0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(\n        0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(\n        0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(\n        0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(\n        0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(\n        -0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(\n        -0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(\n        0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(\n        0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(\n        0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(\n        30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(\n        0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(\n        0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(\n        0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(\n        0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(\n        0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(\n        0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(\n        0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(\n        0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(\n        0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(\n        0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(\n        0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(\n        0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(\n        0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(\n        16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(\n        30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(\n        0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(\n        -0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(\n        -0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(\n        0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(\n        0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(\n        -0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(\n        0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(\n        0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(\n        -0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(\n        0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(\n        0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(\n        0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(\n        0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(\n        0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(\n        0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(\n        32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(\n        0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(\n        0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(\n        700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = hold_trade_ids_profit_ratio = None\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None and self.hold_trade_ids_profit_ratio is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = set()\n        self.hold_trade_ids_profit_ratio = 0.005\n\n        # Update values from config file, if it exists\n        strat_directory = pathlib.Path(__file__).resolve().parent\n        hold_trades_config_file = strat_directory / \"hold-trades.json\"\n        if not hold_trades_config_file.is_file():\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                    else:\n                        self.hold_trade_ids_profit_ratio = profit_ratio\n                open_trades = {\n                    trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n                }\n                formatted_profit_ratio = \"{}%\".format(self.hold_trade_ids_profit_ratio * 100)\n                for trade_id in hold_trades_config.get(\"trade_ids\", ()):\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids.add(trade_id)\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if current_profit > self.sell_custom_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_11.value:\n                    return True, 'signal_profit_11'\n            elif self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_10.value:\n                    return True, 'signal_profit_10'\n            elif self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_9.value:\n                    return True, 'signal_profit_9'\n            elif self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_8.value:\n                    return True, 'signal_profit_8'\n            elif self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_7'\n            elif self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_6'\n            elif self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_5'\n            elif self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_4'\n            elif self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_3'\n            elif self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_2'\n            elif self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_1'\n            elif self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_0'\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if current_profit > self.sell_custom_under_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_11.value:\n                    return True, 'signal_profit_u_11'\n            elif self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_10.value:\n                    return True, 'signal_profit_u_10'\n            elif self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_9.value:\n                    return True, 'signal_profit_u_9'\n            elif self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_8.value:\n                    return True, 'signal_profit_u_8'\n            elif self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_7.value:\n                    return True, 'signal_profit_u_7'\n            elif self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_6.value:\n                    return True, 'signal_profit_u_6'\n            elif self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_5.value:\n                    return True, 'signal_profit_u_5'\n            elif self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_4.value:\n                    return True, 'signal_profit_u_4'\n            elif self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_3.value:\n                    return True, 'signal_profit_u_3'\n            elif self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_2.value:\n                    return True, 'signal_profit_u_2'\n            elif self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_1.value:\n                    return True, 'signal_profit_u_1'\n            elif self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_u_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)) & (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) & (0.2 > current_profit > 0.07) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (current_profit > self.sell_custom_profit_under_profit_1.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit > self.sell_custom_profit_under_profit_2.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime', max_loss: float, max_profit: float) -> tuple:\n        if (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < -0.2) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_stoploss_u_1'\n\n        # Under EMA200, pair & BTC negative, low max rate\n        elif (-0.1 > current_profit > -0.14) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (max_profit < 0.005) & (max_loss < 0.14) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -50.0):\n            return True, 'signal_stoploss_u_b_1'\n\n        # Under EMA200, pair & BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (-0.1 > current_profit > -0.2) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (last_candle['moderi_96'] == False) & (max_profit < 0.05) & (max_loss < 0.2) & (last_candle['sma_200_dec_24']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['cmf'] < -0.45) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -97.0):\n            return True, 'signal_stoploss_u_b_2'\n\n        elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_1'\n\n        elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n            return True, 'signal_stoploss_p_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n            return True, 'signal_stoploss_p_3'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit > 0.02:\n            if last_candle['r_480'] > -2.1:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit > 0.03:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit > 0.04:\n            if last_candle['r_480'] > -2.3:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit > 0.05:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit > 0.06:\n            if last_candle['r_480'] > -2.5:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit > 0.07:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit > 0.08:\n            if last_candle['r_480'] > -5.5:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit > 0.09:\n            if last_candle['r_480'] > -3.0:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit > 0.1:\n            if last_candle['r_480'] > -8.0:\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -1.5) & (last_candle['rsi'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -2.1) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -2.3) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit > 0.05:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit > 0.06:\n            if (last_candle['r_480'] > -2.5) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit > 0.07:\n            if (last_candle['r_480'] > -34.0) & (last_candle['rsi'] > 80.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit > 0.08:\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit > 0.09:\n            if (last_candle['r_480'] > -2.8) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 81.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 81.5) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -29.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -30.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit > 0.012):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit > 0.02):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit > 0.03):\n            if (last_candle['r_480'] > -5.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit > 0.04):\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit > 0.05):\n            if (last_candle['r_480'] > -24.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit > 0.06):\n            if (last_candle['r_480'] > -26.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit > 0.07):\n            if (last_candle['r_480'] > -20.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit > 0.08):\n            if (last_candle['r_480'] > -18.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit > 0.09):\n            if (last_candle['r_480'] > -16.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit > 0.1):\n            if (last_candle['r_480'] > -5.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit > 0.12):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit > 0.2):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle_1 = dataframe.iloc[-2].squeeze()\n        previous_candle_2 = dataframe.iloc[-3].squeeze()\n        previous_candle_3 = dataframe.iloc[-4].squeeze()\n        previous_candle_4 = dataframe.iloc[-5].squeeze()\n        previous_candle_5 = dataframe.iloc[-6].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None) & (previous_candle_1 is not None) & (previous_candle_2 is not None) & (previous_candle_3 is not None) & (previous_candle_4 is not None) & (previous_candle_5 is not None):\n            # Over EMA200, main profit targets\n            sell, signal_name = self.sell_over_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Under EMA200, main profit targets\n            sell, signal_name = self.sell_under_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # The pair is pumped\n            sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # The pair is descending\n            sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Trailing\n            sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Duration based\n            sell, signal_name = self.sell_duration_main(\n                current_profit, last_candle, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Under EMA200, exit with any profit\n            sell, signal_name = self.sell_under_min(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Stoplosses\n            sell, signal_name = self.sell_stoploss(\n                current_profit, last_candle, trade, current_time, max_loss, max_profit)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Pumped descending pairs\n            sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Extra sells for pumped pairs\n            sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Extra sells for trades that recovered\n            sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 1\n            sell, signal_name = self.sell_r_1(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 2\n            sell, signal_name = self.sell_r_2(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 3\n            sell, signal_name = self.sell_r_3(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 4, plus CTI\n            sell, signal_name = self.sell_r_4(current_profit, last_candle)\n            if (sell) and (signal_name is not None):\n                return signal_name\n\n            # Sell signal 1\n            if self.sell_condition_1_enable.value & (last_candle['rsi'] > self.sell_rsi_bb_1.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) & (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) & (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) & (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n                return 'sell_signal_1'\n\n            # Sell signal 2\n            elif (self.sell_condition_2_enable.value) & (last_candle['rsi'] > self.sell_rsi_bb_2.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n                if (last_candle['close'] > last_candle['ema_200']):\n                    if (current_profit > 0.0):\n                        return 'sell_signal_2_1_1'\n                    elif (max_loss > 0.07):\n                        return 'sell_signal_2_1_2'\n                else:\n                    return 'sell_signal_2_2'\n\n            # Sell signal 3\n            # elif (self.sell_condition_3_enable.value) & (last_candle['rsi'] > self.sell_rsi_main_3.value):\n            #     return 'sell_signal_3'\n\n            # Sell signal 4\n            elif self.sell_condition_4_enable.value & (last_candle['rsi'] > self.sell_dual_rsi_rsi_4.value) & (last_candle['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n                return 'sell_signal_4'\n\n            # Sell signal 6\n            elif self.sell_condition_6_enable.value & (last_candle['close'] < last_candle['ema_200']) & (last_candle['close'] > last_candle['ema_50']) & (last_candle['rsi'] > self.sell_rsi_under_6.value):\n                return 'sell_signal_6'\n\n            # Sell signal 7\n            elif self.sell_condition_7_enable.value & (last_candle['rsi_1h'] > self.sell_rsi_1h_7.value) & (last_candle['crossed_below_ema_12_26']):\n                return 'sell_signal_7'\n\n            # Sell signal 8\n            elif self.sell_condition_8_enable.value & (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n                return 'sell_signal_8'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return (df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min()\n        elif method == 'OC':\n            return (df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return (df['open'] - df['close']) / df['close']\n        else:\n            return (df['open'].rolling(length).max() - df['close']) / df['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['open'].rolling(length).max() - df['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['close'] - df['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(\n            20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(\n            informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(\n            informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(\n            informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (\n            informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (\n            informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (\n            informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (\n            informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (\n            informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (\n            informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (\n            informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (\n            informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (\n            informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (\n            informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (\n            informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (\n            informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (\n            informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (\n            informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (\n            informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop'] = qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3,\n                               fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # TSI\n        dataframe['tsi_slow'] = tsi(dataframe, window_slow=20, window_fast=5)\n        dataframe['tsi_ema_slow'] = ta.EMA(dataframe['tsi_slow'], timeperiod=5)\n\n        dataframe['tsi_fast'] = tsi(dataframe, window_slow=4, window_fast=2)\n        dataframe['tsi_ema_fast'] = ta.EMA(dataframe['tsi_fast'], timeperiod=2)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(\n            dataframe['ema_12'], dataframe['ema_26'])\n\n        # Dip protection\n        dataframe['tpct_change_0'] = self.top_percent_change(dataframe, 0)\n        dataframe['tpct_change_2'] = self.top_percent_change(dataframe, 2)\n        dataframe['tpct_change_12'] = self.top_percent_change(dataframe, 12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe, 144)\n\n        dataframe['safe_dips_10'] = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value,\n                                                   self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20'] = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value,\n                                                   self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30'] = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value,\n                                                   self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40'] = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value,\n                                                   self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50'] = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value,\n                                                   self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60'] = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value,\n                                                   self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70'] = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value,\n                                                   self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80'] = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value,\n                                                   self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90'] = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value,\n                                                   self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value,\n                                                    self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value,\n                                                    self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" +\n                         s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = (\n            (dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" +\n                         s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(\n                dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe)\n                            for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(\n                dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe)\n                            for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(\n                dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe)\n                             if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(\n                self.res_timeframe.replace(\"m\", \"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        buy_protection_list = []\n\n        # Protections [STANDARD] - Common to every condition\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n            if global_buy_protection_params[\"ema_fast\"].value:\n                item_buy_protection_list.append(\n                    dataframe[f\"ema_{global_buy_protection_params['ema_fast_len'].value}\"] > dataframe['ema_200'])\n            if global_buy_protection_params[\"ema_slow\"].value:\n                item_buy_protection_list.append(\n                    dataframe[f\"ema_{global_buy_protection_params['ema_slow_len'].value}_1h\"] > dataframe['ema_200_1h'])\n            if global_buy_protection_params[\"close_above_ema_fast\"].value:\n                item_buy_protection_list.append(\n                    dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len'].value}\"])\n            if global_buy_protection_params[\"close_above_ema_slow\"].value:\n                item_buy_protection_list.append(\n                    dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len'].value}_1h\"])\n            if global_buy_protection_params[\"sma200_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(\n                    int(global_buy_protection_params['sma200_rising_val'].value)))\n            if global_buy_protection_params[\"sma200_1h_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(\n                    int(global_buy_protection_params['sma200_1h_rising_val'].value)))\n            if global_buy_protection_params[\"safe_dips\"].value:\n                item_buy_protection_list.append(\n                    dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type'].value}\"])\n            if global_buy_protection_params[\"safe_pump\"].value:\n                item_buy_protection_list.append(\n                    dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period'].value}_{global_buy_protection_params['safe_pump_type'].value}_1h\"])\n            if global_buy_protection_params['btc_1h_not_downtrend'].value:\n                item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n            buy_protection_list.append(item_buy_protection_list)\n\n        # Buy Condition #1\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_1_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[0]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) /\n                                  dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #2\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_2_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[1]))\n            item_buy_logic.append(\n                dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #3\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_3_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[2].append(dataframe['close'] > (\n                dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[2]))\n            item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n            item_buy_logic.append(dataframe['bb40_2_delta'].gt(\n                dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n            item_buy_logic.append(dataframe['closedelta'].gt(\n                dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n            item_buy_logic.append(dataframe['tail'].lt(\n                dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n            item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n            item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #4\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_4_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[3]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n            item_buy_logic.append(\n                dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n            item_buy_logic.append(dataframe['volume'] < (\n                dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #5\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_5_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[4].append(dataframe['close'] > (\n                dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[4]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12'])\n                                  > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n            item_buy_logic.append(\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #6\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_6_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[5]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12'])\n                                  > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n            item_buy_logic.append(\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #7\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_7_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[6]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12'])\n                                  > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n            item_buy_logic.append(\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n            item_buy_logic.append(dataframe['cti'] < -0.7)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #8\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_8_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[7]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n            item_buy_logic.append(dataframe['volume'] > (\n                dataframe['volume'].shift(1) * self.buy_volume_8.value))\n            item_buy_logic.append(dataframe['close'] > dataframe['open'])\n            item_buy_logic.append((dataframe['close'] - dataframe['low']) >\n                                  ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #9\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_9_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[8].append(dataframe['ema_50'] > dataframe['ema_200'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[8]))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['ema_20'] * self.buy_ma_offset_9.value)\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #10\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_10_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[9].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[9]))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['sma_30'] * self.buy_ma_offset_10.value)\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #11\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_11_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[10].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n            buy_protection_list[10].append(dataframe['safe_pump_36_50_1h'])\n            buy_protection_list[10].append(dataframe['safe_pump_48_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[10]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) /\n                                  dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['sma_30'] * self.buy_ma_offset_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #12\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_12_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[11]))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['sma_30'] * self.buy_ma_offset_12.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #13\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_13_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[12].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n            # buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[12]))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['sma_30'] * self.buy_ma_offset_13.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #14\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_14_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[13]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12'])\n                                  > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n            item_buy_logic.append(\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['ema_20'] * self.buy_ma_offset_14.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #15\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_15_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[14].append(\n                dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[14]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12'])\n                                  > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n            item_buy_logic.append(\n                (dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #16\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_16_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[15]))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['ema_20'] * self.buy_ma_offset_16.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #17\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_17_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[16]))\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['ema_20'] * self.buy_ma_offset_17.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #18\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_18_enable']:\n            # Non-Standard protections (add below)\n            # buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n            buy_protection_list[17].append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n            buy_protection_list[17].append(dataframe['sma_200_1h'] >\n                                           dataframe['sma_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[17]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #19\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_19_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[18].append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[18]))\n            item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n            item_buy_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #20\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_20_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[19]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #21\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_21_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[20]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #22\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_22_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[21].append(dataframe['ema_100_1h'] >\n                                           dataframe['ema_100_1h'].shift(12))\n            buy_protection_list[21].append(dataframe['ema_200_1h'] >\n                                           dataframe['ema_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[21]))\n            item_buy_logic.append((dataframe['volume_mean_4'] *\n                                  self.buy_volume_22.value) > dataframe['volume'])\n            item_buy_logic.append(dataframe['close'] <\n                                  dataframe['sma_30'] * self.buy_ma_offset_22.value)\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n            item_buy_logic.append(dataframe['safe_dump_20_1h'])\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #23\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_23_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[22]))\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #24\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_24_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[23]))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) <\n                                  dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) <\n                                  dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n            item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n            item_buy_logic.append(dataframe['cmf_1h'] > 0)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #25\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_25_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[24]))\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_14.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(dataframe['open'] > (\n                dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(\n                (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                (dataframe['open'] > dataframe['ema_20_1h']) & (\n                    dataframe['low'] > dataframe['ema_20_1h'])\n            )\n            item_buy_logic.append(dataframe['cti'] < -0.6)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #26\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_26_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[25]))\n            item_buy_logic.append(dataframe['close'] < (\n                dataframe['zema'] * self.buy_26_zema_low_offset.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #27\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_27_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[26]))\n            item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n            item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] +\n                                  dataframe['rsi'] < self.buy_27_rsi_max.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #28\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_28_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[27]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * 0.92)\n            item_buy_logic.append(dataframe['ewo'] > 12.4)\n            item_buy_logic.append(dataframe['rsi'] < 38.0)\n            item_buy_logic.append(dataframe['cti'] < -0.6)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #29\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_29_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[28]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * 0.9)\n            item_buy_logic.append(dataframe['ewo'] < -4.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #30\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_30_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[29]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * 0.97)\n            item_buy_logic.append(dataframe['ewo'] > 9.0)\n            item_buy_logic.append(dataframe['rsi'] < 42.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #31\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_31_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[30]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * 0.94)\n            item_buy_logic.append(dataframe['ewo'] < -19.0)\n            item_buy_logic.append(dataframe['r_480'] < -99.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n            )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n            )\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n        else:\n            dataframe.loc[:, \"sell\"] = 0\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trade_ids:\n            # We have no pairs we want to hold until profit, sell\n            return True\n        if trade.id not in self.hold_trade_ids:\n            # This pair is not on the list to hold until profit, sell\n            return True\n        if trade.calc_profit_ratio(rate) >= self.hold_trade_ids_profit_ratio:\n            # This pair is on the list to hold, and we reached minimum profit, sell\n            return True\n        # This pair is on the list to hold, and we haven't reached minimum profit, hold\n        return False\n\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\ndef tsi(dataframe: DataFrame, window_slow: int, window_fast: int, fillna=False) -> Series:\n    \"\"\"\n    Indicator: True Strength Index (TSI)\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param window_slow: slow smoothing period\n    :param window_fast: fast smoothing period\n    :param fillna: If True fill NaN values\n    \"\"\"\n    df = dataframe.copy()\n\n    min_periods_slow = 0 if fillna else window_slow\n    min_periods_fast = 0 if fillna else window_fast\n\n    close_diff = df['close'].diff()\n    close_diff_abs = close_diff.abs()\n    smooth_close_diff = close_diff.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean(\n    ).ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n    smooth_close_diff_abs = close_diff_abs.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean(\n    ).ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n\n    tsi = smooth_close_diff / smooth_close_diff_abs * 100\n\n    if fillna:\n        tsi = tsi.replace([np.inf, -np.inf], np.nan).fillna(0)\n\n    return tsi\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag = int(math.floor((timeperiod - 1) / 2))\n    if isinstance(dataframe, Series):\n        ema_data = dataframe + (dataframe - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close'] + (dataframe['close'] - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod=timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag = int(math.floor((timeperiod - 1) / 2))\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close'] - dataframe['close'] .shift(lag))\n\n    return ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) -\n        ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) -\n            ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) -\n            ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n"
  },
  {
    "path": "strategies/NFINextMultiOffsetAndHO2/NFINextMultiOffsetAndHO2.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7, ...], \"profit_ratio\": 0.005}                                                ##\n##                                                                                                       ##\n##                                                                                                       ##\n##   DO NOTE that `trade_ids` is a list of integers, the trade ID's, which you can get from the logs     ##\n##   or from the output of the telegram status command.                                                  ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NFINextMultiOffsetAndHO2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        #############\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 71,\n        \"ewo_high\": 3.401,\n        \"ewo_low\": -9.459,\n        \"low_offset_ema\": 0.982,\n        \"low_offset_kama\": 0.984,\n        \"low_offset_sma\": 0.942,\n        \"low_offset_t3\": 0.973,\n        \"low_offset_trima\": 0.964,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 65,\n        \"high_offset_ema\": 1.061,\n        \"high_offset_kama\": 1.094,\n        \"high_offset_sma\": 1.059,\n        \"high_offset_t3\": 1.098,\n        \"high_offset_trima\": 1.086,\n    }\n\n   # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        2: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        3: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        4: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        5: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        6: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        7: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        8: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        9: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        10: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        11: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        12: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        13: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        14: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        15: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        16: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        17: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        18: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        19: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        20: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        21: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        22: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        23: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        24: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        25: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        26: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        27: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        28: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        29: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        30: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        31: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        32: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        33: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        34: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        }\n    }\n\n    buy_condition_1_enable = buy_protection_params[1][\"enable\"]\n    buy_1_protection__ema_fast                 = buy_protection_params[1][\"ema_fast\"]\n    buy_1_protection__ema_fast_len             = buy_protection_params[1][\"ema_fast_len\"]\n    buy_1_protection__ema_slow                 = buy_protection_params[1][\"ema_slow\"]\n    buy_1_protection__ema_slow_len             = buy_protection_params[1][\"ema_slow_len\"]\n    buy_1_protection__close_above_ema_fast     = buy_protection_params[1][\"close_above_ema_fast\"]\n    buy_1_protection__close_above_ema_fast_len = buy_protection_params[1][\"close_above_ema_fast_len\"]\n    buy_1_protection__close_above_ema_slow     = buy_protection_params[1][\"close_above_ema_slow\"]\n    buy_1_protection__close_above_ema_slow_len = buy_protection_params[1][\"close_above_ema_slow_len\"]\n    buy_1_protection__sma200_rising            = buy_protection_params[1][\"sma200_rising\"]\n    buy_1_protection__sma200_rising_val        = buy_protection_params[1][\"sma200_rising_val\"]\n    buy_1_protection__sma200_1h_rising         = buy_protection_params[1][\"sma200_1h_rising\"]\n    buy_1_protection__sma200_1h_rising_val     = buy_protection_params[1][\"sma200_1h_rising_val\"]\n    buy_1_protection__safe_dips                = buy_protection_params[1][\"safe_dips\"]\n    buy_1_protection__safe_dips_type           = buy_protection_params[1][\"safe_dips_type\"]\n    buy_1_protection__safe_pump                = buy_protection_params[1][\"safe_pump\"]\n    buy_1_protection__safe_pump_type           = buy_protection_params[1][\"safe_pump_type\"]\n    buy_1_protection__safe_pump_period         = buy_protection_params[1][\"safe_pump_period\"]\n    buy_1_protection__btc_1h_not_downtrend     = buy_protection_params[1][\"btc_1h_not_downtrend\"]\n\n    buy_condition_2_enable = buy_protection_params[2][\"enable\"]\n    buy_2_protection__ema_fast                 = buy_protection_params[2][\"ema_fast\"]\n    buy_2_protection__ema_fast_len             = buy_protection_params[2][\"ema_fast_len\"]\n    buy_2_protection__ema_slow                 = buy_protection_params[2][\"ema_slow\"]\n    buy_2_protection__ema_slow_len             = buy_protection_params[2][\"ema_slow_len\"]\n    buy_2_protection__close_above_ema_fast     = buy_protection_params[2][\"close_above_ema_fast\"]\n    buy_2_protection__close_above_ema_fast_len = buy_protection_params[2][\"close_above_ema_fast_len\"]\n    buy_2_protection__close_above_ema_slow     = buy_protection_params[2][\"close_above_ema_slow\"]\n    buy_2_protection__close_above_ema_slow_len = buy_protection_params[2][\"close_above_ema_slow_len\"]\n    buy_2_protection__sma200_rising            = buy_protection_params[2][\"sma200_rising\"]\n    buy_2_protection__sma200_rising_val        = buy_protection_params[2][\"sma200_rising_val\"]\n    buy_2_protection__sma200_1h_rising         = buy_protection_params[2][\"sma200_1h_rising\"]\n    buy_2_protection__sma200_1h_rising_val     = buy_protection_params[2][\"sma200_1h_rising_val\"]\n    buy_2_protection__safe_dips                = buy_protection_params[2][\"safe_dips\"]\n    buy_2_protection__safe_dips_type           = buy_protection_params[2][\"safe_dips_type\"]\n    buy_2_protection__safe_pump                = buy_protection_params[2][\"safe_pump\"]\n    buy_2_protection__safe_pump_type           = buy_protection_params[2][\"safe_pump_type\"]\n    buy_2_protection__safe_pump_period         = buy_protection_params[2][\"safe_pump_period\"]\n    buy_2_protection__btc_1h_not_downtrend     = buy_protection_params[2][\"btc_1h_not_downtrend\"]\n\n    buy_condition_3_enable = buy_protection_params[3][\"enable\"]\n    buy_3_protection__ema_fast                 = buy_protection_params[3][\"ema_fast\"]\n    buy_3_protection__ema_fast_len             = buy_protection_params[3][\"ema_fast_len\"]\n    buy_3_protection__ema_slow                 = buy_protection_params[3][\"ema_slow\"]\n    buy_3_protection__ema_slow_len             = buy_protection_params[3][\"ema_slow_len\"]\n    buy_3_protection__close_above_ema_fast     = buy_protection_params[3][\"close_above_ema_fast\"]\n    buy_3_protection__close_above_ema_fast_len = buy_protection_params[3][\"close_above_ema_fast_len\"]\n    buy_3_protection__close_above_ema_slow     = buy_protection_params[3][\"close_above_ema_slow\"]\n    buy_3_protection__close_above_ema_slow_len = buy_protection_params[3][\"close_above_ema_slow_len\"]\n    buy_3_protection__sma200_rising            = buy_protection_params[3][\"sma200_rising\"]\n    buy_3_protection__sma200_rising_val        = buy_protection_params[3][\"sma200_rising_val\"]\n    buy_3_protection__sma200_1h_rising         = buy_protection_params[3][\"sma200_1h_rising\"]\n    buy_3_protection__sma200_1h_rising_val     = buy_protection_params[3][\"sma200_1h_rising_val\"]\n    buy_3_protection__safe_dips                = buy_protection_params[3][\"safe_dips\"]\n    buy_3_protection__safe_dips_type           = buy_protection_params[3][\"safe_dips_type\"]\n    buy_3_protection__safe_pump                = buy_protection_params[3][\"safe_pump\"]\n    buy_3_protection__safe_pump_type           = buy_protection_params[3][\"safe_pump_type\"]\n    buy_3_protection__safe_pump_period         = buy_protection_params[3][\"safe_pump_period\"]\n    buy_3_protection__btc_1h_not_downtrend     = buy_protection_params[3][\"btc_1h_not_downtrend\"]\n\n    buy_condition_4_enable = buy_protection_params[4][\"enable\"]\n    buy_4_protection__ema_fast                 = buy_protection_params[4][\"ema_fast\"]\n    buy_4_protection__ema_fast_len             = buy_protection_params[4][\"ema_fast_len\"]\n    buy_4_protection__ema_slow                 = buy_protection_params[4][\"ema_slow\"]\n    buy_4_protection__ema_slow_len             = buy_protection_params[4][\"ema_slow_len\"]\n    buy_4_protection__close_above_ema_fast     = buy_protection_params[4][\"close_above_ema_fast\"]\n    buy_4_protection__close_above_ema_fast_len = buy_protection_params[4][\"close_above_ema_fast_len\"]\n    buy_4_protection__close_above_ema_slow     = buy_protection_params[4][\"close_above_ema_slow\"]\n    buy_4_protection__close_above_ema_slow_len = buy_protection_params[4][\"close_above_ema_slow_len\"]\n    buy_4_protection__sma200_rising            = buy_protection_params[4][\"sma200_rising\"]\n    buy_4_protection__sma200_rising_val        = buy_protection_params[4][\"sma200_rising_val\"]\n    buy_4_protection__sma200_1h_rising         = buy_protection_params[4][\"sma200_1h_rising\"]\n    buy_4_protection__sma200_1h_rising_val     = buy_protection_params[4][\"sma200_1h_rising_val\"]\n    buy_4_protection__safe_dips                = buy_protection_params[4][\"safe_dips\"]\n    buy_4_protection__safe_dips_type           = buy_protection_params[4][\"safe_dips_type\"]\n    buy_4_protection__safe_pump                = buy_protection_params[4][\"safe_pump\"]\n    buy_4_protection__safe_pump_type           = buy_protection_params[4][\"safe_pump_type\"]\n    buy_4_protection__safe_pump_period         = buy_protection_params[4][\"safe_pump_period\"]\n    buy_4_protection__btc_1h_not_downtrend     = buy_protection_params[4][\"btc_1h_not_downtrend\"]\n\n    buy_condition_5_enable = buy_protection_params[5][\"enable\"]\n    buy_5_protection__ema_fast                 = buy_protection_params[5][\"ema_fast\"]\n    buy_5_protection__ema_fast_len             = buy_protection_params[5][\"ema_fast_len\"]\n    buy_5_protection__ema_slow                 = buy_protection_params[5][\"ema_slow\"]\n    buy_5_protection__ema_slow_len             = buy_protection_params[5][\"ema_slow_len\"]\n    buy_5_protection__close_above_ema_fast     = buy_protection_params[5][\"close_above_ema_fast\"]\n    buy_5_protection__close_above_ema_fast_len = buy_protection_params[5][\"close_above_ema_fast_len\"]\n    buy_5_protection__close_above_ema_slow     = buy_protection_params[5][\"close_above_ema_slow\"]\n    buy_5_protection__close_above_ema_slow_len = buy_protection_params[5][\"close_above_ema_slow_len\"]\n    buy_5_protection__sma200_rising            = buy_protection_params[5][\"sma200_rising\"]\n    buy_5_protection__sma200_rising_val        = buy_protection_params[5][\"sma200_rising_val\"]\n    buy_5_protection__sma200_1h_rising         = buy_protection_params[5][\"sma200_1h_rising\"]\n    buy_5_protection__sma200_1h_rising_val     = buy_protection_params[5][\"sma200_1h_rising_val\"]\n    buy_5_protection__safe_dips                = buy_protection_params[5][\"safe_dips\"]\n    buy_5_protection__safe_dips_type           = buy_protection_params[5][\"safe_dips_type\"]\n    buy_5_protection__safe_pump                = buy_protection_params[5][\"safe_pump\"]\n    buy_5_protection__safe_pump_type           = buy_protection_params[5][\"safe_pump_type\"]\n    buy_5_protection__safe_pump_period         = buy_protection_params[5][\"safe_pump_period\"]\n    buy_5_protection__btc_1h_not_downtrend     = buy_protection_params[5][\"btc_1h_not_downtrend\"]\n\n    buy_condition_6_enable = buy_protection_params[6][\"enable\"]\n    buy_6_protection__ema_fast                 = buy_protection_params[6][\"ema_fast\"]\n    buy_6_protection__ema_fast_len             = buy_protection_params[6][\"ema_fast_len\"]\n    buy_6_protection__ema_slow                 = buy_protection_params[6][\"ema_slow\"]\n    buy_6_protection__ema_slow_len             = buy_protection_params[6][\"ema_slow_len\"]\n    buy_6_protection__close_above_ema_fast     = buy_protection_params[6][\"close_above_ema_fast\"]\n    buy_6_protection__close_above_ema_fast_len = buy_protection_params[6][\"close_above_ema_fast_len\"]\n    buy_6_protection__close_above_ema_slow     = buy_protection_params[6][\"close_above_ema_slow\"]\n    buy_6_protection__close_above_ema_slow_len = buy_protection_params[6][\"close_above_ema_slow_len\"]\n    buy_6_protection__sma200_rising            = buy_protection_params[6][\"sma200_rising\"]\n    buy_6_protection__sma200_rising_val        = buy_protection_params[6][\"sma200_rising_val\"]\n    buy_6_protection__sma200_1h_rising         = buy_protection_params[6][\"sma200_1h_rising\"]\n    buy_6_protection__sma200_1h_rising_val     = buy_protection_params[6][\"sma200_1h_rising_val\"]\n    buy_6_protection__safe_dips                = buy_protection_params[6][\"safe_dips\"]\n    buy_6_protection__safe_dips_type           = buy_protection_params[6][\"safe_dips_type\"]\n    buy_6_protection__safe_pump                = buy_protection_params[6][\"safe_pump\"]\n    buy_6_protection__safe_pump_type           = buy_protection_params[6][\"safe_pump_type\"]\n    buy_6_protection__safe_pump_period         = buy_protection_params[6][\"safe_pump_period\"]\n    buy_6_protection__btc_1h_not_downtrend     = buy_protection_params[6][\"btc_1h_not_downtrend\"]\n\n    buy_condition_7_enable = buy_protection_params[7][\"enable\"]\n    buy_7_protection__ema_fast                 = buy_protection_params[7][\"ema_fast\"]\n    buy_7_protection__ema_fast_len             = buy_protection_params[7][\"ema_fast_len\"]\n    buy_7_protection__ema_slow                 = buy_protection_params[7][\"ema_slow\"]\n    buy_7_protection__ema_slow_len             = buy_protection_params[7][\"ema_slow_len\"]\n    buy_7_protection__close_above_ema_fast     = buy_protection_params[7][\"close_above_ema_fast\"]\n    buy_7_protection__close_above_ema_fast_len = buy_protection_params[7][\"close_above_ema_fast_len\"]\n    buy_7_protection__close_above_ema_slow     = buy_protection_params[7][\"close_above_ema_slow\"]\n    buy_7_protection__close_above_ema_slow_len = buy_protection_params[7][\"close_above_ema_slow_len\"]\n    buy_7_protection__sma200_rising            = buy_protection_params[7][\"sma200_rising\"]\n    buy_7_protection__sma200_rising_val        = buy_protection_params[7][\"sma200_rising_val\"]\n    buy_7_protection__sma200_1h_rising         = buy_protection_params[7][\"sma200_1h_rising\"]\n    buy_7_protection__sma200_1h_rising_val     = buy_protection_params[7][\"sma200_1h_rising_val\"]\n    buy_7_protection__safe_dips                = buy_protection_params[7][\"safe_dips\"]\n    buy_7_protection__safe_dips_type           = buy_protection_params[7][\"safe_dips_type\"]\n    buy_7_protection__safe_pump                = buy_protection_params[7][\"safe_pump\"]\n    buy_7_protection__safe_pump_type           = buy_protection_params[7][\"safe_pump_type\"]\n    buy_7_protection__safe_pump_period         = buy_protection_params[7][\"safe_pump_period\"]\n    buy_7_protection__btc_1h_not_downtrend     = buy_protection_params[7][\"btc_1h_not_downtrend\"]\n\n    buy_condition_8_enable = buy_protection_params[8][\"enable\"]\n    buy_8_protection__ema_fast                 = buy_protection_params[8][\"ema_fast\"]\n    buy_8_protection__ema_fast_len             = buy_protection_params[8][\"ema_fast_len\"]\n    buy_8_protection__ema_slow                 = buy_protection_params[8][\"ema_slow\"]\n    buy_8_protection__ema_slow_len             = buy_protection_params[8][\"ema_slow_len\"]\n    buy_8_protection__close_above_ema_fast     = buy_protection_params[8][\"close_above_ema_fast\"]\n    buy_8_protection__close_above_ema_fast_len = buy_protection_params[8][\"close_above_ema_fast_len\"]\n    buy_8_protection__close_above_ema_slow     = buy_protection_params[8][\"close_above_ema_slow\"]\n    buy_8_protection__close_above_ema_slow_len = buy_protection_params[8][\"close_above_ema_slow_len\"]\n    buy_8_protection__sma200_rising            = buy_protection_params[8][\"sma200_rising\"]\n    buy_8_protection__sma200_rising_val        = buy_protection_params[8][\"sma200_rising_val\"]\n    buy_8_protection__sma200_1h_rising         = buy_protection_params[8][\"sma200_1h_rising\"]\n    buy_8_protection__sma200_1h_rising_val     = buy_protection_params[8][\"sma200_1h_rising_val\"]\n    buy_8_protection__safe_dips                = buy_protection_params[8][\"safe_dips\"]\n    buy_8_protection__safe_dips_type           = buy_protection_params[8][\"safe_dips_type\"]\n    buy_8_protection__safe_pump                = buy_protection_params[8][\"safe_pump\"]\n    buy_8_protection__safe_pump_type           = buy_protection_params[8][\"safe_pump_type\"]\n    buy_8_protection__safe_pump_period         = buy_protection_params[8][\"safe_pump_period\"]\n    buy_8_protection__btc_1h_not_downtrend     = buy_protection_params[8][\"btc_1h_not_downtrend\"]\n\n    buy_condition_9_enable = buy_protection_params[9][\"enable\"]\n    buy_9_protection__ema_fast                 = buy_protection_params[9][\"ema_fast\"]\n    buy_9_protection__ema_fast_len             = buy_protection_params[9][\"ema_fast_len\"]\n    buy_9_protection__ema_slow                 = buy_protection_params[9][\"ema_slow\"]\n    buy_9_protection__ema_slow_len             = buy_protection_params[9][\"ema_slow_len\"]\n    buy_9_protection__close_above_ema_fast     = buy_protection_params[9][\"close_above_ema_fast\"]\n    buy_9_protection__close_above_ema_fast_len = buy_protection_params[9][\"close_above_ema_fast_len\"]\n    buy_9_protection__close_above_ema_slow     = buy_protection_params[9][\"close_above_ema_slow\"]\n    buy_9_protection__close_above_ema_slow_len = buy_protection_params[9][\"close_above_ema_slow_len\"]\n    buy_9_protection__sma200_rising            = buy_protection_params[9][\"sma200_rising\"]\n    buy_9_protection__sma200_rising_val        = buy_protection_params[9][\"sma200_rising_val\"]\n    buy_9_protection__sma200_1h_rising         = buy_protection_params[9][\"sma200_1h_rising\"]\n    buy_9_protection__sma200_1h_rising_val     = buy_protection_params[9][\"sma200_1h_rising_val\"]\n    buy_9_protection__safe_dips                = buy_protection_params[9][\"safe_dips\"]\n    buy_9_protection__safe_dips_type           = buy_protection_params[9][\"safe_dips_type\"]\n    buy_9_protection__safe_pump                = buy_protection_params[9][\"safe_pump\"]\n    buy_9_protection__safe_pump_type           = buy_protection_params[9][\"safe_pump_type\"]\n    buy_9_protection__safe_pump_period         = buy_protection_params[9][\"safe_pump_period\"]\n    buy_9_protection__btc_1h_not_downtrend     = buy_protection_params[9][\"btc_1h_not_downtrend\"]\n\n    buy_condition_10_enable = buy_protection_params[10][\"enable\"]\n    buy_10_protection__ema_fast                 = buy_protection_params[10][\"ema_fast\"]\n    buy_10_protection__ema_fast_len             = buy_protection_params[10][\"ema_fast_len\"]\n    buy_10_protection__ema_slow                 = buy_protection_params[10][\"ema_slow\"]\n    buy_10_protection__ema_slow_len             = buy_protection_params[10][\"ema_slow_len\"]\n    buy_10_protection__close_above_ema_fast     = buy_protection_params[10][\"close_above_ema_fast\"]\n    buy_10_protection__close_above_ema_fast_len = buy_protection_params[10][\"close_above_ema_fast_len\"]\n    buy_10_protection__close_above_ema_slow     = buy_protection_params[10][\"close_above_ema_slow\"]\n    buy_10_protection__close_above_ema_slow_len = buy_protection_params[10][\"close_above_ema_slow_len\"]\n    buy_10_protection__sma200_rising            = buy_protection_params[10][\"sma200_rising\"]\n    buy_10_protection__sma200_rising_val        = buy_protection_params[10][\"sma200_rising_val\"]\n    buy_10_protection__sma200_1h_rising         = buy_protection_params[10][\"sma200_1h_rising\"]\n    buy_10_protection__sma200_1h_rising_val     = buy_protection_params[10][\"sma200_1h_rising_val\"]\n    buy_10_protection__safe_dips                = buy_protection_params[10][\"safe_dips\"]\n    buy_10_protection__safe_dips_type           = buy_protection_params[10][\"safe_dips_type\"]\n    buy_10_protection__safe_pump                = buy_protection_params[10][\"safe_pump\"]\n    buy_10_protection__safe_pump_type           = buy_protection_params[10][\"safe_pump_type\"]\n    buy_10_protection__safe_pump_period         = buy_protection_params[10][\"safe_pump_period\"]\n    buy_10_protection__btc_1h_not_downtrend     = buy_protection_params[10][\"btc_1h_not_downtrend\"]\n\n    buy_condition_11_enable = buy_protection_params[11][\"enable\"]\n    buy_11_protection__ema_fast                 = buy_protection_params[11][\"ema_fast\"]\n    buy_11_protection__ema_fast_len             = buy_protection_params[11][\"ema_fast_len\"]\n    buy_11_protection__ema_slow                 = buy_protection_params[11][\"ema_slow\"]\n    buy_11_protection__ema_slow_len             = buy_protection_params[11][\"ema_slow_len\"]\n    buy_11_protection__close_above_ema_fast     = buy_protection_params[11][\"close_above_ema_fast\"]\n    buy_11_protection__close_above_ema_fast_len = buy_protection_params[11][\"close_above_ema_fast_len\"]\n    buy_11_protection__close_above_ema_slow     = buy_protection_params[11][\"close_above_ema_slow\"]\n    buy_11_protection__close_above_ema_slow_len = buy_protection_params[11][\"close_above_ema_slow_len\"]\n    buy_11_protection__sma200_rising            = buy_protection_params[11][\"sma200_rising\"]\n    buy_11_protection__sma200_rising_val        = buy_protection_params[11][\"sma200_rising_val\"]\n    buy_11_protection__sma200_1h_rising         = buy_protection_params[11][\"sma200_1h_rising\"]\n    buy_11_protection__sma200_1h_rising_val     = buy_protection_params[11][\"sma200_1h_rising_val\"]\n    buy_11_protection__safe_dips                = buy_protection_params[11][\"safe_dips\"]\n    buy_11_protection__safe_dips_type           = buy_protection_params[11][\"safe_dips_type\"]\n    buy_11_protection__safe_pump                = buy_protection_params[11][\"safe_pump\"]\n    buy_11_protection__safe_pump_type           = buy_protection_params[11][\"safe_pump_type\"]\n    buy_11_protection__safe_pump_period         = buy_protection_params[11][\"safe_pump_period\"]\n    buy_11_protection__btc_1h_not_downtrend     = buy_protection_params[11][\"btc_1h_not_downtrend\"]\n\n    buy_condition_12_enable = buy_protection_params[12][\"enable\"]\n    buy_12_protection__ema_fast                 = buy_protection_params[12][\"ema_fast\"]\n    buy_12_protection__ema_fast_len             = buy_protection_params[12][\"ema_fast_len\"]\n    buy_12_protection__ema_slow                 = buy_protection_params[12][\"ema_slow\"]\n    buy_12_protection__ema_slow_len             = buy_protection_params[12][\"ema_slow_len\"]\n    buy_12_protection__close_above_ema_fast     = buy_protection_params[12][\"close_above_ema_fast\"]\n    buy_12_protection__close_above_ema_fast_len = buy_protection_params[12][\"close_above_ema_fast_len\"]\n    buy_12_protection__close_above_ema_slow     = buy_protection_params[12][\"close_above_ema_slow\"]\n    buy_12_protection__close_above_ema_slow_len = buy_protection_params[12][\"close_above_ema_slow_len\"]\n    buy_12_protection__sma200_rising            = buy_protection_params[12][\"sma200_rising\"]\n    buy_12_protection__sma200_rising_val        = buy_protection_params[12][\"sma200_rising_val\"]\n    buy_12_protection__sma200_1h_rising         = buy_protection_params[12][\"sma200_1h_rising\"]\n    buy_12_protection__sma200_1h_rising_val     = buy_protection_params[12][\"sma200_1h_rising_val\"]\n    buy_12_protection__safe_dips                = buy_protection_params[12][\"safe_dips\"]\n    buy_12_protection__safe_dips_type           = buy_protection_params[12][\"safe_dips_type\"]\n    buy_12_protection__safe_pump                = buy_protection_params[12][\"safe_pump\"]\n    buy_12_protection__safe_pump_type           = buy_protection_params[12][\"safe_pump_type\"]\n    buy_12_protection__safe_pump_period         = buy_protection_params[12][\"safe_pump_period\"]\n    buy_12_protection__btc_1h_not_downtrend     = buy_protection_params[12][\"btc_1h_not_downtrend\"]\n\n    buy_condition_13_enable = buy_protection_params[13][\"enable\"]\n    buy_13_protection__ema_fast                 = buy_protection_params[13][\"ema_fast\"]\n    buy_13_protection__ema_fast_len             = buy_protection_params[13][\"ema_fast_len\"]\n    buy_13_protection__ema_slow                 = buy_protection_params[13][\"ema_slow\"]\n    buy_13_protection__ema_slow_len             = buy_protection_params[13][\"ema_slow_len\"]\n    buy_13_protection__close_above_ema_fast     = buy_protection_params[13][\"close_above_ema_fast\"]\n    buy_13_protection__close_above_ema_fast_len = buy_protection_params[13][\"close_above_ema_fast_len\"]\n    buy_13_protection__close_above_ema_slow     = buy_protection_params[13][\"close_above_ema_slow\"]\n    buy_13_protection__close_above_ema_slow_len = buy_protection_params[13][\"close_above_ema_slow_len\"]\n    buy_13_protection__sma200_rising            = buy_protection_params[13][\"sma200_rising\"]\n    buy_13_protection__sma200_rising_val        = buy_protection_params[13][\"sma200_rising_val\"]\n    buy_13_protection__sma200_1h_rising         = buy_protection_params[13][\"sma200_1h_rising\"]\n    buy_13_protection__sma200_1h_rising_val     = buy_protection_params[13][\"sma200_1h_rising_val\"]\n    buy_13_protection__safe_dips                = buy_protection_params[13][\"safe_dips\"]\n    buy_13_protection__safe_dips_type           = buy_protection_params[13][\"safe_dips_type\"]\n    buy_13_protection__safe_pump                = buy_protection_params[13][\"safe_pump\"]\n    buy_13_protection__safe_pump_type           = buy_protection_params[13][\"safe_pump_type\"]\n    buy_13_protection__safe_pump_period         = buy_protection_params[13][\"safe_pump_period\"]\n    buy_13_protection__btc_1h_not_downtrend     = buy_protection_params[13][\"btc_1h_not_downtrend\"]\n\n    buy_condition_14_enable = buy_protection_params[14][\"enable\"]\n    buy_14_protection__ema_fast                 = buy_protection_params[14][\"ema_fast\"]\n    buy_14_protection__ema_fast_len             = buy_protection_params[14][\"ema_fast_len\"]\n    buy_14_protection__ema_slow                 = buy_protection_params[14][\"ema_slow\"]\n    buy_14_protection__ema_slow_len             = buy_protection_params[14][\"ema_slow_len\"]\n    buy_14_protection__close_above_ema_fast     = buy_protection_params[14][\"close_above_ema_fast\"]\n    buy_14_protection__close_above_ema_fast_len = buy_protection_params[14][\"close_above_ema_fast_len\"]\n    buy_14_protection__close_above_ema_slow     = buy_protection_params[14][\"close_above_ema_slow\"]\n    buy_14_protection__close_above_ema_slow_len = buy_protection_params[14][\"close_above_ema_slow_len\"]\n    buy_14_protection__sma200_rising            = buy_protection_params[14][\"sma200_rising\"]\n    buy_14_protection__sma200_rising_val        = buy_protection_params[14][\"sma200_rising_val\"]\n    buy_14_protection__sma200_1h_rising         = buy_protection_params[14][\"sma200_1h_rising\"]\n    buy_14_protection__sma200_1h_rising_val     = buy_protection_params[14][\"sma200_1h_rising_val\"]\n    buy_14_protection__safe_dips                = buy_protection_params[14][\"safe_dips\"]\n    buy_14_protection__safe_dips_type           = buy_protection_params[14][\"safe_dips_type\"]\n    buy_14_protection__safe_pump                = buy_protection_params[14][\"safe_pump\"]\n    buy_14_protection__safe_pump_type           = buy_protection_params[14][\"safe_pump_type\"]\n    buy_14_protection__safe_pump_period         = buy_protection_params[14][\"safe_pump_period\"]\n    buy_14_protection__btc_1h_not_downtrend     = buy_protection_params[14][\"btc_1h_not_downtrend\"]\n\n    buy_condition_15_enable = buy_protection_params[15][\"enable\"]\n    buy_15_protection__ema_fast                 = buy_protection_params[15][\"ema_fast\"]\n    buy_15_protection__ema_fast_len             = buy_protection_params[15][\"ema_fast_len\"]\n    buy_15_protection__ema_slow                 = buy_protection_params[15][\"ema_slow\"]\n    buy_15_protection__ema_slow_len             = buy_protection_params[15][\"ema_slow_len\"]\n    buy_15_protection__close_above_ema_fast     = buy_protection_params[15][\"close_above_ema_fast\"]\n    buy_15_protection__close_above_ema_fast_len = buy_protection_params[15][\"close_above_ema_fast_len\"]\n    buy_15_protection__close_above_ema_slow     = buy_protection_params[15][\"close_above_ema_slow\"]\n    buy_15_protection__close_above_ema_slow_len = buy_protection_params[15][\"close_above_ema_slow_len\"]\n    buy_15_protection__sma200_rising            = buy_protection_params[15][\"sma200_rising\"]\n    buy_15_protection__sma200_rising_val        = buy_protection_params[15][\"sma200_rising_val\"]\n    buy_15_protection__sma200_1h_rising         = buy_protection_params[15][\"sma200_1h_rising\"]\n    buy_15_protection__sma200_1h_rising_val     = buy_protection_params[15][\"sma200_1h_rising_val\"]\n    buy_15_protection__safe_dips                = buy_protection_params[15][\"safe_dips\"]\n    buy_15_protection__safe_dips_type           = buy_protection_params[15][\"safe_dips_type\"]\n    buy_15_protection__safe_pump                = buy_protection_params[15][\"safe_pump\"]\n    buy_15_protection__safe_pump_type           = buy_protection_params[15][\"safe_pump_type\"]\n    buy_15_protection__safe_pump_period         = buy_protection_params[15][\"safe_pump_period\"]\n    buy_15_protection__btc_1h_not_downtrend     = buy_protection_params[15][\"btc_1h_not_downtrend\"]\n\n    buy_condition_16_enable = buy_protection_params[16][\"enable\"]\n    buy_16_protection__ema_fast                 = buy_protection_params[16][\"ema_fast\"]\n    buy_16_protection__ema_fast_len             = buy_protection_params[16][\"ema_fast_len\"]\n    buy_16_protection__ema_slow                 = buy_protection_params[16][\"ema_slow\"]\n    buy_16_protection__ema_slow_len             = buy_protection_params[16][\"ema_slow_len\"]\n    buy_16_protection__close_above_ema_fast     = buy_protection_params[16][\"close_above_ema_fast\"]\n    buy_16_protection__close_above_ema_fast_len = buy_protection_params[16][\"close_above_ema_fast_len\"]\n    buy_16_protection__close_above_ema_slow     = buy_protection_params[16][\"close_above_ema_slow\"]\n    buy_16_protection__close_above_ema_slow_len = buy_protection_params[16][\"close_above_ema_slow_len\"]\n    buy_16_protection__sma200_rising            = buy_protection_params[16][\"sma200_rising\"]\n    buy_16_protection__sma200_rising_val        = buy_protection_params[16][\"sma200_rising_val\"]\n    buy_16_protection__sma200_1h_rising         = buy_protection_params[16][\"sma200_1h_rising\"]\n    buy_16_protection__sma200_1h_rising_val     = buy_protection_params[16][\"sma200_1h_rising_val\"]\n    buy_16_protection__safe_dips                = buy_protection_params[16][\"safe_dips\"]\n    buy_16_protection__safe_dips_type           = buy_protection_params[16][\"safe_dips_type\"]\n    buy_16_protection__safe_pump                = buy_protection_params[16][\"safe_pump\"]\n    buy_16_protection__safe_pump_type           = buy_protection_params[16][\"safe_pump_type\"]\n    buy_16_protection__safe_pump_period         = buy_protection_params[16][\"safe_pump_period\"]\n    buy_16_protection__btc_1h_not_downtrend     = buy_protection_params[16][\"btc_1h_not_downtrend\"]\n\n    buy_condition_17_enable = buy_protection_params[17][\"enable\"]\n    buy_17_protection__ema_fast                 = buy_protection_params[17][\"ema_fast\"]\n    buy_17_protection__ema_fast_len             = buy_protection_params[17][\"ema_fast_len\"]\n    buy_17_protection__ema_slow                 = buy_protection_params[17][\"ema_slow\"]\n    buy_17_protection__ema_slow_len             = buy_protection_params[17][\"ema_slow_len\"]\n    buy_17_protection__close_above_ema_fast     = buy_protection_params[17][\"close_above_ema_fast\"]\n    buy_17_protection__close_above_ema_fast_len = buy_protection_params[17][\"close_above_ema_fast_len\"]\n    buy_17_protection__close_above_ema_slow     = buy_protection_params[17][\"close_above_ema_slow\"]\n    buy_17_protection__close_above_ema_slow_len = buy_protection_params[17][\"close_above_ema_slow_len\"]\n    buy_17_protection__sma200_rising            = buy_protection_params[17][\"sma200_rising\"]\n    buy_17_protection__sma200_rising_val        = buy_protection_params[17][\"sma200_rising_val\"]\n    buy_17_protection__sma200_1h_rising         = buy_protection_params[17][\"sma200_1h_rising\"]\n    buy_17_protection__sma200_1h_rising_val     = buy_protection_params[17][\"sma200_1h_rising_val\"]\n    buy_17_protection__safe_dips                = buy_protection_params[17][\"safe_dips\"]\n    buy_17_protection__safe_dips_type           = buy_protection_params[17][\"safe_dips_type\"]\n    buy_17_protection__safe_pump                = buy_protection_params[17][\"safe_pump\"]\n    buy_17_protection__safe_pump_type           = buy_protection_params[17][\"safe_pump_type\"]\n    buy_17_protection__safe_pump_period         = buy_protection_params[17][\"safe_pump_period\"]\n    buy_17_protection__btc_1h_not_downtrend     = buy_protection_params[17][\"btc_1h_not_downtrend\"]\n\n    buy_condition_18_enable = buy_protection_params[18][\"enable\"]\n    buy_18_protection__ema_fast                 = buy_protection_params[18][\"ema_fast\"]\n    buy_18_protection__ema_fast_len             = buy_protection_params[18][\"ema_fast_len\"]\n    buy_18_protection__ema_slow                 = buy_protection_params[18][\"ema_slow\"]\n    buy_18_protection__ema_slow_len             = buy_protection_params[18][\"ema_slow_len\"]\n    buy_18_protection__close_above_ema_fast     = buy_protection_params[18][\"close_above_ema_fast\"]\n    buy_18_protection__close_above_ema_fast_len = buy_protection_params[18][\"close_above_ema_fast_len\"]\n    buy_18_protection__close_above_ema_slow     = buy_protection_params[18][\"close_above_ema_slow\"]\n    buy_18_protection__close_above_ema_slow_len = buy_protection_params[18][\"close_above_ema_slow_len\"]\n    buy_18_protection__sma200_rising            = buy_protection_params[18][\"sma200_rising\"]\n    buy_18_protection__sma200_rising_val        = buy_protection_params[18][\"sma200_rising_val\"]\n    buy_18_protection__sma200_1h_rising         = buy_protection_params[18][\"sma200_1h_rising\"]\n    buy_18_protection__sma200_1h_rising_val     = buy_protection_params[18][\"sma200_1h_rising_val\"]\n    buy_18_protection__safe_dips                = buy_protection_params[18][\"safe_dips\"]\n    buy_18_protection__safe_dips_type           = buy_protection_params[18][\"safe_dips_type\"]\n    buy_18_protection__safe_pump                = buy_protection_params[18][\"safe_pump\"]\n    buy_18_protection__safe_pump_type           = buy_protection_params[18][\"safe_pump_type\"]\n    buy_18_protection__safe_pump_period         = buy_protection_params[18][\"safe_pump_period\"]\n    buy_18_protection__btc_1h_not_downtrend     = buy_protection_params[18][\"btc_1h_not_downtrend\"]\n\n    buy_condition_19_enable = buy_protection_params[19][\"enable\"]\n    buy_19_protection__ema_fast                 = buy_protection_params[19][\"ema_fast\"]\n    buy_19_protection__ema_fast_len             = buy_protection_params[19][\"ema_fast_len\"]\n    buy_19_protection__ema_slow                 = buy_protection_params[19][\"ema_slow\"]\n    buy_19_protection__ema_slow_len             = buy_protection_params[19][\"ema_slow_len\"]\n    buy_19_protection__close_above_ema_fast     = buy_protection_params[19][\"close_above_ema_fast\"]\n    buy_19_protection__close_above_ema_fast_len = buy_protection_params[19][\"close_above_ema_fast_len\"]\n    buy_19_protection__close_above_ema_slow     = buy_protection_params[19][\"close_above_ema_slow\"]\n    buy_19_protection__close_above_ema_slow_len = buy_protection_params[19][\"close_above_ema_slow_len\"]\n    buy_19_protection__sma200_rising            = buy_protection_params[19][\"sma200_rising\"]\n    buy_19_protection__sma200_rising_val        = buy_protection_params[19][\"sma200_rising_val\"]\n    buy_19_protection__sma200_1h_rising         = buy_protection_params[19][\"sma200_1h_rising\"]\n    buy_19_protection__sma200_1h_rising_val     = buy_protection_params[19][\"sma200_1h_rising_val\"]\n    buy_19_protection__safe_dips                = buy_protection_params[19][\"safe_dips\"]\n    buy_19_protection__safe_dips_type           = buy_protection_params[19][\"safe_dips_type\"]\n    buy_19_protection__safe_pump                = buy_protection_params[19][\"safe_pump\"]\n    buy_19_protection__safe_pump_type           = buy_protection_params[19][\"safe_pump_type\"]\n    buy_19_protection__safe_pump_period         = buy_protection_params[19][\"safe_pump_period\"]\n    buy_19_protection__btc_1h_not_downtrend     = buy_protection_params[19][\"btc_1h_not_downtrend\"]\n\n    buy_condition_20_enable = buy_protection_params[20][\"enable\"]\n    buy_20_protection__ema_fast                 = buy_protection_params[20][\"ema_fast\"]\n    buy_20_protection__ema_fast_len             = buy_protection_params[20][\"ema_fast_len\"]\n    buy_20_protection__ema_slow                 = buy_protection_params[20][\"ema_slow\"]\n    buy_20_protection__ema_slow_len             = buy_protection_params[20][\"ema_slow_len\"]\n    buy_20_protection__close_above_ema_fast     = buy_protection_params[20][\"close_above_ema_fast\"]\n    buy_20_protection__close_above_ema_fast_len = buy_protection_params[20][\"close_above_ema_fast_len\"]\n    buy_20_protection__close_above_ema_slow     = buy_protection_params[20][\"close_above_ema_slow\"]\n    buy_20_protection__close_above_ema_slow_len = buy_protection_params[20][\"close_above_ema_slow_len\"]\n    buy_20_protection__sma200_rising            = buy_protection_params[20][\"sma200_rising\"]\n    buy_20_protection__sma200_rising_val        = buy_protection_params[20][\"sma200_rising_val\"]\n    buy_20_protection__sma200_1h_rising         = buy_protection_params[20][\"sma200_1h_rising\"]\n    buy_20_protection__sma200_1h_rising_val     = buy_protection_params[20][\"sma200_1h_rising_val\"]\n    buy_20_protection__safe_dips                = buy_protection_params[20][\"safe_dips\"]\n    buy_20_protection__safe_dips_type           = buy_protection_params[20][\"safe_dips_type\"]\n    buy_20_protection__safe_pump                = buy_protection_params[20][\"safe_pump\"]\n    buy_20_protection__safe_pump_type           = buy_protection_params[20][\"safe_pump_type\"]\n    buy_20_protection__safe_pump_period         = buy_protection_params[20][\"safe_pump_period\"]\n    buy_20_protection__btc_1h_not_downtrend     = buy_protection_params[20][\"btc_1h_not_downtrend\"]\n\n    buy_condition_21_enable = buy_protection_params[21][\"enable\"]\n    buy_21_protection__ema_fast                 = buy_protection_params[21][\"ema_fast\"]\n    buy_21_protection__ema_fast_len             = buy_protection_params[21][\"ema_fast_len\"]\n    buy_21_protection__ema_slow                 = buy_protection_params[21][\"ema_slow\"]\n    buy_21_protection__ema_slow_len             = buy_protection_params[21][\"ema_slow_len\"]\n    buy_21_protection__close_above_ema_fast     = buy_protection_params[21][\"close_above_ema_fast\"]\n    buy_21_protection__close_above_ema_fast_len = buy_protection_params[21][\"close_above_ema_fast_len\"]\n    buy_21_protection__close_above_ema_slow     = buy_protection_params[21][\"close_above_ema_slow\"]\n    buy_21_protection__close_above_ema_slow_len = buy_protection_params[21][\"close_above_ema_slow_len\"]\n    buy_21_protection__sma200_rising            = buy_protection_params[21][\"sma200_rising\"]\n    buy_21_protection__sma200_rising_val        = buy_protection_params[21][\"sma200_rising_val\"]\n    buy_21_protection__sma200_1h_rising         = buy_protection_params[21][\"sma200_1h_rising\"]\n    buy_21_protection__sma200_1h_rising_val     = buy_protection_params[21][\"sma200_1h_rising_val\"]\n    buy_21_protection__safe_dips                = buy_protection_params[21][\"safe_dips\"]\n    buy_21_protection__safe_dips_type           = buy_protection_params[21][\"safe_dips_type\"]\n    buy_21_protection__safe_pump                = buy_protection_params[21][\"safe_pump\"]\n    buy_21_protection__safe_pump_type           = buy_protection_params[21][\"safe_pump_type\"]\n    buy_21_protection__safe_pump_period         = buy_protection_params[21][\"safe_pump_period\"]\n    buy_21_protection__btc_1h_not_downtrend     = buy_protection_params[21][\"btc_1h_not_downtrend\"]\n\n    buy_condition_22_enable = buy_protection_params[22][\"enable\"]\n    buy_22_protection__ema_fast                 = buy_protection_params[22][\"ema_fast\"]\n    buy_22_protection__ema_fast_len             = buy_protection_params[22][\"ema_fast_len\"]\n    buy_22_protection__ema_slow                 = buy_protection_params[22][\"ema_slow\"]\n    buy_22_protection__ema_slow_len             = buy_protection_params[22][\"ema_slow_len\"]\n    buy_22_protection__close_above_ema_fast     = buy_protection_params[22][\"close_above_ema_fast\"]\n    buy_22_protection__close_above_ema_fast_len = buy_protection_params[22][\"close_above_ema_fast_len\"]\n    buy_22_protection__close_above_ema_slow     = buy_protection_params[22][\"close_above_ema_slow\"]\n    buy_22_protection__close_above_ema_slow_len = buy_protection_params[22][\"close_above_ema_slow_len\"]\n    buy_22_protection__sma200_rising            = buy_protection_params[22][\"sma200_rising\"]\n    buy_22_protection__sma200_rising_val        = buy_protection_params[22][\"sma200_rising_val\"]\n    buy_22_protection__sma200_1h_rising         = buy_protection_params[22][\"sma200_1h_rising\"]\n    buy_22_protection__sma200_1h_rising_val     = buy_protection_params[22][\"sma200_1h_rising_val\"]\n    buy_22_protection__safe_dips                = buy_protection_params[22][\"safe_dips\"]\n    buy_22_protection__safe_dips_type           = buy_protection_params[22][\"safe_dips_type\"]\n    buy_22_protection__safe_pump                = buy_protection_params[22][\"safe_pump\"]\n    buy_22_protection__safe_pump_type           = buy_protection_params[22][\"safe_pump_type\"]\n    buy_22_protection__safe_pump_period         = buy_protection_params[22][\"safe_pump_period\"]\n    buy_22_protection__btc_1h_not_downtrend     = buy_protection_params[22][\"btc_1h_not_downtrend\"]\n\n    buy_condition_23_enable = buy_protection_params[23][\"enable\"]\n    buy_23_protection__ema_fast                 = buy_protection_params[23][\"ema_fast\"]\n    buy_23_protection__ema_fast_len             = buy_protection_params[23][\"ema_fast_len\"]\n    buy_23_protection__ema_slow                 = buy_protection_params[23][\"ema_slow\"]\n    buy_23_protection__ema_slow_len             = buy_protection_params[23][\"ema_slow_len\"]\n    buy_23_protection__close_above_ema_fast     = buy_protection_params[23][\"close_above_ema_fast\"]\n    buy_23_protection__close_above_ema_fast_len = buy_protection_params[23][\"close_above_ema_fast_len\"]\n    buy_23_protection__close_above_ema_slow     = buy_protection_params[23][\"close_above_ema_slow\"]\n    buy_23_protection__close_above_ema_slow_len = buy_protection_params[23][\"close_above_ema_slow_len\"]\n    buy_23_protection__sma200_rising            = buy_protection_params[23][\"sma200_rising\"]\n    buy_23_protection__sma200_rising_val        = buy_protection_params[23][\"sma200_rising_val\"]\n    buy_23_protection__sma200_1h_rising         = buy_protection_params[23][\"sma200_1h_rising\"]\n    buy_23_protection__sma200_1h_rising_val     = buy_protection_params[23][\"sma200_1h_rising_val\"]\n    buy_23_protection__safe_dips                = buy_protection_params[23][\"safe_dips\"]\n    buy_23_protection__safe_dips_type           = buy_protection_params[23][\"safe_dips_type\"]\n    buy_23_protection__safe_pump                = buy_protection_params[23][\"safe_pump\"]\n    buy_23_protection__safe_pump_type           = buy_protection_params[23][\"safe_pump_type\"]\n    buy_23_protection__safe_pump_period         = buy_protection_params[23][\"safe_pump_period\"]\n    buy_23_protection__btc_1h_not_downtrend     = buy_protection_params[23][\"btc_1h_not_downtrend\"]\n\n    buy_condition_24_enable = buy_protection_params[24][\"enable\"]\n    buy_24_protection__ema_fast                 = buy_protection_params[24][\"ema_fast\"]\n    buy_24_protection__ema_fast_len             = buy_protection_params[24][\"ema_fast_len\"]\n    buy_24_protection__ema_slow                 = buy_protection_params[24][\"ema_slow\"]\n    buy_24_protection__ema_slow_len             = buy_protection_params[24][\"ema_slow_len\"]\n    buy_24_protection__close_above_ema_fast     = buy_protection_params[24][\"close_above_ema_fast\"]\n    buy_24_protection__close_above_ema_fast_len = buy_protection_params[24][\"close_above_ema_fast_len\"]\n    buy_24_protection__close_above_ema_slow     = buy_protection_params[24][\"close_above_ema_slow\"]\n    buy_24_protection__close_above_ema_slow_len = buy_protection_params[24][\"close_above_ema_slow_len\"]\n    buy_24_protection__sma200_rising            = buy_protection_params[24][\"sma200_rising\"]\n    buy_24_protection__sma200_rising_val        = buy_protection_params[24][\"sma200_rising_val\"]\n    buy_24_protection__sma200_1h_rising         = buy_protection_params[24][\"sma200_1h_rising\"]\n    buy_24_protection__sma200_1h_rising_val     = buy_protection_params[24][\"sma200_1h_rising_val\"]\n    buy_24_protection__safe_dips                = buy_protection_params[24][\"safe_dips\"]\n    buy_24_protection__safe_dips_type           = buy_protection_params[24][\"safe_dips_type\"]\n    buy_24_protection__safe_pump                = buy_protection_params[24][\"safe_pump\"]\n    buy_24_protection__safe_pump_type           = buy_protection_params[24][\"safe_pump_type\"]\n    buy_24_protection__safe_pump_period         = buy_protection_params[24][\"safe_pump_period\"]\n    buy_24_protection__btc_1h_not_downtrend     = buy_protection_params[24][\"btc_1h_not_downtrend\"]\n\n    buy_condition_25_enable = buy_protection_params[25][\"enable\"]\n    buy_25_protection__ema_fast                 = buy_protection_params[25][\"ema_fast\"]\n    buy_25_protection__ema_fast_len             = buy_protection_params[25][\"ema_fast_len\"]\n    buy_25_protection__ema_slow                 = buy_protection_params[25][\"ema_slow\"]\n    buy_25_protection__ema_slow_len             = buy_protection_params[25][\"ema_slow_len\"]\n    buy_25_protection__close_above_ema_fast     = buy_protection_params[25][\"close_above_ema_fast\"]\n    buy_25_protection__close_above_ema_fast_len = buy_protection_params[25][\"close_above_ema_fast_len\"]\n    buy_25_protection__close_above_ema_slow     = buy_protection_params[25][\"close_above_ema_slow\"]\n    buy_25_protection__close_above_ema_slow_len = buy_protection_params[25][\"close_above_ema_slow_len\"]\n    buy_25_protection__sma200_rising            = buy_protection_params[25][\"sma200_rising\"]\n    buy_25_protection__sma200_rising_val        = buy_protection_params[25][\"sma200_rising_val\"]\n    buy_25_protection__sma200_1h_rising         = buy_protection_params[25][\"sma200_1h_rising\"]\n    buy_25_protection__sma200_1h_rising_val     = buy_protection_params[25][\"sma200_1h_rising_val\"]\n    buy_25_protection__safe_dips                = buy_protection_params[25][\"safe_dips\"]\n    buy_25_protection__safe_dips_type           = buy_protection_params[25][\"safe_dips_type\"]\n    buy_25_protection__safe_pump                = buy_protection_params[25][\"safe_pump\"]\n    buy_25_protection__safe_pump_type           = buy_protection_params[25][\"safe_pump_type\"]\n    buy_25_protection__safe_pump_period         = buy_protection_params[25][\"safe_pump_period\"]\n    buy_25_protection__btc_1h_not_downtrend     = buy_protection_params[25][\"btc_1h_not_downtrend\"]\n\n    buy_condition_26_enable = buy_protection_params[26][\"enable\"]\n    buy_26_protection__ema_fast                 = buy_protection_params[26][\"ema_fast\"]\n    buy_26_protection__ema_fast_len             = buy_protection_params[26][\"ema_fast_len\"]\n    buy_26_protection__ema_slow                 = buy_protection_params[26][\"ema_slow\"]\n    buy_26_protection__ema_slow_len             = buy_protection_params[26][\"ema_slow_len\"]\n    buy_26_protection__close_above_ema_fast     = buy_protection_params[26][\"close_above_ema_fast\"]\n    buy_26_protection__close_above_ema_fast_len = buy_protection_params[26][\"close_above_ema_fast_len\"]\n    buy_26_protection__close_above_ema_slow     = buy_protection_params[26][\"close_above_ema_slow\"]\n    buy_26_protection__close_above_ema_slow_len = buy_protection_params[26][\"close_above_ema_slow_len\"]\n    buy_26_protection__sma200_rising            = buy_protection_params[26][\"sma200_rising\"]\n    buy_26_protection__sma200_rising_val        = buy_protection_params[26][\"sma200_rising_val\"]\n    buy_26_protection__sma200_1h_rising         = buy_protection_params[26][\"sma200_1h_rising\"]\n    buy_26_protection__sma200_1h_rising_val     = buy_protection_params[26][\"sma200_1h_rising_val\"]\n    buy_26_protection__safe_dips                = buy_protection_params[26][\"safe_dips\"]\n    buy_26_protection__safe_dips_type           = buy_protection_params[26][\"safe_dips_type\"]\n    buy_26_protection__safe_pump                = buy_protection_params[26][\"safe_pump\"]\n    buy_26_protection__safe_pump_type           = buy_protection_params[26][\"safe_pump_type\"]\n    buy_26_protection__safe_pump_period         = buy_protection_params[26][\"safe_pump_period\"]\n    buy_26_protection__btc_1h_not_downtrend     = buy_protection_params[26][\"btc_1h_not_downtrend\"]\n\n    buy_condition_27_enable = buy_protection_params[27][\"enable\"]\n    buy_27_protection__ema_fast                 = buy_protection_params[27][\"ema_fast\"]\n    buy_27_protection__ema_fast_len             = buy_protection_params[27][\"ema_fast_len\"]\n    buy_27_protection__ema_slow                 = buy_protection_params[27][\"ema_slow\"]\n    buy_27_protection__ema_slow_len             = buy_protection_params[27][\"ema_slow_len\"]\n    buy_27_protection__close_above_ema_fast     = buy_protection_params[27][\"close_above_ema_fast\"]\n    buy_27_protection__close_above_ema_fast_len = buy_protection_params[27][\"close_above_ema_fast_len\"]\n    buy_27_protection__close_above_ema_slow     = buy_protection_params[27][\"close_above_ema_slow\"]\n    buy_27_protection__close_above_ema_slow_len = buy_protection_params[27][\"close_above_ema_slow_len\"]\n    buy_27_protection__sma200_rising            = buy_protection_params[27][\"sma200_rising\"]\n    buy_27_protection__sma200_rising_val        = buy_protection_params[27][\"sma200_rising_val\"]\n    buy_27_protection__sma200_1h_rising         = buy_protection_params[27][\"sma200_1h_rising\"]\n    buy_27_protection__sma200_1h_rising_val     = buy_protection_params[27][\"sma200_1h_rising_val\"]\n    buy_27_protection__safe_dips                = buy_protection_params[27][\"safe_dips\"]\n    buy_27_protection__safe_dips_type           = buy_protection_params[27][\"safe_dips_type\"]\n    buy_27_protection__safe_pump                = buy_protection_params[27][\"safe_pump\"]\n    buy_27_protection__safe_pump_type           = buy_protection_params[27][\"safe_pump_type\"]\n    buy_27_protection__safe_pump_period         = buy_protection_params[27][\"safe_pump_period\"]\n    buy_27_protection__btc_1h_not_downtrend     = buy_protection_params[27][\"btc_1h_not_downtrend\"]\n\n    buy_condition_28_enable = buy_protection_params[28][\"enable\"]\n    buy_28_protection__ema_fast                 = buy_protection_params[28][\"ema_fast\"]\n    buy_28_protection__ema_fast_len             = buy_protection_params[28][\"ema_fast_len\"]\n    buy_28_protection__ema_slow                 = buy_protection_params[28][\"ema_slow\"]\n    buy_28_protection__ema_slow_len             = buy_protection_params[28][\"ema_slow_len\"]\n    buy_28_protection__close_above_ema_fast     = buy_protection_params[28][\"close_above_ema_fast\"]\n    buy_28_protection__close_above_ema_fast_len = buy_protection_params[28][\"close_above_ema_fast_len\"]\n    buy_28_protection__close_above_ema_slow     = buy_protection_params[28][\"close_above_ema_slow\"]\n    buy_28_protection__close_above_ema_slow_len = buy_protection_params[28][\"close_above_ema_slow_len\"]\n    buy_28_protection__sma200_rising            = buy_protection_params[28][\"sma200_rising\"]\n    buy_28_protection__sma200_rising_val        = buy_protection_params[28][\"sma200_rising_val\"]\n    buy_28_protection__sma200_1h_rising         = buy_protection_params[28][\"sma200_1h_rising\"]\n    buy_28_protection__sma200_1h_rising_val     = buy_protection_params[28][\"sma200_1h_rising_val\"]\n    buy_28_protection__safe_dips                = buy_protection_params[28][\"safe_dips\"]\n    buy_28_protection__safe_dips_type           = buy_protection_params[28][\"safe_dips_type\"]\n    buy_28_protection__safe_pump                = buy_protection_params[28][\"safe_pump\"]\n    buy_28_protection__safe_pump_type           = buy_protection_params[28][\"safe_pump_type\"]\n    buy_28_protection__safe_pump_period         = buy_protection_params[28][\"safe_pump_period\"]\n    buy_28_protection__btc_1h_not_downtrend     = buy_protection_params[28][\"btc_1h_not_downtrend\"]\n\n    buy_condition_29_enable = buy_protection_params[29][\"enable\"]\n    buy_29_protection__ema_fast                 = buy_protection_params[29][\"ema_fast\"]\n    buy_29_protection__ema_fast_len             = buy_protection_params[29][\"ema_fast_len\"]\n    buy_29_protection__ema_slow                 = buy_protection_params[29][\"ema_slow\"]\n    buy_29_protection__ema_slow_len             = buy_protection_params[29][\"ema_slow_len\"]\n    buy_29_protection__close_above_ema_fast     = buy_protection_params[29][\"close_above_ema_fast\"]\n    buy_29_protection__close_above_ema_fast_len = buy_protection_params[29][\"close_above_ema_fast_len\"]\n    buy_29_protection__close_above_ema_slow     = buy_protection_params[29][\"close_above_ema_slow\"]\n    buy_29_protection__close_above_ema_slow_len = buy_protection_params[29][\"close_above_ema_slow_len\"]\n    buy_29_protection__sma200_rising            = buy_protection_params[29][\"sma200_rising\"]\n    buy_29_protection__sma200_rising_val        = buy_protection_params[29][\"sma200_rising_val\"]\n    buy_29_protection__sma200_1h_rising         = buy_protection_params[29][\"sma200_1h_rising\"]\n    buy_29_protection__sma200_1h_rising_val     = buy_protection_params[29][\"sma200_1h_rising_val\"]\n    buy_29_protection__safe_dips                = buy_protection_params[29][\"safe_dips\"]\n    buy_29_protection__safe_dips_type           = buy_protection_params[29][\"safe_dips_type\"]\n    buy_29_protection__safe_pump                = buy_protection_params[29][\"safe_pump\"]\n    buy_29_protection__safe_pump_type           = buy_protection_params[29][\"safe_pump_type\"]\n    buy_29_protection__safe_pump_period         = buy_protection_params[29][\"safe_pump_period\"]\n    buy_29_protection__btc_1h_not_downtrend     = buy_protection_params[29][\"btc_1h_not_downtrend\"]\n\n    buy_condition_30_enable = buy_protection_params[30][\"enable\"]\n    buy_30_protection__ema_fast                 = buy_protection_params[30][\"ema_fast\"]\n    buy_30_protection__ema_fast_len             = buy_protection_params[30][\"ema_fast_len\"]\n    buy_30_protection__ema_slow                 = buy_protection_params[30][\"ema_slow\"]\n    buy_30_protection__ema_slow_len             = buy_protection_params[30][\"ema_slow_len\"]\n    buy_30_protection__close_above_ema_fast     = buy_protection_params[30][\"close_above_ema_fast\"]\n    buy_30_protection__close_above_ema_fast_len = buy_protection_params[30][\"close_above_ema_fast_len\"]\n    buy_30_protection__close_above_ema_slow     = buy_protection_params[30][\"close_above_ema_slow\"]\n    buy_30_protection__close_above_ema_slow_len = buy_protection_params[30][\"close_above_ema_slow_len\"]\n    buy_30_protection__sma200_rising            = buy_protection_params[30][\"sma200_rising\"]\n    buy_30_protection__sma200_rising_val        = buy_protection_params[30][\"sma200_rising_val\"]\n    buy_30_protection__sma200_1h_rising         = buy_protection_params[30][\"sma200_1h_rising\"]\n    buy_30_protection__sma200_1h_rising_val     = buy_protection_params[30][\"sma200_1h_rising_val\"]\n    buy_30_protection__safe_dips                = buy_protection_params[30][\"safe_dips\"]\n    buy_30_protection__safe_dips_type           = buy_protection_params[30][\"safe_dips_type\"]\n    buy_30_protection__safe_pump                = buy_protection_params[30][\"safe_pump\"]\n    buy_30_protection__safe_pump_type           = buy_protection_params[30][\"safe_pump_type\"]\n    buy_30_protection__safe_pump_period         = buy_protection_params[30][\"safe_pump_period\"]\n    buy_30_protection__btc_1h_not_downtrend     = buy_protection_params[30][\"btc_1h_not_downtrend\"]\n\n    buy_condition_31_enable = buy_protection_params[31][\"enable\"]\n    buy_31_protection__ema_fast                 = buy_protection_params[31][\"ema_fast\"]\n    buy_31_protection__ema_fast_len             = buy_protection_params[31][\"ema_fast_len\"]\n    buy_31_protection__ema_slow                 = buy_protection_params[31][\"ema_slow\"]\n    buy_31_protection__ema_slow_len             = buy_protection_params[31][\"ema_slow_len\"]\n    buy_31_protection__close_above_ema_fast     = buy_protection_params[31][\"close_above_ema_fast\"]\n    buy_31_protection__close_above_ema_fast_len = buy_protection_params[31][\"close_above_ema_fast_len\"]\n    buy_31_protection__close_above_ema_slow     = buy_protection_params[31][\"close_above_ema_slow\"]\n    buy_31_protection__close_above_ema_slow_len = buy_protection_params[31][\"close_above_ema_slow_len\"]\n    buy_31_protection__sma200_rising            = buy_protection_params[31][\"sma200_rising\"]\n    buy_31_protection__sma200_rising_val        = buy_protection_params[31][\"sma200_rising_val\"]\n    buy_31_protection__sma200_1h_rising         = buy_protection_params[31][\"sma200_1h_rising\"]\n    buy_31_protection__sma200_1h_rising_val     = buy_protection_params[31][\"sma200_1h_rising_val\"]\n    buy_31_protection__safe_dips                = buy_protection_params[31][\"safe_dips\"]\n    buy_31_protection__safe_dips_type           = buy_protection_params[31][\"safe_dips_type\"]\n    buy_31_protection__safe_pump                = buy_protection_params[31][\"safe_pump\"]\n    buy_31_protection__safe_pump_type           = buy_protection_params[31][\"safe_pump_type\"]\n    buy_31_protection__safe_pump_period         = buy_protection_params[31][\"safe_pump_period\"]\n    buy_31_protection__btc_1h_not_downtrend     = buy_protection_params[31][\"btc_1h_not_downtrend\"]\n\n    buy_condition_32_enable = buy_protection_params[32][\"enable\"]\n    buy_32_protection__ema_fast                 = buy_protection_params[32][\"ema_fast\"]\n    buy_32_protection__ema_fast_len             = buy_protection_params[32][\"ema_fast_len\"]\n    buy_32_protection__ema_slow                 = buy_protection_params[32][\"ema_slow\"]\n    buy_32_protection__ema_slow_len             = buy_protection_params[32][\"ema_slow_len\"]\n    buy_32_protection__close_above_ema_fast     = buy_protection_params[32][\"close_above_ema_fast\"]\n    buy_32_protection__close_above_ema_fast_len = buy_protection_params[32][\"close_above_ema_fast_len\"]\n    buy_32_protection__close_above_ema_slow     = buy_protection_params[32][\"close_above_ema_slow\"]\n    buy_32_protection__close_above_ema_slow_len = buy_protection_params[32][\"close_above_ema_slow_len\"]\n    buy_32_protection__sma200_rising            = buy_protection_params[32][\"sma200_rising\"]\n    buy_32_protection__sma200_rising_val        = buy_protection_params[32][\"sma200_rising_val\"]\n    buy_32_protection__sma200_1h_rising         = buy_protection_params[32][\"sma200_1h_rising\"]\n    buy_32_protection__sma200_1h_rising_val     = buy_protection_params[32][\"sma200_1h_rising_val\"]\n    buy_32_protection__safe_dips                = buy_protection_params[32][\"safe_dips\"]\n    buy_32_protection__safe_dips_type           = buy_protection_params[32][\"safe_dips_type\"]\n    buy_32_protection__safe_pump                = buy_protection_params[32][\"safe_pump\"]\n    buy_32_protection__safe_pump_type           = buy_protection_params[32][\"safe_pump_type\"]\n    buy_32_protection__safe_pump_period         = buy_protection_params[32][\"safe_pump_period\"]\n    buy_32_protection__btc_1h_not_downtrend     = buy_protection_params[32][\"btc_1h_not_downtrend\"]\n\n    buy_condition_33_enable = buy_protection_params[33][\"enable\"]\n    buy_33_protection__ema_fast                 = buy_protection_params[33][\"ema_fast\"]\n    buy_33_protection__ema_fast_len             = buy_protection_params[33][\"ema_fast_len\"]\n    buy_33_protection__ema_slow                 = buy_protection_params[33][\"ema_slow\"]\n    buy_33_protection__ema_slow_len             = buy_protection_params[33][\"ema_slow_len\"]\n    buy_33_protection__close_above_ema_fast     = buy_protection_params[33][\"close_above_ema_fast\"]\n    buy_33_protection__close_above_ema_fast_len = buy_protection_params[33][\"close_above_ema_fast_len\"]\n    buy_33_protection__close_above_ema_slow     = buy_protection_params[33][\"close_above_ema_slow\"]\n    buy_33_protection__close_above_ema_slow_len = buy_protection_params[33][\"close_above_ema_slow_len\"]\n    buy_33_protection__sma200_rising            = buy_protection_params[33][\"sma200_rising\"]\n    buy_33_protection__sma200_rising_val        = buy_protection_params[33][\"sma200_rising_val\"]\n    buy_33_protection__sma200_1h_rising         = buy_protection_params[33][\"sma200_1h_rising\"]\n    buy_33_protection__sma200_1h_rising_val     = buy_protection_params[33][\"sma200_1h_rising_val\"]\n    buy_33_protection__safe_dips                = buy_protection_params[33][\"safe_dips\"]\n    buy_33_protection__safe_dips_type           = buy_protection_params[33][\"safe_dips_type\"]\n    buy_33_protection__safe_pump                = buy_protection_params[33][\"safe_pump\"]\n    buy_33_protection__safe_pump_type           = buy_protection_params[33][\"safe_pump_type\"]\n    buy_33_protection__safe_pump_period         = buy_protection_params[33][\"safe_pump_period\"]\n    buy_33_protection__btc_1h_not_downtrend     = buy_protection_params[33][\"btc_1h_not_downtrend\"]\n\n    buy_condition_34_enable = buy_protection_params[34][\"enable\"]\n    buy_34_protection__ema_fast                 = buy_protection_params[34][\"ema_fast\"]\n    buy_34_protection__ema_fast_len             = buy_protection_params[34][\"ema_fast_len\"]\n    buy_34_protection__ema_slow                 = buy_protection_params[34][\"ema_slow\"]\n    buy_34_protection__ema_slow_len             = buy_protection_params[34][\"ema_slow_len\"]\n    buy_34_protection__close_above_ema_fast     = buy_protection_params[34][\"close_above_ema_fast\"]\n    buy_34_protection__close_above_ema_fast_len = buy_protection_params[34][\"close_above_ema_fast_len\"]\n    buy_34_protection__close_above_ema_slow     = buy_protection_params[34][\"close_above_ema_slow\"]\n    buy_34_protection__close_above_ema_slow_len = buy_protection_params[34][\"close_above_ema_slow_len\"]\n    buy_34_protection__sma200_rising            = buy_protection_params[34][\"sma200_rising\"]\n    buy_34_protection__sma200_rising_val        = buy_protection_params[34][\"sma200_rising_val\"]\n    buy_34_protection__sma200_1h_rising         = buy_protection_params[34][\"sma200_1h_rising\"]\n    buy_34_protection__sma200_1h_rising_val     = buy_protection_params[34][\"sma200_1h_rising_val\"]\n    buy_34_protection__safe_dips                = buy_protection_params[34][\"safe_dips\"]\n    buy_34_protection__safe_dips_type           = buy_protection_params[34][\"safe_dips_type\"]\n    buy_34_protection__safe_pump                = buy_protection_params[34][\"safe_pump\"]\n    buy_34_protection__safe_pump_type           = buy_protection_params[34][\"safe_pump_type\"]\n    buy_34_protection__safe_pump_period         = buy_protection_params[34][\"safe_pump_period\"]\n    buy_34_protection__btc_1h_not_downtrend     = buy_protection_params[34][\"btc_1h_not_downtrend\"]\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=44.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_cti_8 = DecimalParameter(-0.99, -0.5, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(20.0, 50.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_8 = DecimalParameter(40.0, 66.0, default=54.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_8 = DecimalParameter(0.6, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=22.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.941, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_14 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(95, 99, default=95.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=97.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_1 = DecimalParameter(0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = None\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = {}\n\n        # Update values from config file, if it exists\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if not hold_trades_config_file.is_file():\n            # The resolved path does not exist, is it a symlink?\n            hold_trades_config_file = strat_file_path.absolute().parent / \"hold-trades.json\"\n            if not hold_trades_config_file.is_file():\n                log.warning(\n                    \"The 'hold-trades.json' file was not found. Looked in '%s' and '%s'. HOLD support disabled.\",\n                    strat_file_path.resolve().parent,\n                    strat_file_path.absolute().parent\n                )\n                return\n\n        with hold_trades_config_file.open('r') as f:\n            trade_ids = None\n            hold_trades_config = None\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                trade_ids = hold_trades_config.get(\"trade_ids\")\n\n            if not trade_ids:\n                return\n\n            open_trades = {\n                trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n            }\n\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    try:\n                        trade_id = int(trade_id)\n                    except ValueError:\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            hold_trades_config_file\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if current_profit > self.sell_custom_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_11.value:\n                    return True, 'signal_profit_11'\n            elif self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_10.value:\n                    return True, 'signal_profit_10'\n            elif self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_9.value:\n                    return True, 'signal_profit_9'\n            elif self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_8.value:\n                    return True, 'signal_profit_8'\n            elif self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_7'\n            elif self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_6'\n            elif self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_5'\n            elif self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_4'\n            elif self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_3'\n            elif self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_2'\n            elif self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_1'\n            elif self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_0'\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if current_profit > self.sell_custom_under_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_11.value:\n                    return True, 'signal_profit_u_11'\n            elif self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_10.value:\n                    return True, 'signal_profit_u_10'\n            elif self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_9.value:\n                    return True, 'signal_profit_u_9'\n            elif self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_8.value:\n                    return True, 'signal_profit_u_8'\n            elif self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_7.value:\n                    return True, 'signal_profit_u_7'\n            elif self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_6.value:\n                    return True, 'signal_profit_u_6'\n            elif self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_5.value:\n                    return True, 'signal_profit_u_5'\n            elif self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_4.value:\n                    return True, 'signal_profit_u_4'\n            elif self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_3.value:\n                    return True, 'signal_profit_u_3'\n            elif self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_2.value:\n                    return True, 'signal_profit_u_2'\n            elif self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_1.value:\n                    return True, 'signal_profit_u_1'\n            elif self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_u_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)) & (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) & (0.2 > current_profit > 0.07) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (current_profit > self.sell_custom_profit_under_profit_1.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit > self.sell_custom_profit_under_profit_2.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime', max_loss: float, max_profit: float) -> tuple:\n        if (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < -0.2) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_stoploss_u_1'\n\n        # Under EMA200, pair & BTC negative, low max rate\n        elif (-0.1 > current_profit > -0.14) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (max_profit < 0.005) & (max_loss < 0.14) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -50.0):\n            return True, 'signal_stoploss_u_b_1'\n\n        # Under EMA200, pair & BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (-0.1 > current_profit > -0.2) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (last_candle['moderi_96'] == False) & (max_profit < 0.05) & (max_loss < 0.2) & (last_candle['sma_200_dec_24'])& (last_candle['sma_200_dec_20_1h']) & (last_candle['cmf'] < -0.45) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -97.0):\n            return True, 'signal_stoploss_u_b_2'\n\n        elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_1'\n\n        elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n            return True, 'signal_stoploss_p_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n            return True, 'signal_stoploss_p_3'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit > 0.02:\n            if last_candle['r_480'] > -2.1:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit > 0.03:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit > 0.04:\n            if last_candle['r_480'] > -2.3:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit > 0.05:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit > 0.06:\n            if last_candle['r_480'] > -2.5: ###\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit > 0.07:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit > 0.08:\n            if last_candle['r_480'] > -5.5:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit > 0.09:\n            if last_candle['r_480'] > -3.0:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit > 0.1:\n            if last_candle['r_480'] > -8.0:\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -1.5) & (last_candle['rsi'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -2.1) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -2.3) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit > 0.05:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit > 0.06:\n            if (last_candle['r_480'] > -2.5) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit > 0.07:\n            if (last_candle['r_480'] > -34.0) & (last_candle['rsi'] > 80.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit > 0.08:\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit > 0.09:\n            if (last_candle['r_480'] > -2.8) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 81.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 81.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -29.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -30.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit > 0.012):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit > 0.02):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit > 0.03):\n            if (last_candle['r_480'] > -5.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit > 0.04):\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit > 0.05):\n            if (last_candle['r_480'] > -24.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit > 0.06):\n            if (last_candle['r_480'] > -26.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit > 0.07):\n            if (last_candle['r_480'] > -20.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit > 0.08):\n            if (last_candle['r_480'] > -18.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit > 0.09):\n            if (last_candle['r_480'] > -16.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit > 0.1):\n            if (last_candle['r_480'] > -5.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit > 0.12):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit > 0.2):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, buy_signal_candle) -> tuple:\n        if (buy_signal_candle['buy_condition_32'] == 1) or (buy_signal_candle['buy_condition_33'] == 1) or (buy_signal_candle['buy_condition_34'] == 1):\n            if (0.06 > current_profit > 0.02) & (last_candle['rsi'] > 79.0):\n                return True, 'signal_profit_q_1'\n\n            if (0.06 > current_profit > 0.02) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_q_2'\n\n            if (current_profit < -0.1):\n                return True, 'signal_stoploss_q_1'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle_1 = dataframe.iloc[-2].squeeze()\n        previous_candle_2 = dataframe.iloc[-3].squeeze()\n        previous_candle_3 = dataframe.iloc[-4].squeeze()\n        previous_candle_4 = dataframe.iloc[-5].squeeze()\n        previous_candle_5 = dataframe.iloc[-6].squeeze()\n\n        trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n        buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n        if not buy_signal.empty:\n            buy_signal_candle = buy_signal.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if not buy_signal.empty:\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, buy_signal_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, trade, current_time, max_loss, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name\n\n        # Sell signal 1\n        if self.sell_condition_1_enable.value & (last_candle['rsi'] > self.sell_rsi_bb_1.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) & (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) & (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) & (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1'\n                elif (max_loss > 0.1):\n                    return 'sell_signal_1_1_2'\n            else:\n                return 'sell_signal_1_2'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable.value) & (last_candle['rsi'] > self.sell_rsi_bb_2.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1'\n                elif (max_loss > 0.07):\n                    return 'sell_signal_2_1_2'\n            else:\n                return 'sell_signal_2_2'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable.value & (last_candle['rsi'] > self.sell_dual_rsi_rsi_4.value) & (last_candle['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n            return 'sell_signal_4'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable.value & (last_candle['close'] < last_candle['ema_200']) & (last_candle['close'] > last_candle['ema_50']) & (last_candle['rsi'] > self.sell_rsi_under_6.value):\n            return 'sell_signal_6'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable.value & (last_candle['rsi_1h'] > self.sell_rsi_1h_7.value) & (last_candle['crossed_below_ema_12_26']):\n            return 'sell_signal_7'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable.value & (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n            return 'sell_signal_8'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return (df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min()\n        elif method == 'OC':\n            return (df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return (df['open'] - df['close']) / df['close']\n        else:\n            return (df['open'].rolling(length).max() - df['close']) / df['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['open'].rolling(length).max() - df['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['close'] - df['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # TSI\n        dataframe['tsi_slow'] = tsi(dataframe, window_slow=20, window_fast=5)\n        dataframe['tsi_ema_slow'] = ta.EMA(dataframe['tsi_slow'], timeperiod=5)\n\n        dataframe['tsi_fast'] = tsi(dataframe, window_slow=4, window_fast=2)\n        dataframe['tsi_ema_fast'] = ta.EMA(dataframe['tsi_fast'], timeperiod=2)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        buy_protection_list = []\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            not_empty_volume = dataframe['volume'].rolling(window=72, min_periods=72).count().notna()\n        else:\n            not_empty_volume = dataframe['volume'].rolling(window=self.startup_candle_count, min_periods=self.startup_candle_count).count().notna()\n\n        # Protections [STANDARD] - Common to every condition\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n            if global_buy_protection_params[\"ema_fast\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len'].value}\"] > dataframe['ema_200'])\n            if global_buy_protection_params[\"ema_slow\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len'].value}_1h\"] > dataframe['ema_200_1h'])\n            if global_buy_protection_params[\"close_above_ema_fast\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len'].value}\"])\n            if global_buy_protection_params[\"close_above_ema_slow\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len'].value}_1h\"])\n            if global_buy_protection_params[\"sma200_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'].value)))\n            if global_buy_protection_params[\"sma200_1h_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'].value)))\n            if global_buy_protection_params[\"safe_dips\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type'].value}\"])\n            if global_buy_protection_params[\"safe_pump\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period'].value}_{global_buy_protection_params['safe_pump_type'].value}_1h\"])\n            if global_buy_protection_params['btc_1h_not_downtrend'].value:\n                item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n            item_buy_protection_list.append(not_empty_volume)\n            buy_protection_list.append(item_buy_protection_list)\n\n        # Buy Condition #1\n        dataframe.loc[\n            :,\n            'buy_condition_1'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_1_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[0]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_1'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #2\n        dataframe.loc[\n            :,\n            'buy_condition_2'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_2_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[1]))\n            item_buy_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_2'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #3\n        dataframe.loc[\n            :,\n            'buy_condition_3'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_3_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[2].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[2]))\n            item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n            item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n            item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n            item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n            item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n            item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_3'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #4\n        dataframe.loc[\n            :,\n            'buy_condition_4'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_4_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[3]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n            item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_4'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #5\n        dataframe.loc[\n            :,\n            'buy_condition_5'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_5_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[4].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[4]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_5'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #6\n        dataframe.loc[\n            :,\n            'buy_condition_6'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_6_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[5]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_6'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #7\n        dataframe.loc[\n            :,\n            'buy_condition_7'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_7_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[6]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n            item_buy_logic.append(dataframe['cti'] < -0.7)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_7'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #8\n        dataframe.loc[\n            :,\n            'buy_condition_8'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_8_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[7]))\n            item_buy_logic.append(dataframe['moderi_32'])\n            item_buy_logic.append(dataframe['moderi_64'])\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_8.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_8.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_8'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #9\n        dataframe.loc[\n            :,\n            'buy_condition_9'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_9_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[8].append(dataframe['ema_50'] > dataframe['ema_200'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[8]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_9'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #10\n        dataframe.loc[\n            :,\n            'buy_condition_10'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_10_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[9].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[9]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_10'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #11\n        dataframe.loc[\n            :,\n            'buy_condition_11'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_11_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[10].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n            buy_protection_list[10].append(dataframe['safe_pump_36_50_1h'])\n            buy_protection_list[10].append(dataframe['safe_pump_48_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[10]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_11'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #12\n        dataframe.loc[\n            :,\n            'buy_condition_12'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_12_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[11]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_12'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #13\n        dataframe.loc[\n            :,\n            'buy_condition_13'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_13_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[12].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n            # buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[12]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_13'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #14\n        dataframe.loc[\n            :,\n            'buy_condition_14'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_14_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[13]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_14'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #15\n        dataframe.loc[\n            :,\n            'buy_condition_15'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_15_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[14].append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[14]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_15'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #16\n        dataframe.loc[\n            :,\n            'buy_condition_16'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_16_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[15]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_16'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #17\n        dataframe.loc[\n            :,\n            'buy_condition_17'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_17_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[16]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_17'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #18\n        dataframe.loc[\n            :,\n            'buy_condition_18'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_18_enable']:\n            # Non-Standard protections (add below)\n            # buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n            buy_protection_list[17].append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n            buy_protection_list[17].append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[17]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_18'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #19\n        dataframe.loc[\n            :,\n            'buy_condition_19'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_19_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[18].append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[18]))\n            item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n            item_buy_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_19'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #20\n        dataframe.loc[\n            :,\n            'buy_condition_20'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_20_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[19]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_20'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #21\n        dataframe.loc[\n            :,\n            'buy_condition_21'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_21_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[20]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_21'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #22\n        dataframe.loc[\n            :,\n            'buy_condition_22'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_22_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[21].append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n            buy_protection_list[21].append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[21]))\n            item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n            item_buy_logic.append(dataframe['safe_dump_20_1h'])\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_22'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #23\n        dataframe.loc[\n            :,\n            'buy_condition_23'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_23_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[22]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_23'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #24\n        dataframe.loc[\n            :,\n            'buy_condition_24'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_24_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[23]))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n            item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n            item_buy_logic.append(dataframe['cmf_1h'] > 0)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_24'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #25\n        dataframe.loc[\n            :,\n            'buy_condition_25'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_25_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[24]))\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_14.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(\n                (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n            )\n            item_buy_logic.append(dataframe['cti'] < -0.6)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_25'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #26\n        dataframe.loc[\n            :,\n            'buy_condition_26'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_26_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[25]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_26'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #27\n        dataframe.loc[\n            :,\n            'buy_condition_27'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_27_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[26]))\n            item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n            item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] + dataframe['rsi'] < self.buy_27_rsi_max.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_27'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #28\n        dataframe.loc[\n            :,\n            'buy_condition_28'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_28_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[27]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * 0.92)\n            item_buy_logic.append(dataframe['ewo'] > 12.4)\n            item_buy_logic.append(dataframe['rsi'] < 38.0)\n            item_buy_logic.append(dataframe['cti'] < -0.6)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_28'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #29\n        dataframe.loc[\n            :,\n            'buy_condition_29'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_29_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[28]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * 0.9)\n            item_buy_logic.append(dataframe['ewo'] < -4.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_29'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #30\n        dataframe.loc[\n            :,\n            'buy_condition_30'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_30_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[29]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * 0.97)\n            item_buy_logic.append(dataframe['ewo'] > 9.0)\n            item_buy_logic.append(dataframe['rsi'] < 42.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_30'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #31\n        dataframe.loc[\n            :,\n            'buy_condition_31'\n        ] = 0\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_31_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[30]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * 0.94)\n            item_buy_logic.append(dataframe['ewo'] < -19.0)\n            item_buy_logic.append(dataframe['r_480'] < -99.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_31'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #32\n        dataframe.loc[\n            :,\n            'buy_condition_32'\n        ] = 0\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_32_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[31]))\n            item_buy_logic.append(dataframe['moderi_32'])\n            item_buy_logic.append(dataframe['moderi_64'])\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < -0.8)\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n            item_buy_logic.append(dataframe['rsi_4'] < 46.0)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < 0.005)\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * 0.946))\n            item_buy_logic.append(\n                ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_32'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #33\n        dataframe.loc[\n            :,\n            'buy_condition_33'\n        ] = 0\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_33_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[32]))\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < -0.8)\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < 0.005)\n            item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * 0.954))\n            item_buy_logic.append(dataframe['ewo'] > 11.0)\n            item_buy_logic.append(dataframe['rsi'] < 36.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_33'\n            ] = 1\n            conditions.append(item_buy)\n\n        # Buy Condition #34\n        dataframe.loc[\n            :,\n            'buy_condition_34'\n        ] = 0\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_34_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[33]))\n            item_buy_logic.append(dataframe['cti'] < -0.88)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 1.1))\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < 0.002)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * 0.968)\n            item_buy_logic.append(dataframe['ewo'] < -20.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            dataframe.loc[\n                item_buy,\n                'buy_condition_34'\n            ] = 1\n            conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n        When not implemented by a strategy, returns True (always confirming).\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trade_ids:\n            # We have no pairs we want to hold until profit, sell\n            return True\n\n        if trade.id not in self.hold_trade_ids:\n            # This pair is not on the list to hold until profit, sell\n            return True\n\n        trade_profit_ratio = self.hold_trade_ids[trade.id]\n        current_profit_ratio = trade.calc_profit_ratio(rate)\n        if sell_reason == \"force_sell\":\n            formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n            formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n            log.warning(\n                \"Force selling %s even though the current profit of %s < %s\",\n                trade, formatted_current_profit_ratio, formatted_profit_ratio\n            )\n            return True\n        elif current_profit_ratio >= trade_profit_ratio:\n            # This pair is on the list to hold, and we reached minimum profit, sell\n            return True\n\n        # This pair is on the list to hold, and we haven't reached minimum profit, hold\n        return False\n\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\ndef tsi(dataframe: DataFrame, window_slow: int, window_fast: int, fillna=False) -> Series:\n    \"\"\"\n    Indicator: True Strength Index (TSI)\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param window_slow: slow smoothing period\n    :param window_fast: fast smoothing period\n    :param fillna: If True fill NaN values\n    \"\"\"\n    df = dataframe.copy()\n\n    min_periods_slow = 0 if fillna else window_slow\n    min_periods_fast = 0 if fillna else window_fast\n\n    close_diff            = df['close'].diff()\n    close_diff_abs        = close_diff.abs()\n    smooth_close_diff     = close_diff.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n    smooth_close_diff_abs = close_diff_abs.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n\n    tsi = smooth_close_diff / smooth_close_diff_abs * 100\n\n    if fillna:\n        tsi = tsi.replace([np.inf, -np.inf], np.nan).fillna(0)\n\n    return tsi\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )"
  },
  {
    "path": "strategies/NFIX_BB_RPB/NFIX_BB_RPB.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku, RMI\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityX by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=37365811                                       ##\n##  Kucoin: https://www.kucoin.com/ucenter/signup?rcode=rJTLZ9K                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NFIX_BB_RPB(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe_1d = '1d'\n    info_timeframe_1h = '1h'\n    info_timeframe_15m = '15m'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_custom_stoploss = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.01\n\n        return sl_new\n\n    ## Confirm Slippage\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = 1.0\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            #print(\"open rate is : \" + str(rate))\n            #print(\"last candle close is : \" + str(dataframe['close']))\n            #print(\"slippage is : \" + str(slippage) )\n            #print(\"############################################################################\")\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,            # ~0.11 / 90% / 15.01% / 1:30:00 (W) / S\n        \"buy_condition_2_enable\": True,            # ~0.06 / 90.9% / 12.54% / 10:12:00 (W) / F\n        \"buy_condition_3_enable\": True,            # ~0.10 / 100% / 0% / 4:40:00 (W) / S\n        \"buy_condition_4_enable\": True,            # ~0.03 / 100% / 0% / 1:42:00 (W) / S\n        \"buy_condition_5_enable\": True,            # ~0.31 / 100% / 0% / 1:30:00 (W) / S\n        \"buy_condition_6_enable\": True,            # ~0.08 / 100% / 0% / 1:35:00 (W) / S\n        \"buy_condition_7_enable\": True,            # ~0.03 / 100% / 0% / 1:39:00 (W) / S\n        \"buy_condition_8_enable\": True,            # ~0.12 / 100% / 0% / 1:12:00 (W) / S\n        \"buy_condition_9_enable\": True,            # ~0.22 / 100% / 0% / 2:07:00 (W) / S\n        \"buy_condition_10_enable\": True,           # ~0.15 / 100% / 0% / 1:04:00 (W) / S\n        \"buy_condition_11_enable\": True,           # ~0.22 / 100% / 0% / 0:21:00 (W) / S\n        \"buy_condition_12_enable\": True,           # ~0.09 / 100% / 0% / 0:34:00 (W) / S\n        \"buy_condition_13_enable\": True,           # ~0.10 / 94% / 21.08% / 1:19:00 (W) / S\n        \"buy_condition_14_enable\": True,           # ~0.08 / 100% / 0% / 0:50:00 (W) / S\n        \"buy_condition_15_enable\": True,           # ~0.07 / 92.3% / 11.71% / 4:57:00 (W) / S\n        \"buy_condition_16_enable\": True,           # ~0.01 / 100% / 0% / 1:55:00 (W) / S\n        \"buy_condition_17_enable\": True,           # ~0.11 / 94.7% / 10.94% / 4:11:00 (W) / S\n        \"buy_condition_18_enable\": True,           # ~0.12 / 95.5% / 8.69% / 0:54:00 (W) / S\n        \"buy_condition_19_enable\": True,           # ~0.09 / 100% / 0% / 6:39:00 (W) / F\n        \"buy_condition_20_enable\": True,           # ~0.03 / 100% / 0% / 1:25:00 (W) / S\n        \"buy_condition_21_enable\": True,           # ~0.10 / 100% / 0% / 0:42:00 (W) / S\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,           # ~0.10 / 94.1% / 12.53% / 3:17:00 (W) / ?\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,           # ~0.15 / 100% / 0% / 0:55:00 (W) / S\n        \"buy_condition_34_enable\": True,\n        ## BB_RPB begin\n        \"buy_condition_101_enable\": True,\n        \"buy_condition_102_enable\": True,\n        \"buy_condition_103_enable\": True,\n        \"buy_condition_104_enable\": True,\n        \"buy_condition_105_enable\": True,\n        \"buy_condition_106_enable\": True,\n        \"buy_condition_107_enable\": True,\n        \"buy_condition_108_enable\": True,\n        ## BB_RPB end\n        ## nfi 7 begin\n        \"buy_condition_701_enable\": True,\n        \"buy_condition_702_enable\": True,\n        ## nfi 7 end\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,           # ~0.24 / 97.6% / 6.22% / 1:05:00 (W) / S\n        \"buy_condition_38_enable\": True,           # ~0.24 / 100% / 0% / 1:29:00 (W) / S\n        \"buy_condition_39_enable\": True,           # ~0.11 / 100% / 0% / 1:16:00 (W) / S\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,           # ~0.24 / 97.6% / 7.37% / 1:21:00 (W) / S\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        \"buy_condition_44_enable\": True,\n        \"buy_condition_45_enable\": True,\n        \"buy_condition_46_enable\": True,\n        \"buy_condition_47_enable\": True,           # ~0.18 / 93.8% / 12.26% / 2:36:00 (W) / S\n        \"buy_condition_48_enable\": True,           # ~0.24 / 95.2% / 24.67% / 4:37:00 (W) / S\n        \"buy_condition_49_enable\": True,           # ~0.49 / 97.7% / 16.71% / 1:39:00 (W) / S\n        \"buy_condition_50_enable\": True,           # ~0.21 / 100% / 16.71% / 2:20:00 (W) / S\n        \"buy_condition_51_enable\": True,           # ~0.41 / 97.3% / 31.2% / 4:53:00 (W) / S\n        \"buy_condition_52_enable\": True,           # ~0.29 / 98.0% / 22.19% / 1:18:00 (W) / S\n        \"buy_condition_53_enable\": True,\n        \"buy_condition_54_enable\": True,\n        \"buy_condition_55_enable\": True,\n        \"buy_condition_56_enable\": True,\n        \"buy_condition_57_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.36,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        3: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.34,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup2\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.97,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.012,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.54,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.7,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.95,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.68,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02, # 0.03 0.015\n            \"safe_dips_threshold_2\"     : 0.09, # 0.08\n            \"safe_dips_threshold_12\"    : 0.3, # 0.48\n            \"safe_dips_threshold_144\"   : 0.9, # 0.9\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None, # 0.7\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"pivot\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        9: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.88,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.06,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.6,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        18: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.65,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        19: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.026,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        24: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.029,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        30: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.07\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        101: {   # ewo2\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.025,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.95,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        102: {   # ewo\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        103: {   # bb safe dump\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        104: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        105: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        106: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        107: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        108: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        701: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.029,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        702: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.021,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.2\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 2.0,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.55,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.25\n        },\n        40: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.55,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.7,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        41: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.018,\n            \"safe_dips_threshold_2\"     : 0.08,\n            \"safe_dips_threshold_12\"    : 0.2,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 3.2,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        42: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.022,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.4,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.5, # 0.5\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        43: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : 0.9,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.99,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        44: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        45: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : 0.8,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.35,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        46: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.016,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.85,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        47: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        48: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.3,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        49: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        50: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.56,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        51: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : 0.58,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        52: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.7,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.95,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        53: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        54: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.95,\n            \"safe_pump_48h_threshold\"   : 1.05,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        55: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 1.15,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        56: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        57: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        }\n    }\n\n    # Sell\n    sell_condition_1_enable = True\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def is_support(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] > row_data[row+1])\n            else:\n                conditions.append(row_data[row] < row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def is_resistance(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] < row_data[row+1])\n            else:\n                conditions.append(row_data[row] > row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_1_2_2'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 80.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_2_2_2'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 83.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_3_2_2'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_4_2_2'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_signal_6_1'\n            # elif (current_profit < -0.05) and (max_loss > 0.12):\n            #     return True, 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_7_2_2'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_8_2_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (\n                (last_candle['sma_200_dec_20'])\n                and (last_candle['ema_vwma_osc_32'] < -0.0)\n                and (last_candle['ema_vwma_osc_64'] < -0.0)\n                and (last_candle['ema_vwma_osc_96'] < -0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (current_time - timedelta(minutes=1440) > trade.open_date_utc)\n        ):\n            if (-0.12 <= current_profit < -0.0):\n                if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                    return True, 'sell_stoploss_atr_1'\n            elif (-0.16 <= current_profit < -0.12):\n                if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                    return True, 'sell_stoploss_atr_2'\n            elif (-0.2 <= current_profit < -0.16):\n                if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                    return True, 'sell_stoploss_atr_3'\n            elif (current_profit < -0.2):\n                if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                    return True, 'sell_stoploss_atr_4'\n\n        # Under & near EMA200, local uptrend move\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'] * 0.988)\n                and (last_candle['cmf'] < -0.046)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.022)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n                and (last_candle['sma_200_dec_24'])\n        ):\n            return True, 'sell_stoploss_u_e_1'\n\n        # # if (\n        # #         (current_profit < -0.00)\n        # #         and (last_candle['close'] < last_candle['ema_200'])\n        # #         and (last_candle['cmf'] < 0.0)\n        # #         and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.024)\n        # #         and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n        # #         and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n        # #         and (last_candle['sma_200_dec_24'])\n        # #         and (current_time - timedelta(minutes=60) > trade.open_date_utc)\n        # # ):\n        # #     return True, 'sell_stoploss_u_e_2'\n\n        # # # Under EMA200, local strong uptrend move\n        # # if (\n        # #         (current_profit < -0.08)\n        # #         and (last_candle['close'] < last_candle['ema_200'])\n        # #         and (last_candle['cmf'] < 0.0)\n        # #         and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n        # #         and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 24.0))\n        # #         and (last_candle['sma_200_dec_20'])\n        # #         and (last_candle['sma_200_dec_24'])\n        # #         and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        # # ):\n        # #     return True, 'sell_stoploss_u_e_2'\n\n        # # Under EMA200, pair negative, low max rate\n        # if (\n        #         (current_profit < -0.08)\n        #         and (max_profit < 0.05)\n        #         and (last_candle['close'] < last_candle['ema_200'])\n        #         and (last_candle['ema_25'] < last_candle['ema_50'])\n        #         and (last_candle['sma_200_dec_20'])\n        #         and (last_candle['sma_200_dec_24'])\n        #         and (last_candle['sma_200_dec_20_1h'])\n        #         and (last_candle['ema_vwma_osc_32'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_64'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        #         and (last_candle['cmf'] < -0.0)\n        #         and (last_candle['cmf_1h'] < -0.0)\n        #         and (last_candle['close'] < last_candle['sup_level_1h'])\n        #         and (last_candle['btc_not_downtrend_1h'] == False)\n        #         and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        # ):\n        #     return True, 'sell_stoploss_u_e_doom'\n\n        # # Under EMA200, pair and BTC negative, low max rate\n        # if (\n        #         (-0.05 > current_profit > -0.09)\n        #         and (last_candle['btc_not_downtrend_1h'] == False)\n        #         and (last_candle['ema_vwma_osc_32'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_64'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        #         and (max_profit < 0.005)\n        #         and (max_loss < 0.09)\n        #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        #         and (max_profit < 0.005)\n        #         and (max_loss < 0.09)\n        #         and (last_candle['sma_200_dec_20'])\n        #         and (last_candle['sma_200_dec_24'])\n        #         and (last_candle['sma_200_dec_20_1h'])\n        #         and (last_candle['cmf'] < -0.0)\n        #         and (last_candle['close'] < last_candle['ema_200'])\n        #         and (last_candle['ema_25'] < last_candle['ema_50'])\n        #         and (last_candle['cti'] < -0.8)\n        #         and (last_candle['r_480'] < -50.0)\n        # ):\n        #     return True, 'sell_stoploss_u_e_b_1'\n\n        # # # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative, normal max rate\n        # # elif (\n        # #         (-0.1 > current_profit > -0.2)\n        # #         and (last_candle['btc_not_downtrend_1h'] == False)\n        # #         and (last_candle['ema_vwma_osc_32'] < 0.0)\n        # #         and (last_candle['ema_vwma_osc_64'] < 0.0)\n        # #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        # #         and (max_profit < 0.05)\n        # #         and (max_loss < 0.2)\n        # #         and (last_candle['sma_200_dec_24'])\n        # #         and (last_candle['sma_200_dec_20_1h'])\n        # #         and (last_candle['cmf'] < -0.45)\n        # #         and (last_candle['close'] < last_candle['ema_200'])\n        # #         and (last_candle['ema_25'] < last_candle['ema_50'])\n        # #         and (last_candle['cti'] < -0.8)\n        # #         and (last_candle['r_480'] < -97.0)\n        # # ):\n        # #     return True, 'signal_stoploss_u_e_b_2'\n\n        return False, None\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96']):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_12_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_12_3'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_12_4'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_12_5'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_11_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_11_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_11_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_11_6'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_10_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_10_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_10_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_10_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_10_6'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_9_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_9_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_9_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_9_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_8_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_8_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_7_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_7_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_6_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_6_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_5_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_5_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_4_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_4_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_4_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_3_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_3_4'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_3_5'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_2_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_2_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_1_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_1_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_1_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_1_6'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_12_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_12_3'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_12_4'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_12_5'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_11_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_11_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_11_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_11_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_10_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_10_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_10_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_10_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_9_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_9_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_9_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_8_4'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_8_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_7_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_7_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_6_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_6_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_5_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_5_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_4_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_4_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_3_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_3_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_3_5'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_2_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_2_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_1_2'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_1_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_1_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_1_6'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_12_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_12_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_12_4'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_12_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_11_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_11_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_11_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_10_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_10_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_10_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_10_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_9_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_9_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_9_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_9_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_8_2'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_8_4'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_8_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_7_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_7_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_u_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_6_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_6_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_5_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_5_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_4_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_4_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_4_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_3_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_3_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_3_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_3_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_2_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_2_5'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_1_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_1_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_1_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_1_6'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_u_bear_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_12_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_12_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_12_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_12_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_u_bear_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_11_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_11_3'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_11_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_11_5'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_10_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_10_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_10_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_10_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_9_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_9_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_9_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_8_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_8_4'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_8_5'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_7_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_7_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_7_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_7_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_6_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_6_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_6_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_5_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_5_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_5_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_4_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_4_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_4_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_3_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_3_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_3_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_2_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_2_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_2_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_1_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_1_4'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_1_5'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_1_6'\n\n        return False, None\n\n    def sell_r(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.01 > current_profit > 0.001:\n            if (last_candle['r_96'] < -90.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.2):\n                return True, 'sell_profit_w_0_1'\n            elif (last_candle['rsi_14'] < 30.0) and (last_candle['r_96'] < -90.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.3) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_0_2'\n            elif (last_candle['rsi_14'] < 28.0) and (last_candle['cmf'] < -0.5) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_0_3'\n            elif (last_candle['r_480'] < -80.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'sell_profit_w_0_4'\n        elif 0.02 > current_profit >= 0.01:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_1_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_1_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_1_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_1_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_1_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_1_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_1_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_1_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_1_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_1_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_1_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_1_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_1_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_1_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_1_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_1_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_1_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_1_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_1_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_1_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_48'\n            elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_1_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_1_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_1_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_1_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_1_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_1_58'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_2_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_2_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_2_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 350.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_2_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_2_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_2_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_2_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_2_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_2_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_2_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_2_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_2_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_2_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_2_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_2_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_2_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_2_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_2_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_2_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_2_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_2_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_48'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_2_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_2_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_2_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_2_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_2_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_2_58'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -0.6):\n                return True, 'sell_profit_w_3_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_3_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_3_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_3_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_3_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_3_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_3_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_3_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_3_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_3_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_3_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_3_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_3_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_3_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_3_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_3_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_3_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_3_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_3_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_48'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_3_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_3_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_3_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_3_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_3_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_3_58'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -0.7):\n                return True, 'sell_profit_w_4_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_4_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_4_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_4_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_4_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_4_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_4_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_4_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_4_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_4_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_4_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_4_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_4_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_4_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_4_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_4_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_4_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_4_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_4_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_48'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_4_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_4_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_4_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_4_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_4_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_4_58'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -0.8):\n                return True, 'sell_profit_w_5_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 54.0):\n                return True, 'sell_profit_w_5_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_5_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_6'\n            elif (last_candle['rsi_14'] < 49.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 64.0):\n                return True, 'sell_profit_w_5_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_5_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_5_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_5_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_5_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_5_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_5_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_5_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 200.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_5_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_5_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_5_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_5_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_5_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_5_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_5_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_5_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_48'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_5_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_5_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_5_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_5_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_5_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_5_58'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -0.9):\n                return True, 'sell_profit_w_6_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_6_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_6_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_6_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_6_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_6_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0):\n                return True, 'sell_profit_w_6_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_6_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_6_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_6_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_6_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_6_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_6_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_6_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_6_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_6_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_6_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_6_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_6_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_48'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_6_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_6_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_6_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_6_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_6_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_6_58'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_7_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_7_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_7_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_7_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_7_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_7_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_7_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_7_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_7_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_7_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_7_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_7_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_7_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_7_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_7_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_7_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_7_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_7_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_7_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_48'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_7_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_7_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_7_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_7_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_7_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_7_58'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_8_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_8_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_8_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_8_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_8_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_8_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_8_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_8_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_8_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_8_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_8_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_8_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_8_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_8_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_8_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_8_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_8_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_8_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_48'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_8_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_8_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_8_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_8_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_8_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_8_58'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_9_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_9_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_9_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_9_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_9_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_9_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_9_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_9_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_9_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_9_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_9_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_9_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_9_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_9_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_9_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_9_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_9_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_9_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_9_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_48'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_9_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_9_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_9_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_9_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_9_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_9_58'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_10_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_10_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_10_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_6'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_10_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_10_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 240.0):\n                return True, 'sell_profit_w_10_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_10_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_10_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_10_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_10_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_10_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_10_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 300.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_10_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_10_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_10_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_10_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_10_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_10_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_10_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_10_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_48'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_10_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_10_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_10_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_10_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_10_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_10_58'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_11_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_11_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_11_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_6'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_11_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_11_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_11_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_11_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_11_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_11_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_11_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_11_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_11_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_11_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_11_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_11_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_11_37'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_11_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_11_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_11_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_11_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_11_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_48'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_11_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_11_51'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_11_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_11_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_11_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_11_58'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_12_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_w_12_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_12_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_6'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_12_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_12_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_12_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_12_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_12_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_12_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_12_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_12_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_12_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_12_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 340.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_32'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_12_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_12_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_12_37'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_12_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_12_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_12_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_12_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_12_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_48'\n            elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_12_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_12_51'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_12_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_12_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_12_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_12_58'\n\n        return False, None\n\n    def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 32.0):\n                return True, 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_t_0_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_0_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_5'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_6'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['sma_200_dec_20_15m']):\n                return True, 'sell_profit_t_0_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 49.0):\n                return True, 'sell_profit_t_0_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_10'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_6'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_1_8'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_1_11'\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_1_12'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_13'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_14'\n        elif 0.03 > current_profit >= 0.02:\n            if (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_1'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_2'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_2_4'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_6'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_7'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_2_8'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_2_9'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_2_10'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_2_12'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_13'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_14'\n        elif 0.04 > current_profit >= 0.03:\n            if (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_3_1'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_2'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_3'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_3_4'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_6'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_3_8'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_3_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_3_10'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_3_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_3_12'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_13'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_14'\n        elif 0.05 > current_profit >= 0.04:\n            if (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_4_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_3'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_4_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_6'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_7'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_4_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_4_9'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_4_10'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_4_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_4_12'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_13'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_14'\n        elif 0.06 > current_profit >= 0.05:\n            if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_5_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_2'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_3'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_5_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_7'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_5_8'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_5_9'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_5_10'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0):\n                return True, 'sell_profit_t_5_11'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_5_12'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_13'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_14'\n        elif 0.07 > current_profit >= 0.06:\n            if (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_t_6_1'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_2'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_3'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_6_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_7'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_6_8'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_6_9'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_6_10'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_6_11'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_6_12'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_13'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_14'\n        elif 0.08 > current_profit >= 0.07:\n            if (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_7_1'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_2'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_3'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_7_4'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_7'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_7_8'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_7_9'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_7_10'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_7_11'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_7_12'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_13'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_14'\n        elif 0.09 > current_profit >= 0.08:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_8_1'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_8_4'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_7'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_8_8'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_8_9'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_8_10'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_8_11'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_8_12'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_13'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_14'\n        elif 0.1 > current_profit >= 0.09:\n            if (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_9_1'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_2'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_3'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_9_4'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_7'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_9_8'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_9_9'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_9_10'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_9_11'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_9_12'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_13'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_14'\n        elif 0.12 > current_profit >= 0.1:\n            if (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_10_1'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_3'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_10_4'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 41.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_10_8'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_10_9'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_10_10'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_10_11'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_10_12'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_13'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_14'\n        elif 0.2 > current_profit >= 0.12:\n            if (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_11_1'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_2'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_3'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_11_4'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_7'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_11_8'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_11_9'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_11_10'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_11_11'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_11_12'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_13'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_14'\n        elif current_profit >= 0.2:\n            if (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_12_1'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_3'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_12_4'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_12_8'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_12_9'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_12_10'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 33.0):\n                return True, 'sell_profit_t_12_11'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_12_12'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_13'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_14'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['close'] > last_candle['ema_200']):\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):\n                    return True, 'sell_profit_d_o_1_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_4'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_1_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_7'\n                elif (last_candle['rsi_14'] > 70.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_1_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_1_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_1_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_1_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_1_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_1_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_1_14'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_1_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_1_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_1_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_1_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_19'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_2_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_2_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_2_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_2_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_2_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_2_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_2_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_2_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_2_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_2_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_2_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_2_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_2_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_19'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_3_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_3_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_3_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_3_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_3_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_3_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_3_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_3_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_3_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_3_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_3_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_3_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_3_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_19'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):\n                    return True, 'sell_profit_d_o_4_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_4_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_4_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_4_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_4_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_4_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_4_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_4_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_4_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_4_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_4_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_4_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_4_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_4_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_19'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_5_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_o_5_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_5_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_6'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_5_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_5_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_5_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_5_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_5_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_5_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_5_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_5_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_5_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_5_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_5_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_19'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_6_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_6_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_6_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_6_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_6_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_6_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_6_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_6_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_6_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_6_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_6_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_6_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_6_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_6_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_19'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_7_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_o_7_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_7_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_7_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_7_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_7_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_7_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_7_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_7_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_7_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_7_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_7_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_7_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_7_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_19'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):\n                    return True, 'sell_profit_d_o_8_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_2'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_8_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_8_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_8_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_8_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_8_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_8_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_8_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_8_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_8_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_8_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_8_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_8_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_19'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_9_1'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_2'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_4'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_9_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_7'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_9_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_9_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_9_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_9_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_9_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_9_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_9_14'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_9_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_9_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_9_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_9_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_19'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_10_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_o_10_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_4'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_10_5'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_6'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_7'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_10_8'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_10_9'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_10_10'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_10_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_10_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_10_13'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_10_14'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_10_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_10_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_10_17'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_10_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_19'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_11_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):\n                    return True, 'sell_profit_d_o_11_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_4'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_11_5'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_6'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_7'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_11_8'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_11_9'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_11_10'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_11_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_11_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_11_13'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_11_14'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_11_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_11_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_11_17'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_11_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_19'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_12_1'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_12_2'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_4'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_12_5'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_6'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_7'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_12_8'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_12_9'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_12_10'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_12_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_12_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_12_13'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_12_14'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_12_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_12_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_12_17'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_12_18'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_19'\n        else:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_1_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_1_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_1_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_7'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_1_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_1_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_1_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_1_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_1_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_1_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_1_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_1_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_1_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_1_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_1_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_19'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_2_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_2_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_2_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_2_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_2_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_2_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_2_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_2_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_2_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_2_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_2_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_2_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_2_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_2_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_19'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_3_1'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_4'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_3_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_7'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_3_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_3_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_3_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_3_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_3_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_3_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_3_14'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_3_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_3_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_3_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_3_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_19'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_4_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_4_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_4'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_4_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_7'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_4_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_4_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_4_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_4_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_4_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_4_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_4_14'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_4_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_4_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_4_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_4_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_19'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_5_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                    return True, 'sell_profit_d_u_5_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_3'\n                elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_4'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_5_5'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_7'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_5_8'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_5_9'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_5_10'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_5_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 55.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_5_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_5_13'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_5_14'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_5_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_5_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_5_17'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_5_18'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_19'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_6_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):\n                    return True, 'sell_profit_d_u_6_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_4'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_6_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_7'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_6_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_6_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_6_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_6_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_6_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_6_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_6_14'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_6_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_6_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_6_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_6_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_19'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_7_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_7_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_4'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_7_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_7'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_7_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_7_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_7_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_7_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_7_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_7_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_7_14'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_7_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_7_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_7_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_7_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_19'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_8_1'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_8_2'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_8_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_8_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_8_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_8_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_8_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_8_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_8_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_8_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_8_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_8_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_8_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_8_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_19'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_9_1'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_9_2'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_9_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_6'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_9_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_9_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_9_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_9_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_9_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_9_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_9_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_9_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_9_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_9_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_9_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_19'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_10_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_10_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_6'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_10_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_10_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_10_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_10_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_10_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_10_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_10_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_10_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_10_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_10_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_10_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_19'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_11_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_11_5'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_6'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_11_8'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_11_9'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_11_10'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_11_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_11_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_11_13'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_11_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_11_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_11_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_11_17'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_11_18'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_19'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_12_1'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_u_12_2'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_4'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_12_5'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_6'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_7'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_12_8'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_12_9'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_12_10'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_12_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_12_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_12_13'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_12_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_12_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_12_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_12_17'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_12_18'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_19'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.8):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_2_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.5):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bear_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.72):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bull_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bull_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_36_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bear_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_36_1_1_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.68):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bull_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_p_bull_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bull_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_24_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bear_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bear_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_24_1_1_1'\n\n        return False, None\n\n    def sell_pump_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.95):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.005)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_1'\n            elif (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.01)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n            ):\n                return True, 'sell_stoploss_p_36_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\n            if (\n                    (-0.05 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['rsi_14'] < 40.0)\n            ):\n                return True, 'sell_stoploss_p_36_2_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n            ):\n                return True, 'sell_stoploss_p_24_1_1'\n\n\n        return False, None\n\n    def sell_pivot(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.2)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_12_1'\n\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.1)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_12_1'\n\n        if (last_candle['close'] > (last_candle['res1_1d'] * 1.0)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_12_1'\n        return False, None\n\n    def sell_long_mode(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        if (0.0 < current_profit <= 0.02) and (max_profit - current_profit > 0.025) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_0'\n        elif (0.02 < current_profit <= 0.04) and (max_profit - current_profit > 0.03) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_1'\n        elif (0.04 < current_profit <= 0.06) and (max_profit - current_profit > 0.035) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_2'\n        elif (0.06 < current_profit <= 0.08) and (max_profit - current_profit > 0.04) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_3'\n        elif (0.08 < current_profit <= 0.1) and (max_profit - current_profit > 0.045) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_4'\n        elif (0.1 < current_profit <= 0.12) and (max_profit - current_profit > 0.05) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_5'\n        elif (0.12 < current_profit <= 0.14) and (max_profit - current_profit > 0.055) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_6'\n        elif (0.14 < current_profit <= 0.16) and (max_profit - current_profit > 0.06) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_7'\n        elif (0.16 < current_profit <= 0.18) and (max_profit - current_profit > 0.065) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.18 < current_profit <= 0.2) and (max_profit - current_profit > 0.07) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.2 < current_profit <= 0.3) and (max_profit - current_profit > 0.075) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_9'\n        elif (0.3 < current_profit <= 0.4) and (max_profit - current_profit > 0.08) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_10'\n        elif (0.4 < current_profit <= 0.5) and (max_profit - current_profit > 0.085) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_11'\n        elif (0.5 < current_profit <= 1.0) and (max_profit - current_profit > 0.09) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (0.04 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return True, 'signal_profit_q_pmax_bull'\n        if (0.045 > current_profit > 0.005) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_coh'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Long mode\n        if all(c in ['31', '32', '33', '34', '35', '36'] for c in buy_tags):\n            sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n            # Skip remaining sell logic for long mode\n            return None\n\n        # Quick sell mode\n        if all(c in ['empty', '104', '105'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sells\n        sell, signal_name = self.sell_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Sell logic for pumped pairs\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, stoploss\n        sell, signal_name = self.sell_pump_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pivot points based sells\n        sell, signal_name = self.sell_pivot(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n        informative_pairs.extend([(pair, self.info_timeframe_15m) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_15m))\n\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        # S/R\n        res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n        informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()\n        informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EMAs\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # EWO\n        informative_1h['ewo'] = ewo(informative_1h, 50, 200)\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(informative_1h, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n\n        # S/R\n        res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n        informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)\n        informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)\n\n        # nfi 37\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = ewo(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # EMAs\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        ## BB 20 - STD3\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std2['lower']\n        dataframe['bb20_3_mid'] = bb_20_std2['mid']\n        dataframe['bb20_3_upp'] = bb_20_std2['upper']\n\n        # Other BB 20 checks\n        dataframe['bb_width'] = ((dataframe['bb20_2_upp'] - dataframe['bb20_2_low']) / dataframe['bb20_2_mid'])\n        dataframe['bb_delta'] = ((dataframe['bb20_2_low'] - dataframe['bb20_3_low']) / dataframe['bb20_2_low'])\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_24'] = williams_r(dataframe, period=24)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RMI\n        dataframe['rmi_17'] = RMI(dataframe, length=17, mom=4)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n        dataframe['cci_25'] = ta.CCI(dataframe, timeperiod=25)\n\n        # SRSI\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 3.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 3.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Volume\n        dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)\n        dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)\n        dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_15m != 'none':\n            informative_15m = self.informative_15m_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.info_timeframe_15m, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_15m}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump_6h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params[\"safe_pump_6h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_12h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params[\"safe_pump_12h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_24h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params[\"safe_pump_24h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_36h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params[\"safe_pump_36h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_48h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params[\"safe_pump_48h_threshold\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(12).min()) / dataframe['open'].rolling(12).min()) > 0.032)\n                    item_buy_logic.append(dataframe['rsi_14'] < 36.0)\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['r_32'] < -75.0)\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 30.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 84.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -99.0)\n\n                # Condition #2 - Semi swing. Local dip.\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < (dataframe['rsi_14_1h'] - 47.0))\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -98.0)\n                    item_buy_logic.append(dataframe['r_480'] > -95.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.82)\n\n                # Condition #3 - Semi swing. Local dip.\n                elif index == 3:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_96'] < -80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.75)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -30.0)\n\n                # Condition #4 - Semi swing. Local dip.\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.992))\n                    item_buy_logic.append(dataframe['rsi_14'] > 30.0)\n                    item_buy_logic.append(dataframe['mfi'] > 25.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #5 - Semi swing. Local dip. Uptrend.\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo'] > 3.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.93)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #6 - Semi swing. Local dip.\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.937)\n                    item_buy_logic.append(dataframe['crsi'] < 30.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.82)\n                    item_buy_logic.append(dataframe['cci'] < -200.0)\n\n                # Condition #7 - Semi swing. Local dip.\n                elif index == 7:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.94)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.984)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi'] > 8.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.85)\n\n                # Condition #8 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.927)\n                    item_buy_logic.append(dataframe['ewo'] > 3.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #9 - Semi swing. Local dip. Downtrend.\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.99)\n                    item_buy_logic.append(dataframe['cti'] < -0.92)\n                    item_buy_logic.append(dataframe['ewo'] < -5.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.88)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 20.0)\n\n                # Condition #10 - Semi swing. Local dip.\n                elif index == 10:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.017))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.965)\n                    item_buy_logic.append(dataframe['cti'] < -0.85)\n\n                # Condition #11 - Semi swing. Local dip.\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.932)\n                    item_buy_logic.append(dataframe['rsi_14'] < 25.0)\n\n                # Condition #12 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo'] > 0.1)\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n\n                # Condition #13 - Semi swing. Downtrend. Local dip.\n                elif index == 13:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.999)\n                    item_buy_logic.append(dataframe['ewo'] < -5.7)\n                    item_buy_logic.append(dataframe['cti'] < -0.97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 12.0)\n\n                # Condition #14 - Semi swing. Strong uptrend. Local dip.\n                elif index == 14:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.98)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['ewo'] > 7.8) # 4.0 7.8\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0) # 36.0\n                    item_buy_logic.append(dataframe['cti'] < -0.54)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #15 - Semi swing. Uptrend. Local dip.\n                elif index == 15:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.986))\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.5)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.62)\n\n                # Condition #16 - Semi swing. Cross above.\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 50.0)\n                    item_buy_logic.append(dataframe['cti'] < 0.5)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 70.0)\n\n                # Condition #17 - Semi swing. Deep buy.\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -99.0)\n                    item_buy_logic.append(dataframe['r_14'] == -100.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -95.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < 40.0)\n\n                # Condition #18 - Semi swing. Local dip. BTC not negative.\n                elif index == 18:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.982))\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #19 - Semi swing. Uptrend. Local dip.  BTC not downtrend.\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.75)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.25)\n\n                # Condition #20 - Semi swing. Uptrend. Local dip.\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.942))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n\n                # Condition #21 - Semi swing. Deep local dip. Mild uptrend.\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.941)\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.84)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -85.0)\n\n                # Condition #22 - Swing. Uptrend. Bounce from daily support level\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close_1h'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['sup_level_1d'] * 1.05)\n                    item_buy_logic.append(dataframe['low_1h'] < dataframe['sup_level_1d'] * 0.99)\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['res_level_1h'])\n                    item_buy_logic.append(dataframe['res_level_1d'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 48.0)\n\n                    # Confirm uptrend - Heikin-Ashi\n                    item_buy_logic.append(dataframe['open_sha_1d'] < dataframe['close_sha_1d'])\n                    item_buy_logic.append(dataframe['open_sha_1d'].shift(288) < dataframe['close_sha_1d'].shift(288))\n                    item_buy_logic.append(dataframe['pivot_1d'] > dataframe['pivot_1d'].shift(288) * 0.95)\n\n                # Condition #23 - Semi swing. Downtrend. Local dip.\n                elif index == 23:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'].shift(1) < -6.4)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 2.0)\n\n                # Condition #24 - Semi swing. Uptrend. 1h uptrend. Local dip.\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 2.8)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.92)\n\n                # Condition #25 - Semi swing. CMF 1h cross.\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 48.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 66.9)\n\n                # Condition #26 - Semi swing. Local deep dip.\n                elif index == 26:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < 46)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.93)\n                    item_buy_logic.append(dataframe['rsi_14'] > 19.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.86)\n\n                # Condition #27 - Semi swing. Local deep. Uptrend.\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.934)\n                    item_buy_logic.append(dataframe['ewo'] > 6.4)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n\n                # Condition #28 - Semi swing. Downtrend. Local deep.\n                elif index == 28:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.96)\n                    item_buy_logic.append(dataframe['ewo'] < -8.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #29 - Semi swing. Downtrend. Local deep.\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.982))\n                    item_buy_logic.append(dataframe['ewo'] < -16.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n\n                # Condition #30 - Semi swing. Local dip. BTC not downtrend.\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))\n\n                # Condition #31 - Long mode. Local dip.\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.028))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.25))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #32 - Long mode. Local dip.\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.046))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n\n                # Condition #33 - Long mode. Local dip. Uptrend.\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.934))\n                    item_buy_logic.append(dataframe['ewo'] > 2.5)\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 0.1)\n\n                # Condition #34 - Long mode. Local dip.\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.972))\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 18.0)\n\n                ### BB_RPB backport\n\n                # ewo2 (need more protection)\n                elif index == 101:\n\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['roc_1h'] < 86)\n                    item_buy_logic.append(dataframe['bb_width_1h'] < 0.954)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_4'] < 45)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.970)\n                    item_buy_logic.append(dataframe['ewo'] > 4.179)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 1.087)\n                    item_buy_logic.append(dataframe['rsi_14'] < 35)\n\n                # ewo\n                elif index == 102:\n\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['roc_1h'] < 86)\n                    item_buy_logic.append(dataframe['bb_width_1h'] < 0.954)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_4'] < 44)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.935)\n                    item_buy_logic.append(dataframe['ewo'] > -5.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 0.968)\n                    item_buy_logic.append(dataframe['rsi_14'] < 23)\n\n                # BB safe dump\n                elif index == 103:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rmi_17'] < 49)\n                    item_buy_logic.append(dataframe['cci_25'] <= -116)\n                    item_buy_logic.append(dataframe['srsi_fk'] < 32)\n                    item_buy_logic.append(dataframe['bb_delta'] > 0.025)\n                    item_buy_logic.append(dataframe['bb_width'] > 0.095)\n                    item_buy_logic.append(dataframe['closedelta'] > dataframe['close'] * 12.148 / 1000 )\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_3_low'] * 0.999)\n\n                # NFI 33\n                elif index == 104:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * 0.978)\n                    item_buy_logic.append(dataframe['ewo'] > 8)\n                    item_buy_logic.append(dataframe['cti'] < -0.88)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32)\n                    item_buy_logic.append(dataframe['r_14'] < -98.0)\n                    item_buy_logic.append(dataframe['volume'] < dataframe['volume_mean_4'] * 2.5)\n\n                # NFI 38\n                elif index == 105:\n\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -4.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.95)\n                    item_buy_logic.append(dataframe['r_14'] < -97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 0.5)\n\n                # reverse deadfish\n                elif index == 106:\n\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_100'] < dataframe['ema_200'] * 1.054)\n                    item_buy_logic.append(dataframe['bb_width'] > 0.3)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_mid'] * 1.014)\n                    item_buy_logic.append(dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * 1.59)\n                    item_buy_logic.append(dataframe['cti'] < -0.115)\n                    item_buy_logic.append(dataframe['r_14'] < -44.34)\n\n                # Cofi\n                elif index == 107:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['open'] < dataframe['ema_8'] * 1.147)\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                    item_buy_logic.append(dataframe['fastk'] < 39)\n                    item_buy_logic.append(dataframe['fastd'] < 28)\n                    item_buy_logic.append(dataframe['adx'] > 13)\n                    item_buy_logic.append(dataframe['ewo'] > 8.594)\n                    item_buy_logic.append(dataframe['cti'] < -0.892)\n                    item_buy_logic.append(dataframe['r_14'] < -85.016)\n\n                # Gumbo\n                elif index == 108:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] < -9.442)\n                    item_buy_logic.append(dataframe['bb20_2_mid_1h'] >= dataframe['T3_1h'])\n                    item_buy_logic.append(dataframe['T3'] <= dataframe['ema_8'] * 1.121)\n                    item_buy_logic.append(dataframe['cti'] < -0.374)\n                    item_buy_logic.append(dataframe['r_14'] < -51.971)\n\n                # nfi7 33\n                elif index == 701:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < -0.88)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * 0.988))\n                    item_buy_logic.append(dataframe['ewo'] > 6.4)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 2.0))\n\n                # nfi7 37\n                elif index == 702:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] > 9.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 56.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.7)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #35 - Long mode. Local deep dip.\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_25'] * 0.85)\n                    item_buy_logic.append(dataframe['close'] > dataframe['open'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['mfi'] < 36.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.85)\n\n                # Condition #36 - Long mode. Uptrend. Local dip.\n                elif index == 36:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.956)\n                    item_buy_logic.append(dataframe['rsi_14'] < 34.0)\n                    item_buy_logic.append(dataframe['r_64'] < -80.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -30.0)\n\n                # Condition #37 - Semi swing. Uptrend. Local dip.\n                elif index == 37:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.986))\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['r_64'] < -75.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] < 0.25)\n\n                # Condition #38 - Semi swing. Uptrend. Local dip.\n                elif index == 38:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['mfi'] < 34.5)\n                    item_buy_logic.append(dataframe['r_64'] < -65.0)\n                    item_buy_logic.append(dataframe['r_96'] < -50.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -1.0)\n\n                # Condition #39 - Semi swing. Uptrend. Local dip.\n                elif index == 39:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.056))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.01))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_50'] * 0.925)\n\n                # Condition #40 - Semi swing. Uptrend. Local dip.\n                elif index == 40:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.97)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_64'] < -80.0)\n\n                # Condition #41 - 15m. Semi swing. Local dip. BTC not downtrend.\n                elif index == 41:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n\n                # Condition #42 - 15m. Semi swing. Local dip. 15m uptrend.\n                elif index == 42:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 5.4)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 36.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['cci_15m'] < -160.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.5)\n\n                # Condition #43 - 15m. Semi swing. Local dip. 1h uptrend.\n                elif index == 43:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low_15m'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta_15m'].gt(dataframe['close_15m'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta_15m'].gt(dataframe['close_15m'] * 0.034))\n                    item_buy_logic.append(dataframe['tail_15m'].lt(dataframe['bb40_2_delta_15m'] * 0.18))\n                    item_buy_logic.append(dataframe['close_15m'].lt(dataframe['bb40_2_low_15m'].shift()))\n                    item_buy_logic.append(dataframe['close_15m'].le(dataframe['close_15m'].shift()))\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 30.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.85)\n                    item_buy_logic.append(dataframe['r_64_15m'] < -70.0)\n\n                # Condition #44 - 15m. Semi swing. Local deeper dip. 15m uptrend.\n                elif index == 44:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_15m'] > (dataframe['ema_200_15m'].shift(36) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_26_15m'] * 0.942)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 28.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n\n                # Condition #45 - 15m. Semi swing. Local deeper dip. 15m uptrend.\n                elif index == 45:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_15m'] > dataframe['ema_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.934)\n                    item_buy_logic.append(dataframe['ewo_15m'] > 3.6)\n                    item_buy_logic.append(dataframe['cci_15m'] < -190.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -97.0)\n                    item_buy_logic.append((dataframe['rsi_14_1h'] + dataframe['rsi_14_15m']) < 70.0)\n\n                # Condition #46 - 15m. Semi swing. 1h uptrend.\n                elif index == 46:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.027))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.982))\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #47 - 15m. Semi swing. Local dip. 1h minor dip.\n                elif index == 47:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3))\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95))\n                    item_buy_logic.append(\n                        ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h'])))\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 8.0)\n\n                # Condition #48 - 15m. Semi swing. Local deep. 15m uptrend.\n                elif index == 48:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95))\n                    item_buy_logic.append(dataframe['close_15m'] > (dataframe['open_15m'].shift(3)))\n                    item_buy_logic.append(dataframe['ewo_15m'] > 2.8)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 18.0)\n\n                # Condition #49 - 15m. Semi swing. Local deeper dip.\n                elif index == 49:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.916)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 32.5)\n                    item_buy_logic.append(dataframe['crsi_15m'] > 18.0)\n\n                # Condition #50 - 15m. Semi swing. Deep local dip. Mild 15m uptrend.\n                elif index == 50:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo_15m'] > 1.8)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n                    item_buy_logic.append(dataframe['r_96_15m'] < -75.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -97.0)\n\n                # Condition #51 - 15m. Semi swing. Downtrend. Dip.\n                elif index == 51:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944))\n                    item_buy_logic.append(dataframe['ewo_15m'] < -1.0)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] > 28.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.84)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -94.0)\n                    item_buy_logic.append(dataframe['rsi_14'] > 30.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 1.0)\n\n                # Condition #52 - 15m Semi swing. Local dip. BTC not downtrend.\n                elif index == 52:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #53 - 15m. Semi swing. BTC not negative. Local dip.\n                elif index == 53:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.0198))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.7)\n\n                # Condition #54 - 15m Semi swing. Uptrend. Local dip.\n                elif index == 54:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_15m'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.4)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n                    item_buy_logic.append(dataframe['r_96_15m'] < -94.0)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n\n                # Condition #55 - 15m. Semi swing. Uptrend. Local dip.\n                elif index == 55:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.0)\n                    item_buy_logic.append(dataframe['close_15m'] > (dataframe['close_15m'].shift(3)))\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.986))\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -95.0)\n                    item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -86.0)\n\n                # Condition #56 - 15m. Semi swing. Downtrend. Local dip.\n                elif index == 56:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'].shift(3) < -14.0)\n                    item_buy_logic.append(dataframe['cti_15m'].shift(3).rolling(15).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -90.0)\n\n                # Condition #57 - 15m. Semi swing. Strong uptrend. Local dip. BTC not downtrend.\n                elif index == 57:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'].shift(3) > 6.5)\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_30_15m'].shift(3) * 0.988))\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.996))\n                    item_buy_logic.append(dataframe['rsi_14_15m'].shift(3) < 31.2)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)\n                    item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -80.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -18.0)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        return True\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data\n"
  },
  {
    "path": "strategies/NFIX_BB_RPB_c7c477d_20211030/NFIX_BB_RPB_c7c477d_20211030.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku, RMI\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityX by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=37365811                                       ##\n##  Kucoin: https://www.kucoin.com/ucenter/signup?rcode=rJTLZ9K                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NFIX_BB_RPB_c7c477d_20211030(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_1d = '1d'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    use_custom_stoploss = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.01\n\n        return sl_new\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        # BB_RPB backport\n        \"buy_condition_35_enable\": True,        # False\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.36,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        3: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.34,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup2\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.97,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.012,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.54,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.7,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.95,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.025,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.95,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02, # 0.03 0.015\n            \"safe_dips_threshold_2\"     : 0.09, # 0.08\n            \"safe_dips_threshold_12\"    : 0.3, # 0.48\n            \"safe_dips_threshold_144\"   : 0.9, # 0.9\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None, # 0.7\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"pivot\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        9: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup2\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.6,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        18: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.65,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        19: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.026,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        24: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        30: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.07\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        35: {   # ewo2\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.025,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.95,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        36: {   # ewo\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        37: {   # bb safe dump\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        }\n    }\n\n    # Sell\n    sell_condition_1_enable = True\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def is_support(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] > row_data[row+1])\n            else:\n                conditions.append(row_data[row] < row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def is_resistance(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] < row_data[row+1])\n            else:\n                conditions.append(row_data[row] > row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_1_2_2'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 80.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_2_2_2'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 83.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_3_2_2'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_4_2_2'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_signal_6_1'\n            # elif (current_profit < -0.05) and (max_loss > 0.12):\n            #     return True, 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_7_2_2'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_8_2_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (\n                (last_candle['sma_200_dec_20'])\n                and (last_candle['ema_vwma_osc_32'] < -0.0)\n                and (last_candle['ema_vwma_osc_64'] < -0.0)\n                and (last_candle['ema_vwma_osc_96'] < -0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (current_time - timedelta(minutes=1440) > trade.open_date_utc)\n        ):\n            if (-0.12 <= current_profit < -0.08):\n                if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                    return True, 'sell_stoploss_atr_1'\n            elif (-0.16 <= current_profit < -0.12):\n                if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                    return True, 'sell_stoploss_atr_2'\n            elif (-0.2 <= current_profit < -0.16):\n                if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                    return True, 'sell_stoploss_atr_3'\n            elif (current_profit < -0.2):\n                if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                    return True, 'sell_stoploss_atr_4'\n\n        # # Under & near EMA200, local uptrend move\n        # if (\n        #         (current_profit < -0.05)\n        #         and (last_candle['close'] < last_candle['ema_200'])\n        #         and (last_candle['cmf'] < 0.0)\n        #         and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.024)\n        #         and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n        #         and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n        #         and (last_candle['sma_200_dec_24'])\n        #         and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        # ):\n        #     return True, 'sell_stoploss_u_e_1'\n\n        # # if (\n        # #         (current_profit < -0.00)\n        # #         and (last_candle['close'] < last_candle['ema_200'])\n        # #         and (last_candle['cmf'] < 0.0)\n        # #         and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.024)\n        # #         and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n        # #         and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n        # #         and (last_candle['sma_200_dec_24'])\n        # #         and (current_time - timedelta(minutes=60) > trade.open_date_utc)\n        # # ):\n        # #     return True, 'sell_stoploss_u_e_2'\n\n        # # # Under EMA200, local strong uptrend move\n        # # if (\n        # #         (current_profit < -0.08)\n        # #         and (last_candle['close'] < last_candle['ema_200'])\n        # #         and (last_candle['cmf'] < 0.0)\n        # #         and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n        # #         and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 24.0))\n        # #         and (last_candle['sma_200_dec_20'])\n        # #         and (last_candle['sma_200_dec_24'])\n        # #         and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        # # ):\n        # #     return True, 'sell_stoploss_u_e_2'\n\n        # # Under EMA200, pair negative, low max rate\n        # if (\n        #         (current_profit < -0.08)\n        #         and (max_profit < 0.05)\n        #         and (last_candle['close'] < last_candle['ema_200'])\n        #         and (last_candle['ema_25'] < last_candle['ema_50'])\n        #         and (last_candle['sma_200_dec_20'])\n        #         and (last_candle['sma_200_dec_24'])\n        #         and (last_candle['sma_200_dec_20_1h'])\n        #         and (last_candle['ema_vwma_osc_32'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_64'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        #         and (last_candle['cmf'] < -0.0)\n        #         and (last_candle['cmf_1h'] < -0.0)\n        #         and (last_candle['close'] < last_candle['sup_level_1h'])\n        #         and (last_candle['btc_not_downtrend_1h'] == False)\n        #         and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        # ):\n        #     return True, 'sell_stoploss_u_e_doom'\n\n        # # Under EMA200, pair and BTC negative, low max rate\n        # if (\n        #         (-0.05 > current_profit > -0.09)\n        #         and (last_candle['btc_not_downtrend_1h'] == False)\n        #         and (last_candle['ema_vwma_osc_32'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_64'] < 0.0)\n        #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        #         and (max_profit < 0.005)\n        #         and (max_loss < 0.09)\n        #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        #         and (max_profit < 0.005)\n        #         and (max_loss < 0.09)\n        #         and (last_candle['sma_200_dec_20'])\n        #         and (last_candle['sma_200_dec_24'])\n        #         and (last_candle['sma_200_dec_20_1h'])\n        #         and (last_candle['cmf'] < -0.0)\n        #         and (last_candle['close'] < last_candle['ema_200'])\n        #         and (last_candle['ema_25'] < last_candle['ema_50'])\n        #         and (last_candle['cti'] < -0.8)\n        #         and (last_candle['r_480'] < -50.0)\n        # ):\n        #     return True, 'sell_stoploss_u_e_b_1'\n\n        # # # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative, normal max rate\n        # # elif (\n        # #         (-0.1 > current_profit > -0.2)\n        # #         and (last_candle['btc_not_downtrend_1h'] == False)\n        # #         and (last_candle['ema_vwma_osc_32'] < 0.0)\n        # #         and (last_candle['ema_vwma_osc_64'] < 0.0)\n        # #         and (last_candle['ema_vwma_osc_96'] < 0.0)\n        # #         and (max_profit < 0.05)\n        # #         and (max_loss < 0.2)\n        # #         and (last_candle['sma_200_dec_24'])\n        # #         and (last_candle['sma_200_dec_20_1h'])\n        # #         and (last_candle['cmf'] < -0.45)\n        # #         and (last_candle['close'] < last_candle['ema_200'])\n        # #         and (last_candle['ema_25'] < last_candle['ema_50'])\n        # #         and (last_candle['cti'] < -0.8)\n        # #         and (last_candle['r_480'] < -97.0)\n        # # ):\n        # #     return True, 'signal_stoploss_u_e_b_2'\n\n        return False, None\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96']):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 30.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_12_2'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_2_2'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_1_2'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 31.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_12_2'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_11_2'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_10_2'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_2_2'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_1_2'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 31.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_12_2'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_10_2'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_1_2'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_12_2'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_11_2'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_10_2'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'sell_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_1_2'\n\n        return False, None\n\n    def sell_r(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_1_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_1_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_1_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_1_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_1_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -2.0):\n                return True, 'sell_profit_w_1_6'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_7'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_1_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_1_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_1_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_12'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_1_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_1_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_1_17'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_2_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_2_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_2_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 78.5):\n                return True, 'sell_profit_w_2_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_2_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 350.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_2_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_7'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_2_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_2_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_2_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_2_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_2_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_2_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_2_17'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -0.6):\n                return True, 'sell_profit_w_3_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_3_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_3_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_3_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_3_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_3_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_7'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_3_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_3_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_3_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_3_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_3_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_3_17'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -0.7):\n                return True, 'sell_profit_w_4_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_4_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_4_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 77.5):\n                return True, 'sell_profit_w_4_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_4_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -6.0):\n                return True, 'sell_profit_w_4_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_4_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_4_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -7.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_4_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_4_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_4_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_4_17'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -0.8):\n                return True, 'sell_profit_w_5_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_5_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_5_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_5_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_5_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_5_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 65.0):\n                return True, 'sell_profit_w_5_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_5_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_5_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_5_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_5_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_5_17'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -0.9):\n                return True, 'sell_profit_w_6_1'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_6_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_6_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 76.5):\n                return True, 'sell_profit_w_6_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_6_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_6_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_6_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_6_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -9.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_6_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_6_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_6_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_6_17'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_7_1'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_7_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_7_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_7_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_7_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -12.0):\n                return True, 'sell_profit_w_7_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_7'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_7_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_7_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_7_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_7_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_7_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_7_17'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_8_1'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_8_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_8_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_8_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_8_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_8_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_7'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_8_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_8_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -7.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_8_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_8_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_8_17'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_9_1'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_9_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_9_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_9_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_9_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_9_6'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_7'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_9_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_9_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_9_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_9_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_9_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_9_17'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_10_1'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_10_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_10_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 78.5):\n                return True, 'sell_profit_w_10_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_10_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -6.0):\n                return True, 'sell_profit_w_10_6'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_7'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_10_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 240.0):\n                return True, 'sell_profit_w_10_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_10_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_12'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_10_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_10_17'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_11_1'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_11_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_w_11_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_11_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_11_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_11_6'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_7'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_11_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_11_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 81.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_11_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_11_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_12'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_11_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_11_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_11_17'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_12_1'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_12_2'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] < 32.0):\n                return True, 'sell_profit_w_12_3'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'sell_profit_w_12_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_12_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_96'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -2.0):\n                return True, 'sell_profit_w_12_6'\n            elif (last_candle['rsi_14'] < 38.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_7'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['r_96'] >= -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_12_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_12_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 81.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_12_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_12_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_12'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_12_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 81.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_12_17'\n\n        return False, None\n\n    def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 32.0): # 32.0\n                return True, 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_t_0_3'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_6'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_1_8'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_1_11'\n        elif 0.03 > current_profit >= 0.02:\n            if (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_1'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_2'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_2_4'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_6'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_7'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_2_8'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_2_9'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_2_10'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_11'\n        elif 0.04 > current_profit >= 0.03:\n            if (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_3_1'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_2'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_3'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_3_4'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_6'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_3_8'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_3_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_3_10'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_3_11'\n        elif 0.05 > current_profit >= 0.04:\n            if (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_4_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_3'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_4_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_6'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_7'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_4_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_4_9'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_4_10'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_4_11'\n        elif 0.06 > current_profit >= 0.05:\n            if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_5_1'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_2'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_3'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_5_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_7'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_5_8'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_5_9'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_5_10'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0):\n                return True, 'sell_profit_t_5_11'\n        elif 0.07 > current_profit >= 0.06:\n            if (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_t_6_1'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_2'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_3'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_6_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_7'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_6_8'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_6_9'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_6_10'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_6_11'\n        elif 0.08 > current_profit >= 0.07:\n            if (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_7_1'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_2'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_3'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_7_4'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_7'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_7_8'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_7_9'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_7_10'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_7_11'\n        elif 0.09 > current_profit >= 0.08:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_8_1'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_8_4'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_7'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_8_8'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_8_9'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_8_10'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_8_11'\n        elif 0.1 > current_profit >= 0.09:\n            if (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_9_1'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_2'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_3'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_9_4'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_7'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_9_8'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_9_9'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_9_10'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_9_11'\n        elif 0.12 > current_profit >= 0.1:\n            if (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_10_1'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_3'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_10_4'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 41.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_10_8'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_10_9'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_10_10'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_10_11'\n        elif 0.2 > current_profit >= 0.12:\n            if (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_11_1'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_2'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_3'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_11_4'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_7'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_11_8'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_11_9'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_11_10'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_11_11'\n        elif current_profit >= 0.2:\n            if (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_12_1'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_3'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_12_4'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_12_8'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_12_9'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_12_10'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 33.0):\n                return True, 'sell_profit_t_12_11'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['close'] > last_candle['ema_200']):\n            if 0.02 > current_profit >= 0.012:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):\n                    return True, 'sell_profit_d_o_1_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_3'\n                # elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_1_4'\n                # elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_1_5'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_2_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_3'\n                # elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_2_4'\n                # elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_2_5'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_3_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_3'\n                # elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_3_4'\n                # elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_3_5'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):\n                    return True, 'sell_profit_d_o_4_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_4_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_3'\n                # elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_4_4'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_4_5'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_5_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_o_5_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_3'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_5_4'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_5_5'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_6_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_6_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_3'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_6_4'\n                # elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_6_5'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_7_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_o_7_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_3'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_7_4'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_7_5'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):\n                    return True, 'sell_profit_d_o_8_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_2'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_3'\n                # elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_8_4'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_8_5'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_9_1'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_2'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_3'\n                # elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_9_4'\n                # elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_9_5'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_10_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_o_10_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_3'\n                # elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_10_4'\n                # elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_10_5'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_11_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):\n                    return True, 'sell_profit_d_o_11_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_3'\n                # elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_11_4'\n                # elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_11_5'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_12_1'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_12_2'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_3'\n                # elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_o_12_4'\n                # elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_o_12_5'\n        else:\n            if 0.02 > current_profit >= 0.012:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_1_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_1_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_3'\n                # elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_1_4'\n                # elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_1_5'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_2_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_2_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_3'\n                # elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_2_4'\n                # elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_2_5'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_3_1'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_3'\n                # elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_3_4'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_3_5'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_4_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_4_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_3'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_4_4'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_4_5'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_5_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                    return True, 'sell_profit_d_u_5_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_3'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_5_4'\n                # elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_5_5'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_6_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):\n                    return True, 'sell_profit_d_u_6_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_3'\n                # elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_6_4'\n                # elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_6_5'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_7_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_7_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_3'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_7_4'\n                # elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_7_5'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_8_1'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_8_2'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_3'\n                # elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_8_4'\n                # elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_8_5'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_9_1'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_9_2'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_3'\n                # elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_9_4'\n                # elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_9_5'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_10_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_3'\n                # elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_10_4'\n                # elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_10_5'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_11_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_3'\n                # elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_11_4'\n                # elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_11_5'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_12_1'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_u_12_2'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_3'\n                # elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20_1h']):\n                #     return True, 'sell_profit_d_u_12_4'\n                # elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['sma_200_dec_20']):\n                #     return True, 'sell_profit_d_u_12_5'\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.0):\n                        return True, 'sell_profit_p_bull_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bull_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_p_bull_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_48_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bear_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bear_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bear_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_48_1_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.8):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_2_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.5):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bear_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.72):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_36_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_36_1_1_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.68):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bull_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_24_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_p_bear_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_24_1_1_1'\n\n        return False, None\n\n    def sell_pump_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.95):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.005)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_1'\n            elif (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.01)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n            ):\n                return True, 'sell_stoploss_p_36_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\n            if (\n                    (-0.05 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['rsi_14'] < 40.0)\n            ):\n                return True, 'sell_stoploss_p_36_2_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n            ):\n                return True, 'sell_stoploss_p_24_1_1'\n\n\n        return False, None\n\n    def sell_long_mode(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        if (0.0 < current_profit <= 0.02) and (max_profit - current_profit > 0.03) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_0'\n        elif (0.02 < current_profit <= 0.04) and (max_profit - current_profit > 0.03) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_1'\n        elif (0.04 < current_profit <= 0.06) and (max_profit - current_profit > 0.035) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_2'\n        elif (0.06 < current_profit <= 0.08) and (max_profit - current_profit > 0.04) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_3'\n        elif (0.08 < current_profit <= 0.1) and (max_profit - current_profit > 0.045) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_4'\n        elif (0.1 < current_profit <= 0.12) and (max_profit - current_profit > 0.05) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_5'\n        elif (0.12 < current_profit <= 0.14) and (max_profit - current_profit > 0.055) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_6'\n        elif (0.14 < current_profit <= 0.16) and (max_profit - current_profit > 0.06) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_7'\n        elif (0.16 < current_profit <= 0.18) and (max_profit - current_profit > 0.065) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.18 < current_profit <= 0.2) and (max_profit - current_profit > 0.07) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.2 < current_profit <= 0.3) and (max_profit - current_profit > 0.075) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_9'\n        elif (0.3 < current_profit <= 0.4) and (max_profit - current_profit > 0.08) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_10'\n        elif (0.4 < current_profit <= 0.5) and (max_profit - current_profit > 0.085) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_11'\n        elif (0.5 < current_profit <= 1.0) and (max_profit - current_profit > 0.09) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (0.04 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return True, 'signal_profit_q_pmax_bull'\n        if (0.045 > current_profit > 0.005) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_coh'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Long mode\n        if all(c in ['31', '32', '33', '34'] for c in buy_tags):\n            sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n            # Skip remaining sell logic for long mode\n            return None\n\n        # Quick sell mode\n        if all(c in ['empty', '38', '39'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sells\n        sell, signal_name = self.sell_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Sell logic for pumped pairs\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, stoploss\n        sell, signal_name = self.sell_pump_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        # S/R\n        res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n        informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()\n        informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EMAs\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # EWO\n        informative_1h['ewo'] = ewo(informative_1h, 50, 200)\n\n        # ROC\n        informative_1h['roc'] = ta.ROC(informative_1h, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # S/R\n        res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n        informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)\n        informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # EMAs\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        ## BB 20 - STD3\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std2['lower']\n        dataframe['bb20_3_mid'] = bb_20_std2['mid']\n        dataframe['bb20_3_upp'] = bb_20_std2['upper']\n\n        # Other BB 20 checks\n        dataframe['bb_width'] = ((dataframe['bb20_2_upp'] - dataframe['bb20_2_low']) / dataframe['bb20_2_mid'])\n        dataframe['bb_delta'] = ((dataframe['bb20_2_low'] - dataframe['bb20_3_low']) / dataframe['bb20_2_low'])\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_24'] = williams_r(dataframe, period=24)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RMI\n        dataframe['rmi_17'] = RMI(dataframe, length=17, mom=4)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n        dataframe['cci_25'] = ta.CCI(dataframe, timeperiod=25)\n\n        # SRSI\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 3.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 3.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Volume\n        dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)\n        dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)\n        dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump_6h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params[\"safe_pump_6h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_12h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params[\"safe_pump_12h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_24h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params[\"safe_pump_24h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_36h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params[\"safe_pump_36h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_48h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params[\"safe_pump_48h_threshold\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(12).min()) / dataframe['open'].rolling(12).min()) > 0.032)\n                    item_buy_logic.append(dataframe['rsi_14'] < 36.0)\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['r_32'] < -75.0)\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 30.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 84.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -99.0)\n\n                # Condition #2 - Semi swing. Local dip.\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < (dataframe['rsi_14_1h'] - 47.5))\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -99.0)\n                    item_buy_logic.append(dataframe['r_480'] > -95.0)\n                    item_buy_logic.append(dataframe['r_480'] < -20.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.88)\n\n                # Condition #3 - Semi swing. Local dip.\n                elif index == 3:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_96'] < -80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.75)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -30.0)\n\n                # Condition #4 - Semi swing. Local dip.\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.992))\n                    item_buy_logic.append(dataframe['rsi_14'] > 30.0)\n                    item_buy_logic.append(dataframe['mfi'] > 25.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #5 - Semi swing. Local dip. Uptrend.\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.942)\n                    item_buy_logic.append(dataframe['ewo'] > 3.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cci'] < -120.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #6 - Semi swing. Local dip.\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.937)\n                    item_buy_logic.append(dataframe['crsi'] < 30.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.82)\n                    item_buy_logic.append(dataframe['cci'] < -200.0)\n\n                # Condition #7 - Semi swing. Local dip.\n                elif index == 7:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.94)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.984)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi'] > 8.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.85)\n\n                # Condition #8 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.927)\n                    item_buy_logic.append(dataframe['ewo'] > 3.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #9 - Semi swing. Local dip. Downtrend.\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.99)\n                    item_buy_logic.append(dataframe['cti'] < -0.92)\n                    item_buy_logic.append(dataframe['ewo'] < -5.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.88)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 20.0)\n\n                # Condition #10 - Semi swing. Local dip.\n                elif index == 10:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.017))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.965)\n                    item_buy_logic.append(dataframe['cti'] < -0.85)\n\n                # Condition #11 - Semi swing. Local dip.\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.938) # 0.958 0.938\n                    item_buy_logic.append(dataframe['rsi_14'] < 20.0) # 28.0 20.0\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #12 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.935)\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 36.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n\n                # Condition #13 - Semi swing. Downtrend. Local dip.\n                elif index == 13:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.999)\n                    item_buy_logic.append(dataframe['ewo'] < -5.7)\n                    item_buy_logic.append(dataframe['cti'] < -0.97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 12.0)\n\n                # Condition #14 - Semi swing. Strong uptrend. Local dip.\n                elif index == 14:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.98)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['ewo'] > 7.8) # 4.0 7.8\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0) # 36.0\n                    item_buy_logic.append(dataframe['cti'] < -0.54)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #15 - Semi swing. Uptrend. Local dip.\n                elif index == 15:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.986))\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.5)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.6)\n\n                # Condition #16 - Semi swing. Cross above.\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 50.0)\n                    item_buy_logic.append(dataframe['cti'] < 0.5)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 70.0)\n\n                # Condition #17 - Semi swing. Deep buy.\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -99.0)\n                    item_buy_logic.append(dataframe['r_14'] == -100.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -95.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < 40.0)\n\n                # Condition #18 - Semi swing. Local dip. BTC not negative.\n                elif index == 18:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.982))\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #19 - Semi swing. Uptrend. Local dip.  BTC not downtrend.\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.75)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.25)\n\n                # Condition #20 - Semi swing. Uptrend. Local dip.\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.942))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n\n                # Condition #21 - Semi swing. Deep local dip. Mild uptrend.\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.942)\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -85.0)\n\n                # Condition #22 - Swing. Uptrend. Bounce from daily support level\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close_1h'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['sup_level_1d'] * 1.05)\n                    item_buy_logic.append(dataframe['low_1h'] < dataframe['sup_level_1d'] * 0.99)\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['res_level_1h'])\n                    item_buy_logic.append(dataframe['res_level_1d'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 48.0)\n\n                    # Confirm uptrend - Heikin-Ashi\n                    item_buy_logic.append(dataframe['open_sha_1d'] < dataframe['close_sha_1d'])\n                    item_buy_logic.append(dataframe['open_sha_1d'].shift(288) < dataframe['close_sha_1d'].shift(288))\n                    item_buy_logic.append(dataframe['pivot_1d'] > dataframe['pivot_1d'].shift(288) * 0.95)\n\n                # Condition #23 - Semi swing. Downtrend. Local dip.\n                elif index == 23:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'].shift(1) < -6.4)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 2.0)\n\n                # Condition #24 - Semi swing. Uptrend. 1h uptrend. Local dip.\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 2.8)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.92)\n\n                # Condition #25 - Semi swing. CMF 1h cross.\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 48.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 66.9)\n\n                # Condition #26 - (nfi 32)\n                elif index == 26:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < 46)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.942)\n                    item_buy_logic.append(dataframe['rsi_14'] > 19.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.86)\n\n                # Condition #27 - Semi swing. Local deep. Uptrend.\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.934) # 0.984\n                    item_buy_logic.append(dataframe['ewo'] > 6.4)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -95.0)\n\n                # Condition #28 - Semi swing. Downtrend. Local deep.\n                elif index == 28:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.96)\n                    item_buy_logic.append(dataframe['ewo'] < -8.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #29 - Semi swing. Downtrend. Local deep.\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.982))\n                    item_buy_logic.append(dataframe['ewo'] < -16.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n\n                # Condition #30 - Semi swing. Local dip. BTC not downtrend.\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))\n\n                # Condition #31 - Long mode. Local dip.\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.028))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.25))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #32 - Long mode. Local dip.\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.046))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n\n                # Condition #33 - Long mode. Local dip. Uptrend.\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.942))\n                    item_buy_logic.append(dataframe['ewo'] > 2.5)\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 0.1)\n\n                # Condition #34 - Long mode. Local dip.\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.972))\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 18.0)\n\n                ### BB_RPB backport\n\n                # ewo2 (need more protection)\n                elif index == 35:\n\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['roc_1h'] < 86)\n                    item_buy_logic.append(dataframe['bb_width_1h'] < 0.954)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_4'] < 45)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.970)\n                    item_buy_logic.append(dataframe['ewo'] > 4.179)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 1.087)\n                    item_buy_logic.append(dataframe['rsi_14'] < 35)\n\n                # ewo\n                elif index == 36:\n\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['roc_1h'] < 86)\n                    item_buy_logic.append(dataframe['bb_width_1h'] < 0.954)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_4'] < 45)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.942)\n                    item_buy_logic.append(dataframe['ewo'] > -5.585)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 1.084)\n                    item_buy_logic.append(dataframe['rsi_14'] < 35)\n\n                # BB safe dump\n                elif index == 37:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rmi_17'] < 49)\n                    item_buy_logic.append(dataframe['cci_25'] <= -116)\n                    item_buy_logic.append(dataframe['srsi_fk'] < 32)\n                    item_buy_logic.append(dataframe['bb_delta'] > 0.025)\n                    item_buy_logic.append(dataframe['bb_width'] > 0.095)\n                    item_buy_logic.append(dataframe['closedelta'] > dataframe['close'] * 12.148 / 1000 )\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_3_low'] * 0.999)\n\n                # NFI 33\n                elif index == 38:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * 0.978)\n                    item_buy_logic.append(dataframe['ewo'] > 8)\n                    item_buy_logic.append(dataframe['cti'] < -0.88)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32)\n                    item_buy_logic.append(dataframe['r_14'] < -98.0)\n                    item_buy_logic.append(dataframe['volume'] < dataframe['volume_mean_4'] * 2.5)\n\n                # NFI 38\n                elif index == 39:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -4.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.95)\n                    item_buy_logic.append(dataframe['r_14'] < -97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 0.5)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        return True\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data\n"
  },
  {
    "path": "strategies/NfiNextModded/NfiNextModded.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport time\n\nlog = logging.getLogger(__name__)\n# log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=37365811                                       ##\n##  Kucoin: https://www.kucoin.com/ucenter/signup?rcode=rJTLZ9K                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NfiNextModded(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.50\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_1d = '1d'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": False,\n        \"buy_condition_36_enable\": False,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        \"buy_condition_44_enable\": True,\n        \"buy_condition_45_enable\": True,\n        \"buy_condition_46_enable\": True,\n        \"buy_condition_47_enable\": True,\n        \"buy_condition_48_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    profit_target_params = {\n        #############\n        # Enable/Disable conditions\n        \"profit_target_1_enable\": False,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"26\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"28\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"70\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        2: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"20\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"48\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"20\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.4\n        },\n        3: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"36\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"110\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        4: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"110\",\n            \"safe_pump_period\": \"48\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        5: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"100\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        6: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        7: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"80\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        8: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"12\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": True,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"36\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.016,\n            \"safe_dips_threshold_2\": 0.11,\n            \"safe_dips_threshold_12\": 0.26,\n            \"safe_dips_threshold_144\": 0.44,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.05\n        },\n        9: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.1\n        },\n        10: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"35\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"24\",\n            \"safe_dips_threshold_0\": 0.016,\n            \"safe_dips_threshold_2\": 0.11,\n            \"safe_dips_threshold_12\": 0.26,\n            \"safe_dips_threshold_144\": 0.44,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.6\n        },\n        11: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"20\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"24\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"36\",\n            \"safe_dips_threshold_0\": 0.022,\n            \"safe_dips_threshold_2\": 0.18,\n            \"safe_dips_threshold_12\": 0.34,\n            \"safe_dips_threshold_144\": 0.56,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        12: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"24\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.3\n        },\n        13: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"24\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"50\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        14: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": True,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.5\n        },\n        15: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"80\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        16: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"50\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.027,\n            \"safe_dips_threshold_2\": 0.26,\n            \"safe_dips_threshold_12\": 0.44,\n            \"safe_dips_threshold_144\": 0.84,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        17: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        18: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": True,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": True,\n            \"sma200_rising_val\": \"44\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"72\",\n            \"safe_dips_threshold_0\": 0.026,\n            \"safe_dips_threshold_2\": 0.24,\n            \"safe_dips_threshold_12\": 0.42,\n            \"safe_dips_threshold_144\": 0.8,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        19: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"36\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"36\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"50\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        20: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"50\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        21: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.025,\n            \"safe_dips_threshold_2\": 0.23,\n            \"safe_dips_threshold_12\": 0.4,\n            \"safe_dips_threshold_144\": 0.7,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"50\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        22: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"50\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"110\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.6\n        },\n        23: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"15\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": True,\n            \"sma200_rising_val\": \"24\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.022,\n            \"safe_dips_threshold_2\": 0.1,\n            \"safe_dips_threshold_12\": 0.3,\n            \"safe_dips_threshold_144\": 0.84,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        24: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"50\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"36\",\n            \"safe_dips_threshold_0\": 0.016,\n            \"safe_dips_threshold_2\": 0.11,\n            \"safe_dips_threshold_12\": 0.26,\n            \"safe_dips_threshold_144\": 0.44,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"10\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        25: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"20\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"36\",\n            \"safe_dips_threshold_0\": 0.024,\n            \"safe_dips_threshold_2\": 0.22,\n            \"safe_dips_threshold_12\": 0.38,\n            \"safe_dips_threshold_144\": 0.66,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"pivot\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 0.98,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.4\n        },\n        26: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.016,\n            \"safe_dips_threshold_2\": 0.1,\n            \"safe_dips_threshold_12\": 0.11,\n            \"safe_dips_threshold_144\": 0.22,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.35\n        },\n        27: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"50\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        28: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 0.99,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.32\n        },\n        29: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"110\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"pivot\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.01\n        },\n        30: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"110\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        31: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.02,\n            \"safe_dips_threshold_2\": 0.14,\n            \"safe_dips_threshold_12\": 0.32,\n            \"safe_dips_threshold_144\": 0.5,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"10\",\n            \"safe_pump_period\": \"48\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"sup3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 0.98,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        32: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"80\",\n            \"safe_pump_period\": \"48\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        33: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        34: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"10\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 0.99,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        35: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.1\n        },\n        36: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"10\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        37: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"48\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.5\n        },\n        38: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"100\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"50\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"100\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"50\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"10\",\n            \"safe_pump_period\": \"36\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        39: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"100\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"100\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"50\",\n            \"safe_pump_period\": \"48\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        40: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": True,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"48\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.2\n        },\n        41: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.015,\n            \"safe_dips_threshold_2\": 0.1,\n            \"safe_dips_threshold_12\": 0.24,\n            \"safe_dips_threshold_144\": 0.42,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        42: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"12\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.027,\n            \"safe_dips_threshold_2\": 0.26,\n            \"safe_dips_threshold_12\": 0.44,\n            \"safe_dips_threshold_144\": 0.84,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"10\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        43: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"12\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.024,\n            \"safe_dips_threshold_2\": 0.22,\n            \"safe_dips_threshold_12\": 0.38,\n            \"safe_dips_threshold_144\": 0.66,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        44: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"12\",\n            \"ema_slow\": False,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        45: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"15\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"20\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.3,\n            \"safe_dips_threshold_12\": 0.48,\n            \"safe_dips_threshold_144\": 0.9,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        46: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"50\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"20\",\n            \"safe_dips_threshold_0\": 0.028,\n            \"safe_dips_threshold_2\": 0.06,\n            \"safe_dips_threshold_12\": 0.25,\n            \"safe_dips_threshold_144\": 0.26,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"100\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": True,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"res3\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 2.0\n        },\n        47: {\n            \"ema_fast\": False,\n            \"ema_fast_len\": \"12\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": False,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": False,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": False,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": False,\n            \"sma200_1h_rising_val\": \"24\",\n            \"safe_dips_threshold_0\": 0.025,\n            \"safe_dips_threshold_2\": 0.05,\n            \"safe_dips_threshold_12\": 0.25,\n            \"safe_dips_threshold_144\": 0.5,\n            \"safe_pump\": True,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n        },\n        48: {\n            \"ema_fast\": True,\n            \"ema_fast_len\": \"12\",\n            \"ema_slow\": True,\n            \"ema_slow_len\": \"12\",\n            \"close_above_ema_fast\": True,\n            \"close_above_ema_fast_len\": \"200\",\n            \"close_above_ema_slow\": True,\n            \"close_above_ema_slow_len\": \"200\",\n            \"sma200_rising\": True,\n            \"sma200_rising_val\": \"30\",\n            \"sma200_1h_rising\": True,\n            \"sma200_1h_rising_val\": \"24\",\n            \"safe_dips_threshold_0\": None,\n            \"safe_dips_threshold_2\": None,\n            \"safe_dips_threshold_12\": None,\n            \"safe_dips_threshold_144\": None,\n            \"safe_pump\": False,\n            \"safe_pump_type\": \"120\",\n            \"safe_pump_period\": \"24\",\n            \"btc_1h_not_downtrend\": False,\n            \"close_over_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\": 1.0,\n            \"close_under_pivot_type\": \"none\",  # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\": 1.0\n\n        }\n    }\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = 2.2\n    buy_pump_threshold_10_24 = 0.42\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = 2.0\n    buy_pump_threshold_10_36 = 0.58\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = 2.0\n    buy_pump_threshold_10_48 = 0.8\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = 2.2\n    buy_pump_threshold_20_24 = 0.46\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = 2.0\n    buy_pump_threshold_20_36 = 0.6\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = 2.0\n    buy_pump_threshold_20_48 = 0.81\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = 2.2\n    buy_pump_threshold_30_24 = 0.5\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = 2.0\n    buy_pump_threshold_30_36 = 0.62\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = 2.0\n    buy_pump_threshold_30_48 = 0.82\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = 2.2\n    buy_pump_threshold_40_24 = 0.54\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = 2.0\n    buy_pump_threshold_40_36 = 0.63\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = 2.0\n    buy_pump_threshold_40_48 = 0.84\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = 1.75\n    buy_pump_threshold_50_24 = 0.6\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = 1.75\n    buy_pump_threshold_50_36 = 0.64\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = 1.75\n    buy_pump_threshold_50_48 = 0.85\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = 1.75\n    buy_pump_threshold_60_24 = 0.62\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = 1.75\n    buy_pump_threshold_60_36 = 0.66\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = 1.75\n    buy_pump_threshold_60_48 = 0.9\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = 1.75\n    buy_pump_threshold_70_24 = 0.63\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = 1.75\n    buy_pump_threshold_70_36 = 0.67\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = 1.75\n    buy_pump_threshold_70_48 = 0.95\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = 1.75\n    buy_pump_threshold_80_24 = 0.64\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = 1.75\n    buy_pump_threshold_80_36 = 0.68\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = 1.75\n    buy_pump_threshold_80_48 = 1.0\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = 1.75\n    buy_pump_threshold_90_24 = 0.65\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = 1.75\n    buy_pump_threshold_90_36 = 0.69\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = 1.75\n    buy_pump_threshold_90_48 = 1.1\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = 1.7\n    buy_pump_threshold_100_24 = 0.66\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = 1.7\n    buy_pump_threshold_100_36 = 0.7\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = 1.4\n    buy_pump_threshold_100_48 = 1.6\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = 1.7\n    buy_pump_threshold_110_24 = 0.7\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = 1.7\n    buy_pump_threshold_110_36 = 0.74\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = 1.4\n    buy_pump_threshold_110_48 = 1.8\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = 1.7\n    buy_pump_threshold_120_24 = 0.78\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = 1.7\n    buy_pump_threshold_120_36 = 0.78\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = 1.4\n    buy_pump_threshold_120_48 = 2.0\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = 0.4\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = 0.44\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = 0.50\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = 0.58\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = 0.66\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = 0.74\n\n    buy_1_min_inc = 0.022\n    buy_1_rsi_max = 32.0\n    buy_2_r_14_max = -75.0\n    buy_1_mfi_max = 46.0\n    buy_1_rsi_1h_min = 30.0\n    buy_1_rsi_1h_max = 84.0\n\n    buy_2_rsi_1h_diff = 39.0\n    buy_2_mfi = 49.0\n    buy_2_cti_max = -0.9\n    buy_2_r_480_min = -95.0\n    buy_2_r_480_max = -46.0\n    buy_2_cti_1h_max = 0.9\n    buy_2_volume = 2.0\n\n    buy_3_bb40_bbdelta_close = 0.057\n    buy_3_bb40_closedelta_close = 0.023\n    buy_3_bb40_tail_bbdelta = 0.418\n    buy_3_cti_max = -0.5\n    buy_3_cci_36_osc_min = -0.25\n    buy_3_crsi_1h_min = 20.0\n    buy_3_r_480_1h_min = -48.0\n    buy_3_cti_1h_max = 0.82\n\n    buy_4_bb20_close_bblowerband = 0.98\n    buy_4_bb20_volume = 10.0\n    buy_4_cti_max = -0.8\n\n    buy_5_ema_rel = 0.84\n    buy_5_ema_open_mult = 0.02\n    buy_5_bb_offset = 0.999\n    buy_5_cti_max = -0.5\n    buy_5_r_14_max = -94.0\n    buy_5_rsi_14_min = 25.0\n    buy_5_mfi_min = 18.0\n    buy_5_crsi_1h_min = 12.0\n    buy_5_volume = 1.6\n\n    buy_6_ema_open_mult = 0.019\n    buy_6_bb_offset = 0.984\n    buy_6_r_14_max = -85.0\n    buy_6_crsi_1h_min = 15.0\n    buy_6_cti_1h_min = 0.0\n\n    buy_7_ema_open_mult = 0.031\n    buy_7_ma_offset = 0.978\n    buy_7_cti_max = -0.9\n    buy_7_rsi_max = 45.0\n\n    buy_8_bb_offset = 0.986\n    buy_8_r_14_max = -98.0\n    buy_8_cti_1h_max = 0.95\n    buy_8_r_480_1h_max = -18.0\n    buy_8_volume = 1.8\n\n    buy_9_ma_offset = 0.968\n    buy_9_bb_offset = 0.982\n    buy_9_mfi_max = 50.0\n    buy_9_cti_max = -0.85\n    buy_9_r_14_max = -94.0\n    buy_9_rsi_1h_min = 20.0\n    buy_9_rsi_1h_max = 88.0\n    buy_9_crsi_1h_min = 21.0\n\n    buy_10_ma_offset_high = 0.94\n    buy_10_bb_offset = 0.984\n    buy_10_r_14_max = -88.0\n    buy_10_cti_1h_min = -0.5\n    buy_10_cti_1h_max = 0.94\n\n    buy_11_ma_offset = 0.956\n    buy_11_min_inc = 0.022\n    buy_11_rsi_max = 37.0\n    buy_11_mfi_max = 46.0\n    buy_11_cci_max = -120.0\n    buy_11_r_480_max = -32.0\n    buy_11_rsi_1h_min = 30.0\n    buy_11_rsi_1h_max = 84.0\n    buy_11_cti_1h_max = 0.91\n    buy_11_r_480_1h_max = -25.0\n    buy_11_crsi_1h_min = 26.0\n\n    buy_12_ma_offset = 0.927\n    buy_12_ewo_min = 2.0\n    buy_12_rsi_max = 32.0\n    buy_12_cti_max = -0.9\n\n    buy_13_ma_offset = 0.99\n    buy_13_cti_max = -0.92\n    buy_13_ewo_max = -6.0\n    buy_13_cti_1h_max = -0.88\n    buy_13_crsi_1h_min = 10.0\n\n    buy_14_ema_open_mult = 0.014\n    buy_14_bb_offset = 0.989\n    buy_14_ma_offset = 0.945\n    buy_14_cti_max = -0.85\n\n    buy_15_ema_open_mult = 0.0238\n    buy_15_ma_offset = 0.958\n    buy_15_rsi_min = 28.0\n    buy_15_cti_1h_min = -0.2\n\n    buy_16_ma_offset = 0.942\n    buy_16_ewo_min = 2.0\n    buy_16_rsi_max = 36.0\n    buy_16_cti_max = -0.9\n\n    buy_17_ma_offset = 0.999\n    buy_17_ewo_max = -7.0\n    buy_17_cti_max = -0.96\n    buy_17_crsi_1h_min = 12.0\n    buy_17_volume = 2.0\n\n    buy_18_bb_offset = 0.986\n    buy_18_rsi_max = 33.5\n    buy_18_cti_max = -0.85\n    buy_18_cti_1h_max = 0.91\n    buy_18_volume = 2.0\n\n    buy_19_rsi_1h_min = 30.0\n    buy_19_chop_max = 21.3\n\n    buy_20_rsi_14_max = 36.0\n    buy_20_rsi_14_1h_max = 16.0\n    buy_20_cti_max = -0.84\n    buy_20_volume = 2.0\n\n    buy_21_rsi_14_max = 14.0\n    buy_21_rsi_14_1h_max = 28.0\n    buy_21_cti_max = -0.902\n    buy_21_volume = 2.0\n\n    buy_22_volume = 2.0\n    buy_22_bb_offset = 0.984\n    buy_22_ma_offset = 0.98\n    buy_22_ewo_min = 5.6\n    buy_22_rsi_14_max = 36.0\n    buy_22_cti_max = -0.54\n    buy_22_r_480_max = -40.0\n    buy_22_cti_1h_min = -0.5\n\n    buy_23_bb_offset = 0.984\n    buy_23_ewo_min = 3.4\n    buy_23_rsi_14_max = 28.0\n    buy_23_cti_max = -0.74\n    buy_23_rsi_14_1h_max = 80.0\n    buy_23_r_480_1h_min = -95.0\n    buy_23_cti_1h_max = 0.92\n\n    buy_24_rsi_14_max = 50.0\n    buy_24_rsi_14_1h_min = 66.9\n\n    buy_25_ma_offset = 0.953\n    buy_25_rsi_4_max = 30.0\n    buy_25_cti_max = -0.78\n    buy_25_cci_max = -200.0\n\n    buy_26_zema_low_offset = 0.9405\n    buy_26_cti_max = -0.72\n    buy_26_cci_max = -166.0\n    buy_26_r_14_max = -98.0\n    buy_26_cti_1h_max = 0.95\n    buy_26_volume = 2.0\n\n    buy_27_wr_max = -95.0\n    buy_27_r_14 = -100.0\n    buy_27_wr_1h_max = -90.0\n    buy_27_rsi_max = 46.0\n    buy_27_volume = 2.0\n\n    buy_28_ma_offset = 0.928\n    buy_28_ewo_min = 2.0\n    buy_28_rsi_14_max = 33.4\n    buy_28_cti_max = -0.84\n    buy_28_r_14_max = -97.0\n    buy_28_cti_1h_max = 0.95\n\n    buy_29_ma_offset = 0.984\n    buy_29_ewo_max = -4.2\n    buy_29_cti_max = -0.96\n\n    buy_30_ma_offset = 0.962\n    buy_30_ewo_min = 6.4\n    buy_30_rsi_14_max = 34.0\n    buy_30_cti_max = -0.87\n    buy_30_r_14_max = -97.0\n\n    buy_31_ma_offset = 0.962\n    buy_31_ewo_max = -5.2\n    buy_31_r_14_max = -94.0\n    buy_31_cti_max = -0.9\n\n    buy_32_ma_offset = 0.942\n    buy_32_rsi_4_max = 46.0\n    buy_32_cti_max = -0.86\n    buy_32_rsi_14_min = 19.0\n    buy_32_crsi_1h_min = 10.0\n    buy_32_crsi_1h_max = 60.0\n\n    buy_33_ma_offset = 0.988\n    buy_33_ewo_min = 9.0\n    buy_33_rsi_max = 32.0\n    buy_33_cti_max = -0.88\n    buy_33_r_14_max = -98.0\n    buy_33_cti_1h_max = 0.92\n    buy_33_volume = 2.0\n\n    buy_34_ma_offset = 0.97\n    buy_34_ewo_max = -4.0\n    buy_34_cti_max = -0.95\n    buy_34_r_14_max = -99.9\n    buy_34_crsi_1h_min = 8.0\n    buy_34_volume = 2.0\n\n    buy_35_ma_offset = 0.984\n    buy_35_ewo_min = 7.8\n    buy_35_rsi_max = 32.0\n    buy_35_cti_max = -0.8\n    buy_35_r_14_max = -95.0\n\n    buy_36_ma_offset = 0.98\n    buy_36_ewo_max = -5.0\n    buy_36_cti_max = -0.82\n    buy_36_r_14_max = -97.0\n    buy_36_crsi_1h_min = 12.0\n\n    buy_37_ma_offset = 0.984\n    buy_37_ewo_min = 8.3\n    buy_37_ewo_max = 11.1\n    buy_37_rsi_14_min = 26.0\n    buy_37_rsi_14_max = 46.0\n    buy_37_crsi_1h_min = 12.0\n    buy_37_crsi_1h_max = 56.0\n    buy_37_cti_max = -0.85\n    buy_37_cti_1h_max = 0.92\n    buy_37_r_14_max = -97.0\n    buy_37_close_1h_max = 0.1\n\n    buy_38_ma_offset = 0.98\n    buy_38_ewo_max = -4.4\n    buy_38_cti_max = -0.95\n    buy_38_r_14_max = -97.0\n    buy_38_crsi_1h_min = 0.5\n\n    buy_39_cti_max = -0.1\n    buy_39_r_1h_max = -22.0\n    buy_39_cti_1h_min = -0.1\n    buy_39_cti_1h_max = 0.4\n\n    buy_40_cci_max = -150.0\n    buy_40_rsi_max = 30.0\n    buy_40_r_14_max = -99.9\n    buy_40_cti_max = -0.8\n\n    buy_41_ma_offset_high = 0.95\n    buy_41_cti_max = -0.95\n    buy_41_cci_max = -178.0\n    buy_41_ewo_1h_min = 0.5\n    buy_41_r_480_1h_max = -14.0\n    buy_41_crsi_1h_min = 14.0\n\n    buy_42_ema_open_mult = 0.018\n    buy_42_bb_offset = 0.992\n    buy_42_ewo_1h_min = 2.8\n    buy_42_cti_1h_min = -0.5\n    buy_42_cti_1h_max = 0.88\n    buy_42_r_480_1h_max = -12.0\n\n    buy_43_bb40_bbdelta_close = 0.045\n    buy_43_bb40_closedelta_close = 0.02\n    buy_43_bb40_tail_bbdelta = 0.5\n    buy_43_cti_max = -0.75\n    buy_43_r_480_min = -94.0\n    buy_43_cti_1h_min = -0.75\n    buy_43_cti_1h_max = 0.45\n    buy_43_r_480_1h_min = -80.0\n\n    buy_44_ma_offset = 0.982\n    buy_44_ewo_max = -18.0\n    buy_44_cti_max = -0.73\n    buy_44_crsi_1h_min = 8.0\n\n    buy_45_bb40_bbdelta_close = 0.039\n    buy_45_bb40_closedelta_close = 0.0231\n    buy_45_bb40_tail_bbdelta = 0.24\n    buy_45_ma_offset = 0.948\n    buy_45_ewo_min = 2.0\n    buy_45_ewo_1h_min = 2.0\n    buy_45_cti_1h_max = 0.76\n    buy_45_r_480_1h_max = -20.0\n\n    buy_46_ema_open_mult = 0.0332\n    buy_46_ewo_1h_min = 0.5\n    buy_46_cti_1h_min = -0.9\n    buy_46_cti_1h_max = 0.5\n\n    buy_47_ewo_min = 3.2\n    buy_47_ma_offset = 0.952\n    buy_47_rsi_14_max = 46.0\n    buy_47_cti_max = -0.93\n    buy_47_r_14_max = -97.0\n    buy_47_ewo_1h_min = 2.0\n    buy_47_cti_1h_min = -0.9\n    buy_47_cti_1h_max = 0.3\n\n    buy_48_ewo_min = 8.5\n    buy_48_ewo_1h_min = 14.0\n    buy_48_r_480_min = -25.0\n    buy_48_r_480_1h_min = -50.0\n    buy_48_r_480_1h_max = -10.0\n    buy_48_cti_1h_min = 0.5\n    buy_48_crsi_1h_min = 10.0\n\n    # Sell\n\n    sell_condition_1_enable = True\n    sell_condition_2_enable = True\n    sell_condition_3_enable = True\n    sell_condition_4_enable = True\n    sell_condition_5_enable = True\n    sell_condition_6_enable = True\n    sell_condition_7_enable = True\n    sell_condition_8_enable = True\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = 0.9\n    sell_pump_threshold_48_2 = 0.7\n    sell_pump_threshold_48_3 = 0.5\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = 0.72\n    sell_pump_threshold_36_2 = 4.0\n    sell_pump_threshold_36_3 = 1.0\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = 0.68\n    sell_pump_threshold_24_2 = 0.62\n    sell_pump_threshold_24_3 = 0.88\n\n    sell_rsi_bb_1 = 79.0\n\n    sell_rsi_bb_2 = 80.0\n\n    sell_rsi_main_3 = 83.0\n\n    sell_dual_rsi_rsi_4 = 73.4\n    sell_dual_rsi_rsi_1h_4 = 79.6\n\n    sell_ema_relative_5 = 0.024\n    sell_rsi_diff_5 = 4.4\n\n    sell_rsi_under_6 = 79.0\n\n    sell_rsi_1h_7 = 81.7\n\n    sell_bb_relative_8 = 1.1\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = 0.012\n    sell_custom_rsi_under_bull_0 = 34.0\n    sell_custom_profit_bull_1 = 0.02\n    sell_custom_rsi_under_bull_1 = 35.0\n    sell_custom_profit_bull_2 = 0.03\n    sell_custom_rsi_under_bull_2 = 36.0\n    sell_custom_profit_bull_3 = 0.04\n    sell_custom_rsi_under_bull_3 = 44.0\n    sell_custom_profit_bull_4 = 0.05\n    sell_custom_rsi_under_bull_4 = 45.0\n    sell_custom_profit_bull_5 = 0.06\n    sell_custom_rsi_under_bull_5 = 49.0\n    sell_custom_profit_bull_6 = 0.07\n    sell_custom_rsi_under_bull_6 = 50.0\n    sell_custom_profit_bull_7 = 0.08\n    sell_custom_rsi_under_bull_7 = 57.0\n    sell_custom_profit_bull_8 = 0.09\n    sell_custom_rsi_under_bull_8 = 50.0\n    sell_custom_profit_bull_9 = 0.1\n    sell_custom_rsi_under_bull_9 = 46.0\n    sell_custom_profit_bull_10 = 0.12\n    sell_custom_rsi_under_bull_10 = 42.0\n    sell_custom_profit_bull_11 = 0.20\n    sell_custom_rsi_under_bull_11 = 30.0\n\n    sell_custom_profit_bear_0 = 0.012\n    sell_custom_rsi_under_bear_0 = 34.0\n    sell_custom_profit_bear_1 = 0.02\n    sell_custom_rsi_under_bear_1 = 35.0\n    sell_custom_profit_bear_2 = 0.03\n    sell_custom_rsi_under_bear_2 = 37.0\n    sell_custom_profit_bear_3 = 0.04\n    sell_custom_rsi_under_bear_3 = 44.0\n    sell_custom_profit_bear_4 = 0.05\n    sell_custom_rsi_under_bear_4 = 48.0\n    sell_custom_profit_bear_5 = 0.06\n    sell_custom_rsi_under_bear_5 = 50.0\n    sell_custom_rsi_over_bear_5 = 78.0\n    sell_custom_profit_bear_6 = 0.07\n    sell_custom_rsi_under_bear_6 = 52.0\n    sell_custom_rsi_over_bear_6 = 78.0\n    sell_custom_profit_bear_7 = 0.08\n    sell_custom_rsi_under_bear_7 = 57.0\n    sell_custom_rsi_over_bear_7 = 77.0\n    sell_custom_profit_bear_8 = 0.09\n    sell_custom_rsi_under_bear_8 = 55.0\n    sell_custom_rsi_over_bear_8 = 75.5\n    sell_custom_profit_bear_9 = 0.1\n    sell_custom_rsi_under_bear_9 = 46.0\n    sell_custom_profit_bear_10 = 0.12\n    sell_custom_rsi_under_bear_10 = 42.0\n    sell_custom_profit_bear_11 = 0.20\n    sell_custom_rsi_under_bear_11 = 30.0\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = 0.01\n    sell_custom_under_rsi_under_bull_0 = 38.0\n    sell_custom_under_profit_bull_1 = 0.02\n    sell_custom_under_rsi_under_bull_1 = 46.0\n    sell_custom_under_profit_bull_2 = 0.03\n    sell_custom_under_rsi_under_bull_2 = 47.0\n    sell_custom_under_profit_bull_3 = 0.04\n    sell_custom_under_rsi_under_bull_3 = 48.0\n    sell_custom_under_profit_bull_4 = 0.05\n    sell_custom_under_rsi_under_bull_4 = 49.0\n    sell_custom_under_profit_bull_5 = 0.06\n    sell_custom_under_rsi_under_bull_5 = 50.0\n    sell_custom_under_profit_bull_6 = 0.07\n    sell_custom_under_rsi_under_bull_6 = 52.0\n    sell_custom_under_profit_bull_7 = 0.08\n    sell_custom_under_rsi_under_bull_7 = 57.0\n    sell_custom_under_profit_bull_8 = 0.09\n    sell_custom_under_rsi_under_bull_8 = 50.0\n    sell_custom_under_profit_bull_9 = 0.1\n    sell_custom_under_rsi_under_bull_9 = 46.0\n    sell_custom_under_profit_bull_10 = 0.12\n    sell_custom_under_rsi_under_bull_10 = 42.0\n    sell_custom_under_profit_bull_11 = 0.2\n    sell_custom_under_rsi_under_bull_11 = 30.0\n\n    sell_custom_under_profit_bear_0 = 0.01\n    sell_custom_under_rsi_under_bear_0 = 38.0\n    sell_custom_under_profit_bear_1 = 0.02\n    sell_custom_under_rsi_under_bear_1 = 56.0\n    sell_custom_under_profit_bear_2 = 0.03\n    sell_custom_under_rsi_under_bear_2 = 57.0\n    sell_custom_under_profit_bear_3 = 0.04\n    sell_custom_under_rsi_under_bear_3 = 57.0\n    sell_custom_under_profit_bear_4 = 0.05\n    sell_custom_under_rsi_under_bear_4 = 57.0\n    sell_custom_under_profit_bear_5 = 0.06\n    sell_custom_under_rsi_under_bear_5 = 57.0\n    sell_custom_under_rsi_over_bear_5 = 78.0\n    sell_custom_under_profit_bear_6 = 0.07\n    sell_custom_under_rsi_under_bear_6 = 57.0\n    sell_custom_under_rsi_over_bear_6 = 78.0\n    sell_custom_under_profit_bear_7 = 0.08\n    sell_custom_under_rsi_under_bear_7 = 57.0\n    sell_custom_under_rsi_over_bear_7 = 80.0\n    sell_custom_under_profit_bear_8 = 0.09\n    sell_custom_under_rsi_under_bear_8 = 50.0\n    sell_custom_under_rsi_over_bear_8 = 82.0\n    sell_custom_under_profit_bear_9 = 0.1\n    sell_custom_under_rsi_under_bear_9 = 46.0\n    sell_custom_under_profit_bear_10 = 0.12\n    sell_custom_under_rsi_under_bear_10 = 42.0\n    sell_custom_under_profit_bear_11 = 0.2\n    sell_custom_under_rsi_under_bear_11 = 30.0\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = 0.05\n    sell_custom_dec_profit_max_1 = 0.12\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = 0.07\n    sell_custom_dec_profit_max_2 = 0.16\n\n    # Trail 1\n    sell_trail_profit_min_1 = 0.03\n    sell_trail_profit_max_1 = 0.05\n    sell_trail_down_1 = 0.05\n    sell_trail_rsi_min_1 = 10.0\n    sell_trail_rsi_max_1 = 20.0\n\n    # Trail 2\n    sell_trail_profit_min_2 = 0.1\n    sell_trail_profit_max_2 = 0.4\n    sell_trail_down_2 = 0.03\n    sell_trail_rsi_min_2 = 20.0\n    sell_trail_rsi_max_2 = 50.0\n\n    # Trail 3\n    sell_trail_profit_min_3 = 0.06\n    sell_trail_profit_max_3 = 0.2\n    sell_trail_down_3 = 0.05\n\n    # Trail 4\n    sell_trail_profit_min_4 = 0.03\n    sell_trail_profit_max_4 = 0.06\n    sell_trail_down_4 = 0.02\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = 0.001\n    sell_custom_profit_under_profit_max_1 = 0.008\n    sell_custom_profit_under_rel_1 = 0.024\n    sell_custom_profit_under_rsi_diff_1 = 4.4\n\n    sell_custom_profit_under_profit_2 = 0.03\n    sell_custom_profit_under_rel_2 = 0.024\n    sell_custom_profit_under_rsi_diff_2 = 4.4\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = 0.002\n    sell_custom_stoploss_under_rsi_diff_1 = 10.0\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = -0.08\n    sell_custom_stoploss_long_profit_max_1 = -0.04\n    sell_custom_stoploss_long_recover_1 = 0.14\n    sell_custom_stoploss_long_rsi_diff_1 = 4.0\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = 0.06\n    sell_custom_stoploss_long_rsi_diff_2 = 40.0\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = 0.04\n    sell_custom_pump_under_profit_max_1 = 0.09\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = 0.05\n    sell_custom_pump_trail_profit_max_1 = 0.07\n    sell_custom_pump_trail_down_1 = 0.05\n    sell_custom_pump_trail_rsi_min_1 = 20.0\n    sell_custom_pump_trail_rsi_max_1 = 70.0\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = 0.01\n    sell_custom_stoploss_pump_min_1 = -0.02\n    sell_custom_stoploss_pump_max_1 = -0.01\n    sell_custom_stoploss_pump_ma_offset_1 = 0.94\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = 0.025\n    sell_custom_stoploss_pump_loss_2 = -0.05\n    sell_custom_stoploss_pump_ma_offset_2 = 0.92\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = 0.008\n    sell_custom_stoploss_pump_loss_3 = -0.12\n    sell_custom_stoploss_pump_ma_offset_3 = 0.88\n\n    # Recover\n    sell_custom_recover_profit_1 = 0.06\n    sell_custom_recover_min_loss_1 = 0.12\n\n    sell_custom_recover_profit_min_2 = 0.01\n    sell_custom_recover_profit_max_2 = 0.05\n    sell_custom_recover_min_loss_2 = 0.06\n    sell_custom_recover_rsi_2 = 46.0\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = 0.03\n    sell_custom_long_profit_max_1 = 0.04\n    sell_custom_long_duration_min_1 = 900\n\n    # Profit Target Signal\n    profit_target_1_enable = False\n    #############################################################\n\n    plot_config = {\n        'main_plot': {\n            'ema_12_1h': {'color': 'rgba(200,200,100,0.4)'},\n            'ema_15_1h': {'color': 'rgba(200,180,100,0.4)'},\n            'ema_20_1h': {'color': 'rgba(200,160,100,0.4)'},\n            'ema_25_1h': {'color': 'rgba(200,140,100,0.4)'},\n            'ema_26_1h': {'color': 'rgba(200,120,100,0.4)'},\n            'ema_35_1h': {'color': 'rgba(200,100,100,0.4)'},\n            'ema_50_1h': {'color': 'rgba(200,80,100,0.4)'},\n            'ema_100_1h': {'color': 'rgba(200,60,100,0.4)'},\n            'ema_200_1h': {'color': 'rgba(200,40,100,0.4)'},\n            'sma_200_1h': {'color': 'rgba(150,20,100,0.4)'},\n            'pm': {'color': 'rgba(100,20,100,0.5)'}\n        },\n        'subplots': {\n            'buy tag': {'buy_tag': {'color': 'green'}},\n            'RSI/BTC': {\n                'btc_not_downtrend_1h': {'color': 'yellow'},\n                'btc_rsi_14_1h': {'color': 'green'},\n                'rsi_14_1h': {'color': '#f41cd1'},\n                'crsi': {'color': 'blue'}\n            },\n            'pump': {\n                'cti_1h': {'color': 'pink'},\n                'safe_pump_24_10_1h': {'color': '#481110'},\n                'safe_pump_24_20_1h': {'color': '#481120'},\n                'safe_pump_24_30_1h': {'color': '#481130'},\n                'safe_pump_24_40_1h': {'color': '#481140'},\n                'safe_pump_24_50_1h': {'color': '#481150'},\n                'safe_pump_24_60_1h': {'color': '#481160'},\n                'safe_pump_24_70_1h': {'color': '#481170'},\n                'safe_pump_24_80_1h': {'color': '#481180'},\n                'safe_pump_24_90_1h': {'color': '#481190'},\n                'safe_pump_24_100_1h': {'color': '#4811A0'},\n                'safe_pump_24_120_1h': {'color': '#4811C0'},\n                'safe_pump_36_10_1h': {'color': '#721110'},\n                'safe_pump_36_20_1h': {'color': '#721120'},\n                'safe_pump_36_30_1h': {'color': '#721130'},\n                'safe_pump_36_40_1h': {'color': '#721140'},\n                'safe_pump_36_50_1h': {'color': '#721150'},\n                'safe_pump_36_60_1h': {'color': '#721160'},\n                'safe_pump_36_70_1h': {'color': '#721170'},\n                'safe_pump_36_80_1h': {'color': '#721180'},\n                'safe_pump_36_90_1h': {'color': '#721190'},\n                'safe_pump_36_100_1h': {'color': '#7211A0'},\n                'safe_pump_36_120_1h': {'color': '#7211C0'},\n                'safe_pump_48_10_1h': {'color': '#961110'},\n                'safe_pump_48_20_1h': {'color': '#961120'},\n                'safe_pump_48_30_1h': {'color': '#961130'},\n                'safe_pump_48_40_1h': {'color': '#961140'},\n                'safe_pump_48_50_1h': {'color': '#961150'},\n                'safe_pump_48_60_1h': {'color': '#961160'},\n                'safe_pump_48_70_1h': {'color': '#961170'},\n                'safe_pump_48_80_1h': {'color': '#961180'},\n                'safe_pump_48_90_1h': {'color': '#961190'},\n                'safe_pump_48_100_1h': {'color': '#9611A0'},\n                'safe_pump_48_120_1h': {'color': '#9611C0'}\n            }\n        }\n    }\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(\n                self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:, :]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date',\n                                                                                        how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(\n            lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(\n            columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc=0, column='date', value=pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:, :]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date',\n                                                                                        how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        self.coin_metrics['tg_dataframe'].to_html('pct_df.html')\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(\n            lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(\n            columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc=0, column='date', value=pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 27.0):\n                        return True, 'signal_profit_o_bull_12_9'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 39.0):\n                        return True, 'signal_profit_o_bull_11_9'\n                elif 0.12 > current_profit >= 0.1:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 48.0):\n                        return True, 'signal_profit_o_bull_10_9'\n                elif 0.1 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_o_bull_9_9'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_8_4'\n                    elif (last_candle['rsi_14'] < 48.0):\n                        return True, 'signal_profit_o_bull_8_9'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_7_1'\n                    if last_candle['rsi_14'] > 83.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_7_4'\n                    elif (last_candle['rsi_14'] < 45.0):\n                        return True, 'signal_profit_o_bull_7_9'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6_1'\n                    if last_candle['rsi_14'] > 82.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_6_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_o_bull_6_5'\n                    elif (last_candle['rsi_14'] < 42.0):\n                        return True, 'signal_profit_o_bull_6_9'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5_1'\n                    if last_candle['rsi_14'] > 80.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_5_4'\n                    elif (last_candle['cti'] > 0.952):\n                        return True, 'signal_profit_o_bull_5_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5_6'\n                    elif (last_candle['rsi_14'] < 41.0):\n                        return True, 'signal_profit_o_bull_5_9'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_4_4'\n                    elif (last_candle['cti'] > 0.954):\n                        return True, 'signal_profit_o_bull_4_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_4_6'\n                    elif (last_candle['rsi_14'] < 40.0):\n                        return True, 'signal_profit_o_bull_4_9'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_3_4'\n                    elif (last_candle['cti'] > 0.956):\n                        return True, 'signal_profit_o_bull_3_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3_6'\n                    elif (last_candle['rsi_14'] < 35.0):\n                        return True, 'signal_profit_o_bull_3_9'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_2_4'\n                    elif (last_candle['cti'] > 0.958):\n                        return True, 'signal_profit_o_bull_2_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2_6'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bull_2_7'\n                    elif last_candle['rsi_14'] < 40.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_o_bull_2_8'\n                    elif (last_candle['rsi_14'] < 34.0):\n                        return True, 'signal_profit_o_bull_2_9'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_1_4'\n                    elif (last_candle['cti'] > 0.96):\n                        return True, 'signal_profit_o_bull_1_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1_6'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bull_1_7'\n                    elif last_candle['rsi_14'] < 39.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_o_bull_1_8'\n                    elif (last_candle['rsi_14'] < 32.0):\n                        return True, 'signal_profit_o_bull_1_9'\n            else:\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 28.0):\n                        return True, 'signal_profit_o_bear_12_9'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 40.0):\n                        return True, 'signal_profit_o_bear_11_9'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_o_bear_10_9'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 55.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] > 75.5):\n                        return True, 'signal_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 50.0):\n                        return True, 'signal_profit_o_bear_9_9'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > 77.0):\n                        return True, 'signal_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 59.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_8_4'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_o_bear_8_9'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_7_4'\n                    elif (last_candle['rsi_14'] < 46.0):\n                        return True, 'signal_profit_o_bear_7_9'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_6_4'\n                    elif (last_candle['cti'] > 0.94):\n                        return True, 'signal_profit_o_bear_6_5'\n                    elif (last_candle['rsi_14'] < 43.0):\n                        return True, 'signal_profit_o_bear_6_9'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_5_4'\n                    elif (last_candle['cti'] > 0.942):\n                        return True, 'signal_profit_o_bear_5_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_5_6'\n                    elif (last_candle['rsi_14'] < 42.0):\n                        return True, 'signal_profit_o_bear_5_9'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_4_4'\n                    elif (last_candle['cti'] > 0.944):\n                        return True, 'signal_profit_o_bear_4_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_4_6'\n                    elif (last_candle['rsi_14'] < 41.0):\n                        return True, 'signal_profit_o_bear_4_9'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_3_4'\n                    elif (last_candle['cti'] > 0.946):\n                        return True, 'signal_profit_o_bear_3_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3_6'\n                    elif (last_candle['rsi_14'] < 36.0):\n                        return True, 'signal_profit_o_bear_3_9'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_2_4'\n                    elif (last_candle['cti'] > 0.948):\n                        return True, 'signal_profit_o_bear_2_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2_6'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bear_2_7'\n                    elif (last_candle['rsi_14'] < 35.0):\n                        return True, 'signal_profit_o_bear_2_9'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_1_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_o_bear_1_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1_6'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bear_1_7'\n                    elif (last_candle['rsi_14'] < 33.0):\n                        return True, 'signal_profit_o_bear_1_9'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 28.0):\n                        return True, 'signal_profit_u_bull_12_9'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 43.0):\n                        return True, 'signal_profit_u_bull_11_9'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_u_bull_10_9'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 50.0):\n                        return True, 'signal_profit_u_bull_9_9'\n                elif 0.09 > current_profit >= 0.08:\n                    if last_candle['rsi_14'] < 57.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_8_4'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_u_bull_8_9'\n                elif 0.08 > current_profit >= 0.07:\n                    if last_candle['rsi_14'] < 52.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_7_1'\n                    if last_candle['rsi_14'] > 83.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_7_4'\n                    elif (last_candle['rsi_14'] < 46.0):\n                        return True, 'signal_profit_u_bull_7_9'\n                elif 0.07 > current_profit >= 0.06:\n                    if last_candle['rsi_14'] < 50.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_6_1'\n                    if last_candle['rsi_14'] > 82.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_6_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_u_bull_6_5'\n                    elif (last_candle['rsi_14'] < 43.0):\n                        return True, 'signal_profit_u_bull_6_9'\n                elif 0.06 > current_profit >= 0.05:\n                    if last_candle['rsi_14'] < 48.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_5_1'\n                    if last_candle['rsi_14'] > 80.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_5_4'\n                    elif (last_candle['cti'] > 0.952):\n                        return True, 'signal_profit_u_bull_5_5'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_5_6'\n                    elif (last_candle['rsi_14'] < 42.0):\n                        return True, 'signal_profit_u_bull_5_9'\n                elif 0.05 > current_profit >= 0.04:\n                    if last_candle['rsi_14'] < 47.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_4_4'\n                    elif (last_candle['cti'] > 0.954):\n                        return True, 'signal_profit_u_bull_4_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_4_6'\n                    elif (last_candle['rsi_14'] < 41.0):\n                        return True, 'signal_profit_u_bull_4_9'\n                elif 0.04 > current_profit >= 0.03:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_3_4'\n                    elif (last_candle['cti'] > 0.956):\n                        return True, 'signal_profit_u_bull_3_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_3_6'\n                    elif (last_candle['rsi_14'] < 36.0):\n                        return True, 'signal_profit_u_bull_3_9'\n                elif 0.03 > current_profit >= 0.02:\n                    if last_candle['rsi_14'] < 45.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_2_4'\n                    elif (last_candle['cti'] > 0.958):\n                        return True, 'signal_profit_u_bull_2_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_2_6'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bull_2_7'\n                    elif last_candle['rsi_14'] < 41.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_u_bull_2_8'\n                    elif (last_candle['rsi_14'] < 35.0):\n                        return True, 'signal_profit_u_bull_2_9'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_1_4'\n                    elif (last_candle['cti'] > 0.96):\n                        return True, 'signal_profit_u_bull_1_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_1_6'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bull_1_7'\n                    elif last_candle['rsi_14'] < 40.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_u_bull_1_8'\n                    elif (last_candle['rsi_14'] < 33.0):\n                        return True, 'signal_profit_u_bull_1_9'\n            else:\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0:\n                        return True, 'signal_profit_u_bear_12_1'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0:\n                        return True, 'signal_profit_u_bear_11_1'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 46.0:\n                        return True, 'signal_profit_u_bear_10_1'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'signal_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] > 82.0):\n                        return True, 'signal_profit_u_bear_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if last_candle['rsi_14'] < 57.0:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > 80.0):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if last_candle['rsi_14'] < 56.0:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if last_candle['rsi_14'] < 54.0:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_u_bear_6_3'\n                    elif (last_candle['cti'] > 0.94):\n                        return True, 'signal_profit_u_bear_6_5'\n                elif 0.06 > current_profit >= 0.05:\n                    if last_candle['rsi_14'] < 52.0:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_5_4'\n                    elif (last_candle['cti'] > 0.942):\n                        return True, 'signal_profit_u_bear_5_5'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'signal_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_4_4'\n                    elif (last_candle['cti'] > 0.944):\n                        return True, 'signal_profit_u_bear_4_5'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if last_candle['rsi_14'] < 48.0:\n                        return True, 'signal_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_3_4'\n                    elif (last_candle['cti'] > 0.946):\n                        return True, 'signal_profit_u_bear_3_5'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if last_candle['rsi_14'] < 55.0:  # 46\n                        return True, 'signal_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_2_4'\n                    elif (last_candle['cti'] > 0.948):\n                        return True, 'signal_profit_u_bear_2_5'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_2_6'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bear_2_7'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_1_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_u_bear_1_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (\n                            last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_1_6'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.05) and (\n                            last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bear_1_7'\n                    elif (last_candle['rsi_14'] < 34.0):\n                        return True, 'signal_profit_u_bear_1_9'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_1_4'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_1_4'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_1_4'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1 > current_profit >= self.sell_custom_dec_profit_min_1) and (\n                last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2 > current_profit >= self.sell_custom_dec_profit_min_2) and (\n                last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1 > current_profit >= self.sell_trail_profit_min_1) and (\n                self.sell_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_trail_rsi_max_1) and (\n                max_profit > (current_profit + self.sell_trail_down_1)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2 > current_profit >= self.sell_trail_profit_min_2) and (\n                self.sell_trail_rsi_min_2 < last_candle['rsi_14'] < self.sell_trail_rsi_max_2) and (\n                max_profit > (current_profit + self.sell_trail_down_2)) and (\n                last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3 > current_profit >= self.sell_trail_profit_min_3) and (\n                max_profit > (current_profit + self.sell_trail_down_3)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4 > current_profit >= self.sell_trail_profit_min_4) and (\n                max_profit > (current_profit + self.sell_trail_down_4)) and (last_candle['sma_200_dec_24']) and (\n                last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (\n                current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1 < current_profit < self.sell_custom_long_profit_max_1) and (\n                current_time - timedelta(minutes=self.sell_custom_long_duration_min_1) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (\n                    self.sell_custom_profit_under_profit_max_1 > current_profit >= self.sell_custom_profit_under_profit_min_1) and (\n                    last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle[\n                'close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1) and (\n                    last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit >= self.sell_custom_profit_under_profit_2) and (\n                    last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle[\n                'close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2) and (\n                    last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1,\n                      trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Under & near EMA200, local uptrend move\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.004)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'signal_stoploss_u_e_1'\n\n        # Under EMA200, local strong uptrend move\n        if (\n                (current_profit < -0.08)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 24.0))\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'signal_stoploss_u_e_2'\n\n        # Under EMA200, pair negative, low max rate\n        if (\n                (current_profit < -0.08)\n                and (max_profit < 0.04)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (current_time - timedelta(minutes=1440) > trade.open_date_utc)\n        ):\n            return True, 'signal_stoploss_u_e_doom'\n\n        # Under EMA200, pair and BTC negative, low max rate\n        if (\n                (-0.05 > current_profit > -0.09)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (max_profit < 0.005)\n                and (max_loss < 0.09)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -50.0)\n        ):\n            return True, 'signal_stoploss_u_e_b_1'\n\n        # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (\n                (-0.1 > current_profit > -0.2)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (max_profit < 0.05)\n                and (max_loss < 0.2)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['cmf'] < -0.45)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -97.0)\n        ):\n            return True, 'signal_stoploss_u_e_b_2'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (0.03 > current_profit >= 0.005) and (last_candle['sell_pump_48_1_1h']) and (\n                last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (0.06 > current_profit >= 0.04) and (last_candle['sell_pump_48_2_1h']) and (\n                last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (0.09 > current_profit >= 0.06) and (last_candle['sell_pump_48_3_1h']) and (\n                last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (0.04 > current_profit >= 0.02) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1 > current_profit >= self.sell_custom_pump_under_profit_min_1) and (\n                last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (\n                self.sell_custom_pump_trail_profit_max_1 > current_profit >= self.sell_custom_pump_trail_profit_min_1) and (\n                self.sell_custom_pump_trail_rsi_min_1 < last_candle[\n            'rsi_14'] < self.sell_custom_pump_trail_rsi_max_1) and (\n                max_profit > (current_profit + self.sell_custom_pump_trail_down_1)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1) and (current_profit >= self.sell_custom_recover_profit_1):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2) and (\n                self.sell_custom_recover_profit_max_2 > current_profit >= self.sell_custom_recover_profit_min_2) and (\n                last_candle['rsi_14'] < self.sell_custom_recover_rsi_2) and (\n                last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.4:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.5:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.7:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -4.1) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.2) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.3) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.5) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -4.8) and (last_candle['rsi_14'] > 80.5) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 80.5) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -3.2) and (last_candle['rsi_14'] > 81.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 81.5) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 74.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (\n                    last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -5.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_r_5(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_12'\n\n        return False, None\n\n    def sell_r_6(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_14'] > -0.2) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_14'] > -0.3) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_14'] > -0.6) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_14'] > -1.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_14'] > -0.75) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (\n                    last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_12'\n\n        return False, None\n\n    def mark_profit_target(self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float,\n                           current_profit: float, last_candle, previous_candle_1) -> tuple:\n        # if self.profit_target_1_enable:\n        #     if (current_profit > 0) and (last_candle['zlema_4_lowKF'] > last_candle['lowKF']) and (previous_candle_1['zlema_4_lowKF'] < previous_candle_1['lowKF']) and (last_candle['cci'] > -100) and (last_candle['hrsi'] > 70):\n        #         return pair, \"mark_profit_target_01\"\n        return None, None\n\n    def sell_profit_target(self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float,\n                           current_profit: float, last_candle, previous_candle_1, previous_rate, previous_sell_reason,\n                           previous_time_profit_reached) -> tuple:\n        # if self.profit_target_1_enable and previous_sell_reason == \"mark_profit_target_01\":\n        #     if (current_profit > 0) and (current_rate < (previous_rate - 0.005)):\n        #         return True, 'sell_profit_target_01'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit: float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (0.04 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (\n                last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return True, 'signal_profit_q_pmax_bull'\n        if (0.045 > current_profit > 0.005) and (last_candle['pm'] > last_candle['pmax_thresh']) and (\n                last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_coh'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1,\n                  trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.0 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (\n                last_candle['rsi_14'] > 78.0):\n            return True, 'signal_profit_ichi_u'\n\n        elif (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_profit_ichi_r_0'\n        elif (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_profit_ichi_r_1'\n        elif (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_profit_ichi_r_2'\n        elif (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_profit_ichi_r_3'\n        elif (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_profit_ichi_r_4'\n\n        elif (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_profit_ichi_slow'\n\n        elif (0.07 < current_profit < 0.1) and (max_profit - current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_profit_ichi_t'\n\n        return False, None\n\n    def sell_long_mode(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1,\n                       previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade',\n                       current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 78.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (\n                previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (\n                previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (\n                previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (\n                previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (\n                previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_1_2_1'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (\n                previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (\n                previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_2_2_1'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 82.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_3_2_1'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 80.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_4_2_1'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (\n                last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_long_6_1'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 82.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_7_2_1'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.05):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_8_2_1'\n\n        elif (0.02 < current_profit <= 0.06) and (max_profit - current_profit > 0.04) and (\n                last_candle['cmf'] < 0.0) and (last_candle['sma_200_dec_24']):\n            return True, 'sell_long_t_1'\n        elif (0.06 < current_profit <= 0.12) and (max_profit - current_profit > 0.06) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_2'\n        elif (0.12 < current_profit <= 0.24) and (max_profit - current_profit > 0.08) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_3'\n        elif (0.24 < current_profit <= 0.5) and (max_profit - current_profit > 0.09) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_4'\n        elif (0.5 < current_profit <= 0.9) and (max_profit - current_profit > 0.1) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_5'\n\n        elif (0.03 < current_profit <= 0.06) and (current_time - timedelta(minutes=720) > trade.open_date_utc) and (\n                last_candle['r_480'] > -20.0):\n            return True, 'sell_long_l_1'\n\n        return self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade,\n                                  current_time)\n\n    def sell_pivot(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1,\n                   trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['close'] > (last_candle['res3_1d'] * 2.2)):\n            if (0.02 > current_profit >= 0.012):\n                if (last_candle['r_14'] >= -0.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_480'] > -3.0):\n                    return True, 'signal_profit_pv_1_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480'] > -5.0):\n                    return True, 'signal_profit_pv_1_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_14'] > -0.8) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480'] > -10.0):\n                    return True, 'signal_profit_pv_1_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480'] > -15.0):\n                    return True, 'signal_profit_pv_1_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_14'] > -1.2) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] > -20.0):\n                    return True, 'signal_profit_pv_1_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_14'] > -1.6) and (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] > -25.0):\n                    return True, 'signal_profit_pv_1_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['r_480'] > -30.0):\n                    return True, 'signal_profit_pv_1_7_1'\n\n        elif (last_candle['close'] > (last_candle['res3_1d'] * 1.3)):\n            if (0.02 > current_profit >= 0.012):\n                if (last_candle['rsi_14'] > 80.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_1_1'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] > -1.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_1_2'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] > 78.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_2_1'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] > -3.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_2_2'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] > 76.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_3_1'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_3_2'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] > 72.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_4_1'\n                elif (last_candle['rsi_14'] > 71.0) and (last_candle['r_14'] > -7.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_4_2'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] > 68.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_5_1'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -9.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_5_2'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] > 60.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_6_1'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_14'] > -9.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_6_2'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] > 58.0) and (last_candle['cti_1h'] > 0.84) and (\n                        last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_7_1'\n                elif (last_candle['rsi_14'] > 57.0) and (last_candle['r_14'] > -9.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_7_2'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Long mode\n        if all(c in ['45', '46', '47'] for c in buy_tags):\n            sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle,\n                                                    previous_candle_1, previous_candle_2, previous_candle_3,\n                                                    previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n            # Skip remaining sell logic for long mode\n            return None\n\n        # Quick sell mode\n        if all(c in ['empty', '32', '33', '34', '35', '36', '37', '38', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1,\n                                               trade, current_time)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1,\n                                               trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 5, plus  RSI and CTI 1h\n        sell, signal_name = self.sell_r_5(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 6, plus  RSI, CTI, CCI\n        sell, signal_name = self.sell_r_6(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pivot points based sells\n        sell, signal_name = self.sell_pivot(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade,\n                                            current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Profit Target Signal\n        # Check if pair exist on target_profit_cache\n        if self.target_profit_cache is not None and pair in self.target_profit_cache.data:\n            previous_rate = self.target_profit_cache.data[pair]['rate']\n            previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']\n            previous_time_profit_reached = datetime.fromisoformat(\n                self.target_profit_cache.data[pair]['time_profit_reached'])\n\n            sell, signal_name = self.sell_profit_target(pair, trade, current_time, current_rate, current_profit,\n                                                        last_candle, previous_candle_1, previous_rate,\n                                                        previous_sell_reason, previous_time_profit_reached)\n            if sell and signal_name is not None:\n                return f\"{signal_name} ( {buy_tag})\"\n\n        pair, mark_signal = self.mark_profit_target(pair, trade, current_time, current_rate, current_profit,\n                                                    last_candle, previous_candle_1)\n        if pair:\n            self._set_profit_target(pair, mark_signal, current_rate, current_time)\n\n        # Sell signal 1\n        if self.sell_condition_1_enable and (last_candle['rsi_14'] > self.sell_rsi_bb_1) and (\n                last_candle['close'] > last_candle['bb20_2_upp']) and (\n                previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (\n                previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (\n                previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (\n                previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (\n                previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_1_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_1_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_1_2_2 ( {buy_tag})\"\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable) and (last_candle['rsi_14'] > self.sell_rsi_bb_2) and (\n                last_candle['close'] > last_candle['bb20_2_upp']) and (\n                previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (\n                previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_2_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_2_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_2_2_2 ( {buy_tag})\"\n\n        # Sell signal 3\n        elif (self.sell_condition_3_enable) and (last_candle['rsi_14'] > self.sell_rsi_main_3):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_3_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_3_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_3_2_2 ( {buy_tag})\"\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4) and (\n                last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_4_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_4_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_4_2_2 ( {buy_tag})\"\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable and (last_candle['close'] < last_candle['ema_200']) and (\n                last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6):\n            if (current_profit > 0.01):\n                return f\"sell_signal_6_1 ( {buy_tag})\"\n            elif (max_loss > 0.5):\n                return f\"sell_signal_6_2 ( {buy_tag})\"\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7) and (\n                last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_7_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_7_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_7_2_2 ( {buy_tag})\"\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable and (\n                last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_8_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_8_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_8_2_2 ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe[\n                'low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe[\n                'close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (\n                self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT', 'BUSD', 'USDC', 'DAI', 'TUSD', 'PAX', 'USD', 'EUR', 'GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(\n                lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns=column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(\n                lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns=column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d[\n            'sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = HeikinAshi(informative_1d,\n                                                                                                        smooth_inputs=True,\n                                                                                                        smooth_outputs=False,\n                                                                                                        length=10)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EWO\n        informative_1h['ewo_sma'] = ewo_sma(informative_1h, 50, 200)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] = (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown,\n                                                                                         timeperiod=2) + ta.ROC(\n            informative_1h['close'], 100)) / 3\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120,\n                        displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h['chikou_span_greater'] = (informative_1h['chikou_span'] > informative_1h['senkou_a']).shift(\n            30).fillna(False)\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24,\n                                                           self.buy_pump_pull_threshold_10_24)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36,\n                                                           self.buy_pump_pull_threshold_10_36)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48,\n                                                           self.buy_pump_pull_threshold_10_48)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24,\n                                                           self.buy_pump_pull_threshold_20_24)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36,\n                                                           self.buy_pump_pull_threshold_20_36)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48,\n                                                           self.buy_pump_pull_threshold_20_48)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24,\n                                                           self.buy_pump_pull_threshold_30_24)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36,\n                                                           self.buy_pump_pull_threshold_30_36)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48,\n                                                           self.buy_pump_pull_threshold_30_48)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24,\n                                                           self.buy_pump_pull_threshold_40_24)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36,\n                                                           self.buy_pump_pull_threshold_40_36)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48,\n                                                           self.buy_pump_pull_threshold_40_48)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24,\n                                                           self.buy_pump_pull_threshold_50_24)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36,\n                                                           self.buy_pump_pull_threshold_50_36)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48,\n                                                           self.buy_pump_pull_threshold_50_48)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24,\n                                                           self.buy_pump_pull_threshold_60_24)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36,\n                                                           self.buy_pump_pull_threshold_60_36)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48,\n                                                           self.buy_pump_pull_threshold_60_48)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24,\n                                                           self.buy_pump_pull_threshold_70_24)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36,\n                                                           self.buy_pump_pull_threshold_70_36)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48,\n                                                           self.buy_pump_pull_threshold_70_48)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24,\n                                                           self.buy_pump_pull_threshold_80_24)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36,\n                                                           self.buy_pump_pull_threshold_80_36)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48,\n                                                           self.buy_pump_pull_threshold_80_48)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24,\n                                                           self.buy_pump_pull_threshold_90_24)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36,\n                                                           self.buy_pump_pull_threshold_90_36)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48,\n                                                           self.buy_pump_pull_threshold_90_48)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24,\n                                                            self.buy_pump_pull_threshold_100_24)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36,\n                                                            self.buy_pump_pull_threshold_100_36)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48,\n                                                            self.buy_pump_pull_threshold_100_48)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24,\n                                                            self.buy_pump_pull_threshold_110_24)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36,\n                                                            self.buy_pump_pull_threshold_110_36)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48,\n                                                            self.buy_pump_pull_threshold_110_48)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24,\n                                                            self.buy_pump_pull_threshold_120_24)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36,\n                                                            self.buy_pump_pull_threshold_120_36)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48,\n                                                            self.buy_pump_pull_threshold_120_48)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo_sma'] = ewo_sma(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop'] = qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] = (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(\n            dataframe['close'], 100)) / 3\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close']) / 4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # CCI Oscillator\n        cci_36 = ta.CCI(dataframe, timeperiod=36)\n        cci_36_max = cci_36.rolling(self.startup_candle_count).max()\n        cci_36_min = cci_36.rolling(self.startup_candle_count).min()\n        dataframe['cci_36_osc'] = (cci_36 / cci_36_max).where(cci_36 > 0, -cci_36 / cci_36_min)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # Dip protection\n        dataframe['tpct_change_0'] = self.top_percent_change(dataframe, 0)\n        dataframe['tpct_change_2'] = self.top_percent_change(dataframe, 2)\n        dataframe['tpct_change_12'] = self.top_percent_change(dataframe, 12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe, 144)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days), 'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe[\n            'sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT', 'BUSD', 'USDC', 'DAI', 'TUSD', 'PAX', 'USD', 'EUR', 'GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h,\n                                               ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d,\n                                               ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h,\n                                               ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(\n                columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\", \"\")), \"\"),\n                inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                # Coin's price hits 24h low, then buy, check this every 5m timeframe\n                    (dataframe[\"close\"] <= dataframe[\"low\"].shift().rolling(288).min()) &  # Guard: tema is raising\n                    (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n\n        self._remove_profit_target(pair)\n        return True\n\n    def _set_profit_target(self, pair: str, sell_reason: str, rate: float, current_time: \"datetime\"):\n        self.target_profit_cache.data[pair] = {\n            \"rate\": rate,\n            \"sell_reason\": sell_reason,\n            \"time_profit_reached\": current_time.isoformat()\n        }\n        self.target_profit_cache.save()\n\n    def _remove_profit_target(self, pair: str):\n        if self.target_profit_cache is not None:\n            self.target_profit_cache.data.pop(pair, None)\n            self.target_profit_cache.save()\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\ndef ewo_sma(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.SMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.SMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (\n            dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag = int(math.floor((timeperiod - 1) / 2))\n    if isinstance(dataframe, Series):\n        ema_data = dataframe + (dataframe - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close'] + (dataframe['close'] - dataframe['close'].shift(lag))\n    return ta.EMA(ema_data, timeperiod=timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag = int(math.floor((timeperiod - 1) / 2))\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close'] - dataframe['close'].shift(lag))\n\n    return ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod / 2))) - ta.WMA(wma_data, timeperiod),\n        int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod / 2))) - ta.WMA(dataframe, timeperiod),\n            int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod / 2))) - ta.WMA(dataframe['close'], timeperiod),\n            int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier / 10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier / 10) * df[atr])\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n                basic_ub[i] < final_ub[i - 1]\n                or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n                basic_lb[i] > final_lb[i - 1]\n                or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                            and mavalue[i] <= final_ub[i])\n            else final_lb[i] if (\n                    pm_arr[i - 1] == final_ub[i - 1]\n                    and mavalue[i] > final_ub[i]) else final_lb[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] >= final_lb[i]) else final_ub[i]\n            if (pm_arr[i - 1] == final_lb[i - 1]\n                and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down', 'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n\n# SSL Channels\ndef SSLChannels(dataframe, length=7):\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\n\ndef pivot_points(dataframe: DataFrame, mode='fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\n\ndef HeikinAshi(dataframe, smooth_inputs=False, smooth_outputs=False, length=10):\n    df = dataframe[['open', 'close', 'high', 'low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s'] = ta.EMA(df['open'], timeframe=length)\n        df['high_s'] = ta.EMA(df['high'], timeframe=length)\n        df['low_s'] = ta.EMA(df['low'], timeframe=length)\n        df['close_s'] = ta.EMA(df['close'], timeframe=length)\n\n        open_ha = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s']) / 4\n    else:\n        open_ha = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close']) / 4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha = ta.EMA(open_ha, timeframe=length)\n        high_sha = ta.EMA(high_ha, timeframe=length)\n        low_sha = ta.EMA(low_ha, timeframe=length)\n        close_sha = ta.EMA(close_ha, timeframe=length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0,\n           lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n        \"momdiv_mom\": mom,\n        \"momdiv_upperb\": upperband,\n        \"momdiv_lowerb\": lowerband,\n        \"momdiv_buy\": buy,\n        \"momdiv_sell\": sell,\n        \"momdiv_coh\": coh,\n        \"momdiv_col\": col,\n    }, index=dataframe['close'].index)\n    return df\n\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data\n"
  },
  {
    "path": "strategies/NormalizerStrategy/NormalizerStrategy.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\n\n\n\n\nclass NormalizerStrategy(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.18\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.015\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 610\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=300) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def fischer_norm(self, x, lookback):\n        res = np.zeros_like(x)\n        for i in range(lookback, len(x)):\n            x_min = np.min(x[i-lookback: i +1])\n            x_max = np.max(x[i-lookback: i +1])\n            #res[i] = (2*(x[i] - x_min) / (x_max - x_min)) - 1\n            res[i] = (x[i] - x_min) / (x_max - x_min)\n        return res\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        lookback = [13, 21, 34, 55, 89, 144, 233, 377, 610]\n        for look in lookback:\n            dataframe[f\"norm_{look}\"] = self.fischer_norm(dataframe[\"close\"].values, look)\n        collist = [col for col in dataframe.columns if col.startswith(\"norm\")]\n        dataframe[\"pct_sum\"] = dataframe[collist].sum(axis=1)\n\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['pct_sum'] < .2) &\n            (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ,\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['pct_sum'] > 8) &\n            (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ,\n            'sell'\n        ] = 1\n        return dataframe"
  },
  {
    "path": "strategies/NormalizerStrategyHO2/NormalizerStrategyHO2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom datetime import datetime, timedelta\n\n\n\"\"\"\n=============== SUMMARY METRICS ===============\n| Metric                | Value               |\n|-----------------------+---------------------|\n| Backtesting from      | 2021-05-01 00:00:00 |\n| Backtesting to        | 2021-06-09 17:00:00 |\n| Max open trades       | 10                  |\n|                       |                     |\n| Total trades          | 447                 |\n| Starting balance      | 1000.000 USDT       |\n| Final balance         | 1714.575 USDT       |\n| Absolute profit       | 714.575 USDT        |\n| Total profit %        | 71.46%              |\n| Trades per day        | 11.46               |\n| Avg. stake amount     | 180.278 USDT        |\n| Total trade volume    | 80584.326 USDT      |\n|                       |                     |\n| Best Pair             | ALICE/USDT 24.7%    |\n| Worst Pair            | HARD/USDT -35.15%   |\n| Best trade            | PSG/USDT 17.98%     |\n| Worst trade           | XVS/USDT -26.03%    |\n| Best day              | 351.588 USDT        |\n| Worst day             | -256.636 USDT       |\n| Days win/draw/lose    | 25 / 8 / 4          |\n| Avg. Duration Winners | 1:36:00             |\n| Avg. Duration Loser   | 9:33:00             |\n|                       |                     |\n| Min balance           | 962.929 USDT        |\n| Max balance           | 1714.575 USDT       |\n| Drawdown              | 240.78%             |\n| Drawdown              | 289.267 USDT        |\n| Drawdown high         | 252.196 USDT        |\n| Drawdown low          | -37.071 USDT        |\n| Drawdown Start        | 2021-05-19 03:00:00 |\n| Drawdown End          | 2021-05-19 20:00:00 |\n| Market change         | -34.99%             |\n===============================================\n\n\"\"\"\n\n\nclass NormalizerStrategyHO2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.35,\n        \"405\": 0.248,\n        \"875\": 0.091,\n        \"1585\": 0\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '1h'\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.3\n    trailing_stop_positive_offset = 0.379\n    trailing_only_offset_is_reached = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 610\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        # Manage losing trades and open room for better ones.\n        if (current_profit < 0) & (current_time - timedelta(minutes=300) > trade.open_date_utc):\n            return 0.01\n        return 0.99\n\n    def fischer_norm(self, x, lookback):\n        res = np.zeros_like(x)\n        for i in range(lookback, len(x)):\n            x_min = np.min(x[i-lookback: i +1])\n            x_max = np.max(x[i-lookback: i +1])\n            #res[i] = (2*(x[i] - x_min) / (x_max - x_min)) - 1\n            res[i] = (x[i] - x_min) / (x_max - x_min)\n        return res\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        lookback = [13, 21, 34, 55, 89, 144, 233, 377, 610]\n        for look in lookback:\n            dataframe[f\"norm_{look}\"] = self.fischer_norm(dataframe[\"close\"].values, look)\n        collist = [col for col in dataframe.columns if col.startswith(\"norm\")]\n        dataframe[\"pct_sum\"] = dataframe[collist].sum(axis=1)\n\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['pct_sum'] < .2) &\n            (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ,\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['pct_sum'] > 8) &\n            (dataframe['volume'] > 0) # Make sure Volume is not 0\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Nostalgia/Nostalgia.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema\n\nlog = logging.getLogger(__name__)\n\nclass Nostalgia(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        2: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        3: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        4: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        5: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        6: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        7: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        8: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        9: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        10: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        11: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        12: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        13: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        14: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        15: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        16: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        17: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        18: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        19: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        20: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        21: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        22: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        23: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        24: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        25: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        26: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        27: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        28: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        29: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        30: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        31: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        }\n    }\n\n    buy_condition_1_enable = buy_protection_params[1][\"enable\"]\n    buy_1_protection__ema_fast                 = buy_protection_params[1][\"ema_fast\"]\n    buy_1_protection__ema_fast_len             = buy_protection_params[1][\"ema_fast_len\"]\n    buy_1_protection__ema_slow                 = buy_protection_params[1][\"ema_slow\"]\n    buy_1_protection__ema_slow_len             = buy_protection_params[1][\"ema_slow_len\"]\n    buy_1_protection__close_above_ema_fast     = buy_protection_params[1][\"close_above_ema_fast\"]\n    buy_1_protection__close_above_ema_fast_len = buy_protection_params[1][\"close_above_ema_fast_len\"]\n    buy_1_protection__close_above_ema_slow     = buy_protection_params[1][\"close_above_ema_slow\"]\n    buy_1_protection__close_above_ema_slow_len = buy_protection_params[1][\"close_above_ema_slow_len\"]\n    buy_1_protection__sma200_rising            = buy_protection_params[1][\"sma200_rising\"]\n    buy_1_protection__sma200_rising_val        = buy_protection_params[1][\"sma200_rising_val\"]\n    buy_1_protection__sma200_1h_rising         = buy_protection_params[1][\"sma200_1h_rising\"]\n    buy_1_protection__sma200_1h_rising_val     = buy_protection_params[1][\"sma200_1h_rising_val\"]\n    buy_1_protection__safe_dips                = buy_protection_params[1][\"safe_dips\"]\n    buy_1_protection__safe_dips_type           = buy_protection_params[1][\"safe_dips_type\"]\n    buy_1_protection__safe_pump                = buy_protection_params[1][\"safe_pump\"]\n    buy_1_protection__safe_pump_type           = buy_protection_params[1][\"safe_pump_type\"]\n    buy_1_protection__safe_pump_period         = buy_protection_params[1][\"safe_pump_period\"]\n    buy_1_protection__btc_1h_not_downtrend     = buy_protection_params[1][\"btc_1h_not_downtrend\"]\n\n    buy_condition_2_enable = buy_protection_params[2][\"enable\"]\n    buy_2_protection__ema_fast                 = buy_protection_params[2][\"ema_fast\"]\n    buy_2_protection__ema_fast_len             = buy_protection_params[2][\"ema_fast_len\"]\n    buy_2_protection__ema_slow                 = buy_protection_params[2][\"ema_slow\"]\n    buy_2_protection__ema_slow_len             = buy_protection_params[2][\"ema_slow_len\"]\n    buy_2_protection__close_above_ema_fast     = buy_protection_params[2][\"close_above_ema_fast\"]\n    buy_2_protection__close_above_ema_fast_len = buy_protection_params[2][\"close_above_ema_fast_len\"]\n    buy_2_protection__close_above_ema_slow     = buy_protection_params[2][\"close_above_ema_slow\"]\n    buy_2_protection__close_above_ema_slow_len = buy_protection_params[2][\"close_above_ema_slow_len\"]\n    buy_2_protection__sma200_rising            = buy_protection_params[2][\"sma200_rising\"]\n    buy_2_protection__sma200_rising_val        = buy_protection_params[2][\"sma200_rising_val\"]\n    buy_2_protection__sma200_1h_rising         = buy_protection_params[2][\"sma200_1h_rising\"]\n    buy_2_protection__sma200_1h_rising_val     = buy_protection_params[2][\"sma200_1h_rising_val\"]\n    buy_2_protection__safe_dips                = buy_protection_params[2][\"safe_dips\"]\n    buy_2_protection__safe_dips_type           = buy_protection_params[2][\"safe_dips_type\"]\n    buy_2_protection__safe_pump                = buy_protection_params[2][\"safe_pump\"]\n    buy_2_protection__safe_pump_type           = buy_protection_params[2][\"safe_pump_type\"]\n    buy_2_protection__safe_pump_period         = buy_protection_params[2][\"safe_pump_period\"]\n    buy_2_protection__btc_1h_not_downtrend     = buy_protection_params[2][\"btc_1h_not_downtrend\"]\n\n    buy_condition_3_enable = buy_protection_params[3][\"enable\"]\n    buy_3_protection__ema_fast                 = buy_protection_params[3][\"ema_fast\"]\n    buy_3_protection__ema_fast_len             = buy_protection_params[3][\"ema_fast_len\"]\n    buy_3_protection__ema_slow                 = buy_protection_params[3][\"ema_slow\"]\n    buy_3_protection__ema_slow_len             = buy_protection_params[3][\"ema_slow_len\"]\n    buy_3_protection__close_above_ema_fast     = buy_protection_params[3][\"close_above_ema_fast\"]\n    buy_3_protection__close_above_ema_fast_len = buy_protection_params[3][\"close_above_ema_fast_len\"]\n    buy_3_protection__close_above_ema_slow     = buy_protection_params[3][\"close_above_ema_slow\"]\n    buy_3_protection__close_above_ema_slow_len = buy_protection_params[3][\"close_above_ema_slow_len\"]\n    buy_3_protection__sma200_rising            = buy_protection_params[3][\"sma200_rising\"]\n    buy_3_protection__sma200_rising_val        = buy_protection_params[3][\"sma200_rising_val\"]\n    buy_3_protection__sma200_1h_rising         = buy_protection_params[3][\"sma200_1h_rising\"]\n    buy_3_protection__sma200_1h_rising_val     = buy_protection_params[3][\"sma200_1h_rising_val\"]\n    buy_3_protection__safe_dips                = buy_protection_params[3][\"safe_dips\"]\n    buy_3_protection__safe_dips_type           = buy_protection_params[3][\"safe_dips_type\"]\n    buy_3_protection__safe_pump                = buy_protection_params[3][\"safe_pump\"]\n    buy_3_protection__safe_pump_type           = buy_protection_params[3][\"safe_pump_type\"]\n    buy_3_protection__safe_pump_period         = buy_protection_params[3][\"safe_pump_period\"]\n    buy_3_protection__btc_1h_not_downtrend     = buy_protection_params[3][\"btc_1h_not_downtrend\"]\n\n    buy_condition_4_enable = buy_protection_params[4][\"enable\"]\n    buy_4_protection__ema_fast                 = buy_protection_params[4][\"ema_fast\"]\n    buy_4_protection__ema_fast_len             = buy_protection_params[4][\"ema_fast_len\"]\n    buy_4_protection__ema_slow                 = buy_protection_params[4][\"ema_slow\"]\n    buy_4_protection__ema_slow_len             = buy_protection_params[4][\"ema_slow_len\"]\n    buy_4_protection__close_above_ema_fast     = buy_protection_params[4][\"close_above_ema_fast\"]\n    buy_4_protection__close_above_ema_fast_len = buy_protection_params[4][\"close_above_ema_fast_len\"]\n    buy_4_protection__close_above_ema_slow     = buy_protection_params[4][\"close_above_ema_slow\"]\n    buy_4_protection__close_above_ema_slow_len = buy_protection_params[4][\"close_above_ema_slow_len\"]\n    buy_4_protection__sma200_rising            = buy_protection_params[4][\"sma200_rising\"]\n    buy_4_protection__sma200_rising_val        = buy_protection_params[4][\"sma200_rising_val\"]\n    buy_4_protection__sma200_1h_rising         = buy_protection_params[4][\"sma200_1h_rising\"]\n    buy_4_protection__sma200_1h_rising_val     = buy_protection_params[4][\"sma200_1h_rising_val\"]\n    buy_4_protection__safe_dips                = buy_protection_params[4][\"safe_dips\"]\n    buy_4_protection__safe_dips_type           = buy_protection_params[4][\"safe_dips_type\"]\n    buy_4_protection__safe_pump                = buy_protection_params[4][\"safe_pump\"]\n    buy_4_protection__safe_pump_type           = buy_protection_params[4][\"safe_pump_type\"]\n    buy_4_protection__safe_pump_period         = buy_protection_params[4][\"safe_pump_period\"]\n    buy_4_protection__btc_1h_not_downtrend     = buy_protection_params[4][\"btc_1h_not_downtrend\"]\n\n    buy_condition_5_enable = buy_protection_params[5][\"enable\"]\n    buy_5_protection__ema_fast                 = buy_protection_params[5][\"ema_fast\"]\n    buy_5_protection__ema_fast_len             = buy_protection_params[5][\"ema_fast_len\"]\n    buy_5_protection__ema_slow                 = buy_protection_params[5][\"ema_slow\"]\n    buy_5_protection__ema_slow_len             = buy_protection_params[5][\"ema_slow_len\"]\n    buy_5_protection__close_above_ema_fast     = buy_protection_params[5][\"close_above_ema_fast\"]\n    buy_5_protection__close_above_ema_fast_len = buy_protection_params[5][\"close_above_ema_fast_len\"]\n    buy_5_protection__close_above_ema_slow     = buy_protection_params[5][\"close_above_ema_slow\"]\n    buy_5_protection__close_above_ema_slow_len = buy_protection_params[5][\"close_above_ema_slow_len\"]\n    buy_5_protection__sma200_rising            = buy_protection_params[5][\"sma200_rising\"]\n    buy_5_protection__sma200_rising_val        = buy_protection_params[5][\"sma200_rising_val\"]\n    buy_5_protection__sma200_1h_rising         = buy_protection_params[5][\"sma200_1h_rising\"]\n    buy_5_protection__sma200_1h_rising_val     = buy_protection_params[5][\"sma200_1h_rising_val\"]\n    buy_5_protection__safe_dips                = buy_protection_params[5][\"safe_dips\"]\n    buy_5_protection__safe_dips_type           = buy_protection_params[5][\"safe_dips_type\"]\n    buy_5_protection__safe_pump                = buy_protection_params[5][\"safe_pump\"]\n    buy_5_protection__safe_pump_type           = buy_protection_params[5][\"safe_pump_type\"]\n    buy_5_protection__safe_pump_period         = buy_protection_params[5][\"safe_pump_period\"]\n    buy_5_protection__btc_1h_not_downtrend     = buy_protection_params[5][\"btc_1h_not_downtrend\"]\n\n    buy_condition_6_enable = buy_protection_params[6][\"enable\"]\n    buy_6_protection__ema_fast                 = buy_protection_params[6][\"ema_fast\"]\n    buy_6_protection__ema_fast_len             = buy_protection_params[6][\"ema_fast_len\"]\n    buy_6_protection__ema_slow                 = buy_protection_params[6][\"ema_slow\"]\n    buy_6_protection__ema_slow_len             = buy_protection_params[6][\"ema_slow_len\"]\n    buy_6_protection__close_above_ema_fast     = buy_protection_params[6][\"close_above_ema_fast\"]\n    buy_6_protection__close_above_ema_fast_len = buy_protection_params[6][\"close_above_ema_fast_len\"]\n    buy_6_protection__close_above_ema_slow     = buy_protection_params[6][\"close_above_ema_slow\"]\n    buy_6_protection__close_above_ema_slow_len = buy_protection_params[6][\"close_above_ema_slow_len\"]\n    buy_6_protection__sma200_rising            = buy_protection_params[6][\"sma200_rising\"]\n    buy_6_protection__sma200_rising_val        = buy_protection_params[6][\"sma200_rising_val\"]\n    buy_6_protection__sma200_1h_rising         = buy_protection_params[6][\"sma200_1h_rising\"]\n    buy_6_protection__sma200_1h_rising_val     = buy_protection_params[6][\"sma200_1h_rising_val\"]\n    buy_6_protection__safe_dips                = buy_protection_params[6][\"safe_dips\"]\n    buy_6_protection__safe_dips_type           = buy_protection_params[6][\"safe_dips_type\"]\n    buy_6_protection__safe_pump                = buy_protection_params[6][\"safe_pump\"]\n    buy_6_protection__safe_pump_type           = buy_protection_params[6][\"safe_pump_type\"]\n    buy_6_protection__safe_pump_period         = buy_protection_params[6][\"safe_pump_period\"]\n    buy_6_protection__btc_1h_not_downtrend     = buy_protection_params[6][\"btc_1h_not_downtrend\"]\n\n    buy_condition_7_enable = buy_protection_params[7][\"enable\"]\n    buy_7_protection__ema_fast                 = buy_protection_params[7][\"ema_fast\"]\n    buy_7_protection__ema_fast_len             = buy_protection_params[7][\"ema_fast_len\"]\n    buy_7_protection__ema_slow                 = buy_protection_params[7][\"ema_slow\"]\n    buy_7_protection__ema_slow_len             = buy_protection_params[7][\"ema_slow_len\"]\n    buy_7_protection__close_above_ema_fast     = buy_protection_params[7][\"close_above_ema_fast\"]\n    buy_7_protection__close_above_ema_fast_len = buy_protection_params[7][\"close_above_ema_fast_len\"]\n    buy_7_protection__close_above_ema_slow     = buy_protection_params[7][\"close_above_ema_slow\"]\n    buy_7_protection__close_above_ema_slow_len = buy_protection_params[7][\"close_above_ema_slow_len\"]\n    buy_7_protection__sma200_rising            = buy_protection_params[7][\"sma200_rising\"]\n    buy_7_protection__sma200_rising_val        = buy_protection_params[7][\"sma200_rising_val\"]\n    buy_7_protection__sma200_1h_rising         = buy_protection_params[7][\"sma200_1h_rising\"]\n    buy_7_protection__sma200_1h_rising_val     = buy_protection_params[7][\"sma200_1h_rising_val\"]\n    buy_7_protection__safe_dips                = buy_protection_params[7][\"safe_dips\"]\n    buy_7_protection__safe_dips_type           = buy_protection_params[7][\"safe_dips_type\"]\n    buy_7_protection__safe_pump                = buy_protection_params[7][\"safe_pump\"]\n    buy_7_protection__safe_pump_type           = buy_protection_params[7][\"safe_pump_type\"]\n    buy_7_protection__safe_pump_period         = buy_protection_params[7][\"safe_pump_period\"]\n    buy_7_protection__btc_1h_not_downtrend     = buy_protection_params[7][\"btc_1h_not_downtrend\"]\n\n    buy_condition_8_enable = buy_protection_params[8][\"enable\"]\n    buy_8_protection__ema_fast                 = buy_protection_params[8][\"ema_fast\"]\n    buy_8_protection__ema_fast_len             = buy_protection_params[8][\"ema_fast_len\"]\n    buy_8_protection__ema_slow                 = buy_protection_params[8][\"ema_slow\"]\n    buy_8_protection__ema_slow_len             = buy_protection_params[8][\"ema_slow_len\"]\n    buy_8_protection__close_above_ema_fast     = buy_protection_params[8][\"close_above_ema_fast\"]\n    buy_8_protection__close_above_ema_fast_len = buy_protection_params[8][\"close_above_ema_fast_len\"]\n    buy_8_protection__close_above_ema_slow     = buy_protection_params[8][\"close_above_ema_slow\"]\n    buy_8_protection__close_above_ema_slow_len = buy_protection_params[8][\"close_above_ema_slow_len\"]\n    buy_8_protection__sma200_rising            = buy_protection_params[8][\"sma200_rising\"]\n    buy_8_protection__sma200_rising_val        = buy_protection_params[8][\"sma200_rising_val\"]\n    buy_8_protection__sma200_1h_rising         = buy_protection_params[8][\"sma200_1h_rising\"]\n    buy_8_protection__sma200_1h_rising_val     = buy_protection_params[8][\"sma200_1h_rising_val\"]\n    buy_8_protection__safe_dips                = buy_protection_params[8][\"safe_dips\"]\n    buy_8_protection__safe_dips_type           = buy_protection_params[8][\"safe_dips_type\"]\n    buy_8_protection__safe_pump                = buy_protection_params[8][\"safe_pump\"]\n    buy_8_protection__safe_pump_type           = buy_protection_params[8][\"safe_pump_type\"]\n    buy_8_protection__safe_pump_period         = buy_protection_params[8][\"safe_pump_period\"]\n    buy_8_protection__btc_1h_not_downtrend     = buy_protection_params[8][\"btc_1h_not_downtrend\"]\n\n    buy_condition_9_enable = buy_protection_params[9][\"enable\"]\n    buy_9_protection__ema_fast                 = buy_protection_params[9][\"ema_fast\"]\n    buy_9_protection__ema_fast_len             = buy_protection_params[9][\"ema_fast_len\"]\n    buy_9_protection__ema_slow                 = buy_protection_params[9][\"ema_slow\"]\n    buy_9_protection__ema_slow_len             = buy_protection_params[9][\"ema_slow_len\"]\n    buy_9_protection__close_above_ema_fast     = buy_protection_params[9][\"close_above_ema_fast\"]\n    buy_9_protection__close_above_ema_fast_len = buy_protection_params[9][\"close_above_ema_fast_len\"]\n    buy_9_protection__close_above_ema_slow     = buy_protection_params[9][\"close_above_ema_slow\"]\n    buy_9_protection__close_above_ema_slow_len = buy_protection_params[9][\"close_above_ema_slow_len\"]\n    buy_9_protection__sma200_rising            = buy_protection_params[9][\"sma200_rising\"]\n    buy_9_protection__sma200_rising_val        = buy_protection_params[9][\"sma200_rising_val\"]\n    buy_9_protection__sma200_1h_rising         = buy_protection_params[9][\"sma200_1h_rising\"]\n    buy_9_protection__sma200_1h_rising_val     = buy_protection_params[9][\"sma200_1h_rising_val\"]\n    buy_9_protection__safe_dips                = buy_protection_params[9][\"safe_dips\"]\n    buy_9_protection__safe_dips_type           = buy_protection_params[9][\"safe_dips_type\"]\n    buy_9_protection__safe_pump                = buy_protection_params[9][\"safe_pump\"]\n    buy_9_protection__safe_pump_type           = buy_protection_params[9][\"safe_pump_type\"]\n    buy_9_protection__safe_pump_period         = buy_protection_params[9][\"safe_pump_period\"]\n    buy_9_protection__btc_1h_not_downtrend     = buy_protection_params[9][\"btc_1h_not_downtrend\"]\n\n    buy_condition_10_enable = buy_protection_params[10][\"enable\"]\n    buy_10_protection__ema_fast                 = buy_protection_params[10][\"ema_fast\"]\n    buy_10_protection__ema_fast_len             = buy_protection_params[10][\"ema_fast_len\"]\n    buy_10_protection__ema_slow                 = buy_protection_params[10][\"ema_slow\"]\n    buy_10_protection__ema_slow_len             = buy_protection_params[10][\"ema_slow_len\"]\n    buy_10_protection__close_above_ema_fast     = buy_protection_params[10][\"close_above_ema_fast\"]\n    buy_10_protection__close_above_ema_fast_len = buy_protection_params[10][\"close_above_ema_fast_len\"]\n    buy_10_protection__close_above_ema_slow     = buy_protection_params[10][\"close_above_ema_slow\"]\n    buy_10_protection__close_above_ema_slow_len = buy_protection_params[10][\"close_above_ema_slow_len\"]\n    buy_10_protection__sma200_rising            = buy_protection_params[10][\"sma200_rising\"]\n    buy_10_protection__sma200_rising_val        = buy_protection_params[10][\"sma200_rising_val\"]\n    buy_10_protection__sma200_1h_rising         = buy_protection_params[10][\"sma200_1h_rising\"]\n    buy_10_protection__sma200_1h_rising_val     = buy_protection_params[10][\"sma200_1h_rising_val\"]\n    buy_10_protection__safe_dips                = buy_protection_params[10][\"safe_dips\"]\n    buy_10_protection__safe_dips_type           = buy_protection_params[10][\"safe_dips_type\"]\n    buy_10_protection__safe_pump                = buy_protection_params[10][\"safe_pump\"]\n    buy_10_protection__safe_pump_type           = buy_protection_params[10][\"safe_pump_type\"]\n    buy_10_protection__safe_pump_period         = buy_protection_params[10][\"safe_pump_period\"]\n    buy_10_protection__btc_1h_not_downtrend     = buy_protection_params[10][\"btc_1h_not_downtrend\"]\n\n    buy_condition_11_enable = buy_protection_params[11][\"enable\"]\n    buy_11_protection__ema_fast                 = buy_protection_params[11][\"ema_fast\"]\n    buy_11_protection__ema_fast_len             = buy_protection_params[11][\"ema_fast_len\"]\n    buy_11_protection__ema_slow                 = buy_protection_params[11][\"ema_slow\"]\n    buy_11_protection__ema_slow_len             = buy_protection_params[11][\"ema_slow_len\"]\n    buy_11_protection__close_above_ema_fast     = buy_protection_params[11][\"close_above_ema_fast\"]\n    buy_11_protection__close_above_ema_fast_len = buy_protection_params[11][\"close_above_ema_fast_len\"]\n    buy_11_protection__close_above_ema_slow     = buy_protection_params[11][\"close_above_ema_slow\"]\n    buy_11_protection__close_above_ema_slow_len = buy_protection_params[11][\"close_above_ema_slow_len\"]\n    buy_11_protection__sma200_rising            = buy_protection_params[11][\"sma200_rising\"]\n    buy_11_protection__sma200_rising_val        = buy_protection_params[11][\"sma200_rising_val\"]\n    buy_11_protection__sma200_1h_rising         = buy_protection_params[11][\"sma200_1h_rising\"]\n    buy_11_protection__sma200_1h_rising_val     = buy_protection_params[11][\"sma200_1h_rising_val\"]\n    buy_11_protection__safe_dips                = buy_protection_params[11][\"safe_dips\"]\n    buy_11_protection__safe_dips_type           = buy_protection_params[11][\"safe_dips_type\"]\n    buy_11_protection__safe_pump                = buy_protection_params[11][\"safe_pump\"]\n    buy_11_protection__safe_pump_type           = buy_protection_params[11][\"safe_pump_type\"]\n    buy_11_protection__safe_pump_period         = buy_protection_params[11][\"safe_pump_period\"]\n    buy_11_protection__btc_1h_not_downtrend     = buy_protection_params[11][\"btc_1h_not_downtrend\"]\n\n    buy_condition_12_enable = buy_protection_params[12][\"enable\"]\n    buy_12_protection__ema_fast                 = buy_protection_params[12][\"ema_fast\"]\n    buy_12_protection__ema_fast_len             = buy_protection_params[12][\"ema_fast_len\"]\n    buy_12_protection__ema_slow                 = buy_protection_params[12][\"ema_slow\"]\n    buy_12_protection__ema_slow_len             = buy_protection_params[12][\"ema_slow_len\"]\n    buy_12_protection__close_above_ema_fast     = buy_protection_params[12][\"close_above_ema_fast\"]\n    buy_12_protection__close_above_ema_fast_len = buy_protection_params[12][\"close_above_ema_fast_len\"]\n    buy_12_protection__close_above_ema_slow     = buy_protection_params[12][\"close_above_ema_slow\"]\n    buy_12_protection__close_above_ema_slow_len = buy_protection_params[12][\"close_above_ema_slow_len\"]\n    buy_12_protection__sma200_rising            = buy_protection_params[12][\"sma200_rising\"]\n    buy_12_protection__sma200_rising_val        = buy_protection_params[12][\"sma200_rising_val\"]\n    buy_12_protection__sma200_1h_rising         = buy_protection_params[12][\"sma200_1h_rising\"]\n    buy_12_protection__sma200_1h_rising_val     = buy_protection_params[12][\"sma200_1h_rising_val\"]\n    buy_12_protection__safe_dips                = buy_protection_params[12][\"safe_dips\"]\n    buy_12_protection__safe_dips_type           = buy_protection_params[12][\"safe_dips_type\"]\n    buy_12_protection__safe_pump                = buy_protection_params[12][\"safe_pump\"]\n    buy_12_protection__safe_pump_type           = buy_protection_params[12][\"safe_pump_type\"]\n    buy_12_protection__safe_pump_period         = buy_protection_params[12][\"safe_pump_period\"]\n    buy_12_protection__btc_1h_not_downtrend     = buy_protection_params[12][\"btc_1h_not_downtrend\"]\n\n    buy_condition_13_enable = buy_protection_params[13][\"enable\"]\n    buy_13_protection__ema_fast                 = buy_protection_params[13][\"ema_fast\"]\n    buy_13_protection__ema_fast_len             = buy_protection_params[13][\"ema_fast_len\"]\n    buy_13_protection__ema_slow                 = buy_protection_params[13][\"ema_slow\"]\n    buy_13_protection__ema_slow_len             = buy_protection_params[13][\"ema_slow_len\"]\n    buy_13_protection__close_above_ema_fast     = buy_protection_params[13][\"close_above_ema_fast\"]\n    buy_13_protection__close_above_ema_fast_len = buy_protection_params[13][\"close_above_ema_fast_len\"]\n    buy_13_protection__close_above_ema_slow     = buy_protection_params[13][\"close_above_ema_slow\"]\n    buy_13_protection__close_above_ema_slow_len = buy_protection_params[13][\"close_above_ema_slow_len\"]\n    buy_13_protection__sma200_rising            = buy_protection_params[13][\"sma200_rising\"]\n    buy_13_protection__sma200_rising_val        = buy_protection_params[13][\"sma200_rising_val\"]\n    buy_13_protection__sma200_1h_rising         = buy_protection_params[13][\"sma200_1h_rising\"]\n    buy_13_protection__sma200_1h_rising_val     = buy_protection_params[13][\"sma200_1h_rising_val\"]\n    buy_13_protection__safe_dips                = buy_protection_params[13][\"safe_dips\"]\n    buy_13_protection__safe_dips_type           = buy_protection_params[13][\"safe_dips_type\"]\n    buy_13_protection__safe_pump                = buy_protection_params[13][\"safe_pump\"]\n    buy_13_protection__safe_pump_type           = buy_protection_params[13][\"safe_pump_type\"]\n    buy_13_protection__safe_pump_period         = buy_protection_params[13][\"safe_pump_period\"]\n    buy_13_protection__btc_1h_not_downtrend     = buy_protection_params[13][\"btc_1h_not_downtrend\"]\n\n    buy_condition_14_enable = buy_protection_params[14][\"enable\"]\n    buy_14_protection__ema_fast                 = buy_protection_params[14][\"ema_fast\"]\n    buy_14_protection__ema_fast_len             = buy_protection_params[14][\"ema_fast_len\"]\n    buy_14_protection__ema_slow                 = buy_protection_params[14][\"ema_slow\"]\n    buy_14_protection__ema_slow_len             = buy_protection_params[14][\"ema_slow_len\"]\n    buy_14_protection__close_above_ema_fast     = buy_protection_params[14][\"close_above_ema_fast\"]\n    buy_14_protection__close_above_ema_fast_len = buy_protection_params[14][\"close_above_ema_fast_len\"]\n    buy_14_protection__close_above_ema_slow     = buy_protection_params[14][\"close_above_ema_slow\"]\n    buy_14_protection__close_above_ema_slow_len = buy_protection_params[14][\"close_above_ema_slow_len\"]\n    buy_14_protection__sma200_rising            = buy_protection_params[14][\"sma200_rising\"]\n    buy_14_protection__sma200_rising_val        = buy_protection_params[14][\"sma200_rising_val\"]\n    buy_14_protection__sma200_1h_rising         = buy_protection_params[14][\"sma200_1h_rising\"]\n    buy_14_protection__sma200_1h_rising_val     = buy_protection_params[14][\"sma200_1h_rising_val\"]\n    buy_14_protection__safe_dips                = buy_protection_params[14][\"safe_dips\"]\n    buy_14_protection__safe_dips_type           = buy_protection_params[14][\"safe_dips_type\"]\n    buy_14_protection__safe_pump                = buy_protection_params[14][\"safe_pump\"]\n    buy_14_protection__safe_pump_type           = buy_protection_params[14][\"safe_pump_type\"]\n    buy_14_protection__safe_pump_period         = buy_protection_params[14][\"safe_pump_period\"]\n    buy_14_protection__btc_1h_not_downtrend     = buy_protection_params[14][\"btc_1h_not_downtrend\"]\n\n    buy_condition_15_enable = buy_protection_params[15][\"enable\"]\n    buy_15_protection__ema_fast                 = buy_protection_params[15][\"ema_fast\"]\n    buy_15_protection__ema_fast_len             = buy_protection_params[15][\"ema_fast_len\"]\n    buy_15_protection__ema_slow                 = buy_protection_params[15][\"ema_slow\"]\n    buy_15_protection__ema_slow_len             = buy_protection_params[15][\"ema_slow_len\"]\n    buy_15_protection__close_above_ema_fast     = buy_protection_params[15][\"close_above_ema_fast\"]\n    buy_15_protection__close_above_ema_fast_len = buy_protection_params[15][\"close_above_ema_fast_len\"]\n    buy_15_protection__close_above_ema_slow     = buy_protection_params[15][\"close_above_ema_slow\"]\n    buy_15_protection__close_above_ema_slow_len = buy_protection_params[15][\"close_above_ema_slow_len\"]\n    buy_15_protection__sma200_rising            = buy_protection_params[15][\"sma200_rising\"]\n    buy_15_protection__sma200_rising_val        = buy_protection_params[15][\"sma200_rising_val\"]\n    buy_15_protection__sma200_1h_rising         = buy_protection_params[15][\"sma200_1h_rising\"]\n    buy_15_protection__sma200_1h_rising_val     = buy_protection_params[15][\"sma200_1h_rising_val\"]\n    buy_15_protection__safe_dips                = buy_protection_params[15][\"safe_dips\"]\n    buy_15_protection__safe_dips_type           = buy_protection_params[15][\"safe_dips_type\"]\n    buy_15_protection__safe_pump                = buy_protection_params[15][\"safe_pump\"]\n    buy_15_protection__safe_pump_type           = buy_protection_params[15][\"safe_pump_type\"]\n    buy_15_protection__safe_pump_period         = buy_protection_params[15][\"safe_pump_period\"]\n    buy_15_protection__btc_1h_not_downtrend     = buy_protection_params[15][\"btc_1h_not_downtrend\"]\n\n    buy_condition_16_enable = buy_protection_params[16][\"enable\"]\n    buy_16_protection__ema_fast                 = buy_protection_params[16][\"ema_fast\"]\n    buy_16_protection__ema_fast_len             = buy_protection_params[16][\"ema_fast_len\"]\n    buy_16_protection__ema_slow                 = buy_protection_params[16][\"ema_slow\"]\n    buy_16_protection__ema_slow_len             = buy_protection_params[16][\"ema_slow_len\"]\n    buy_16_protection__close_above_ema_fast     = buy_protection_params[16][\"close_above_ema_fast\"]\n    buy_16_protection__close_above_ema_fast_len = buy_protection_params[16][\"close_above_ema_fast_len\"]\n    buy_16_protection__close_above_ema_slow     = buy_protection_params[16][\"close_above_ema_slow\"]\n    buy_16_protection__close_above_ema_slow_len = buy_protection_params[16][\"close_above_ema_slow_len\"]\n    buy_16_protection__sma200_rising            = buy_protection_params[16][\"sma200_rising\"]\n    buy_16_protection__sma200_rising_val        = buy_protection_params[16][\"sma200_rising_val\"]\n    buy_16_protection__sma200_1h_rising         = buy_protection_params[16][\"sma200_1h_rising\"]\n    buy_16_protection__sma200_1h_rising_val     = buy_protection_params[16][\"sma200_1h_rising_val\"]\n    buy_16_protection__safe_dips                = buy_protection_params[16][\"safe_dips\"]\n    buy_16_protection__safe_dips_type           = buy_protection_params[16][\"safe_dips_type\"]\n    buy_16_protection__safe_pump                = buy_protection_params[16][\"safe_pump\"]\n    buy_16_protection__safe_pump_type           = buy_protection_params[16][\"safe_pump_type\"]\n    buy_16_protection__safe_pump_period         = buy_protection_params[16][\"safe_pump_period\"]\n    buy_16_protection__btc_1h_not_downtrend     = buy_protection_params[16][\"btc_1h_not_downtrend\"]\n\n    buy_condition_17_enable = buy_protection_params[17][\"enable\"]\n    buy_17_protection__ema_fast                 = buy_protection_params[17][\"ema_fast\"]\n    buy_17_protection__ema_fast_len             = buy_protection_params[17][\"ema_fast_len\"]\n    buy_17_protection__ema_slow                 = buy_protection_params[17][\"ema_slow\"]\n    buy_17_protection__ema_slow_len             = buy_protection_params[17][\"ema_slow_len\"]\n    buy_17_protection__close_above_ema_fast     = buy_protection_params[17][\"close_above_ema_fast\"]\n    buy_17_protection__close_above_ema_fast_len = buy_protection_params[17][\"close_above_ema_fast_len\"]\n    buy_17_protection__close_above_ema_slow     = buy_protection_params[17][\"close_above_ema_slow\"]\n    buy_17_protection__close_above_ema_slow_len = buy_protection_params[17][\"close_above_ema_slow_len\"]\n    buy_17_protection__sma200_rising            = buy_protection_params[17][\"sma200_rising\"]\n    buy_17_protection__sma200_rising_val        = buy_protection_params[17][\"sma200_rising_val\"]\n    buy_17_protection__sma200_1h_rising         = buy_protection_params[17][\"sma200_1h_rising\"]\n    buy_17_protection__sma200_1h_rising_val     = buy_protection_params[17][\"sma200_1h_rising_val\"]\n    buy_17_protection__safe_dips                = buy_protection_params[17][\"safe_dips\"]\n    buy_17_protection__safe_dips_type           = buy_protection_params[17][\"safe_dips_type\"]\n    buy_17_protection__safe_pump                = buy_protection_params[17][\"safe_pump\"]\n    buy_17_protection__safe_pump_type           = buy_protection_params[17][\"safe_pump_type\"]\n    buy_17_protection__safe_pump_period         = buy_protection_params[17][\"safe_pump_period\"]\n    buy_17_protection__btc_1h_not_downtrend     = buy_protection_params[17][\"btc_1h_not_downtrend\"]\n\n    buy_condition_18_enable = buy_protection_params[18][\"enable\"]\n    buy_18_protection__ema_fast                 = buy_protection_params[18][\"ema_fast\"]\n    buy_18_protection__ema_fast_len             = buy_protection_params[18][\"ema_fast_len\"]\n    buy_18_protection__ema_slow                 = buy_protection_params[18][\"ema_slow\"]\n    buy_18_protection__ema_slow_len             = buy_protection_params[18][\"ema_slow_len\"]\n    buy_18_protection__close_above_ema_fast     = buy_protection_params[18][\"close_above_ema_fast\"]\n    buy_18_protection__close_above_ema_fast_len = buy_protection_params[18][\"close_above_ema_fast_len\"]\n    buy_18_protection__close_above_ema_slow     = buy_protection_params[18][\"close_above_ema_slow\"]\n    buy_18_protection__close_above_ema_slow_len = buy_protection_params[18][\"close_above_ema_slow_len\"]\n    buy_18_protection__sma200_rising            = buy_protection_params[18][\"sma200_rising\"]\n    buy_18_protection__sma200_rising_val        = buy_protection_params[18][\"sma200_rising_val\"]\n    buy_18_protection__sma200_1h_rising         = buy_protection_params[18][\"sma200_1h_rising\"]\n    buy_18_protection__sma200_1h_rising_val     = buy_protection_params[18][\"sma200_1h_rising_val\"]\n    buy_18_protection__safe_dips                = buy_protection_params[18][\"safe_dips\"]\n    buy_18_protection__safe_dips_type           = buy_protection_params[18][\"safe_dips_type\"]\n    buy_18_protection__safe_pump                = buy_protection_params[18][\"safe_pump\"]\n    buy_18_protection__safe_pump_type           = buy_protection_params[18][\"safe_pump_type\"]\n    buy_18_protection__safe_pump_period         = buy_protection_params[18][\"safe_pump_period\"]\n    buy_18_protection__btc_1h_not_downtrend     = buy_protection_params[18][\"btc_1h_not_downtrend\"]\n\n    buy_condition_19_enable = buy_protection_params[19][\"enable\"]\n    buy_19_protection__ema_fast                 = buy_protection_params[19][\"ema_fast\"]\n    buy_19_protection__ema_fast_len             = buy_protection_params[19][\"ema_fast_len\"]\n    buy_19_protection__ema_slow                 = buy_protection_params[19][\"ema_slow\"]\n    buy_19_protection__ema_slow_len             = buy_protection_params[19][\"ema_slow_len\"]\n    buy_19_protection__close_above_ema_fast     = buy_protection_params[19][\"close_above_ema_fast\"]\n    buy_19_protection__close_above_ema_fast_len = buy_protection_params[19][\"close_above_ema_fast_len\"]\n    buy_19_protection__close_above_ema_slow     = buy_protection_params[19][\"close_above_ema_slow\"]\n    buy_19_protection__close_above_ema_slow_len = buy_protection_params[19][\"close_above_ema_slow_len\"]\n    buy_19_protection__sma200_rising            = buy_protection_params[19][\"sma200_rising\"]\n    buy_19_protection__sma200_rising_val        = buy_protection_params[19][\"sma200_rising_val\"]\n    buy_19_protection__sma200_1h_rising         = buy_protection_params[19][\"sma200_1h_rising\"]\n    buy_19_protection__sma200_1h_rising_val     = buy_protection_params[19][\"sma200_1h_rising_val\"]\n    buy_19_protection__safe_dips                = buy_protection_params[19][\"safe_dips\"]\n    buy_19_protection__safe_dips_type           = buy_protection_params[19][\"safe_dips_type\"]\n    buy_19_protection__safe_pump                = buy_protection_params[19][\"safe_pump\"]\n    buy_19_protection__safe_pump_type           = buy_protection_params[19][\"safe_pump_type\"]\n    buy_19_protection__safe_pump_period         = buy_protection_params[19][\"safe_pump_period\"]\n    buy_19_protection__btc_1h_not_downtrend     = buy_protection_params[19][\"btc_1h_not_downtrend\"]\n\n    buy_condition_20_enable = buy_protection_params[20][\"enable\"]\n    buy_20_protection__ema_fast                 = buy_protection_params[20][\"ema_fast\"]\n    buy_20_protection__ema_fast_len             = buy_protection_params[20][\"ema_fast_len\"]\n    buy_20_protection__ema_slow                 = buy_protection_params[20][\"ema_slow\"]\n    buy_20_protection__ema_slow_len             = buy_protection_params[20][\"ema_slow_len\"]\n    buy_20_protection__close_above_ema_fast     = buy_protection_params[20][\"close_above_ema_fast\"]\n    buy_20_protection__close_above_ema_fast_len = buy_protection_params[20][\"close_above_ema_fast_len\"]\n    buy_20_protection__close_above_ema_slow     = buy_protection_params[20][\"close_above_ema_slow\"]\n    buy_20_protection__close_above_ema_slow_len = buy_protection_params[20][\"close_above_ema_slow_len\"]\n    buy_20_protection__sma200_rising            = buy_protection_params[20][\"sma200_rising\"]\n    buy_20_protection__sma200_rising_val        = buy_protection_params[20][\"sma200_rising_val\"]\n    buy_20_protection__sma200_1h_rising         = buy_protection_params[20][\"sma200_1h_rising\"]\n    buy_20_protection__sma200_1h_rising_val     = buy_protection_params[20][\"sma200_1h_rising_val\"]\n    buy_20_protection__safe_dips                = buy_protection_params[20][\"safe_dips\"]\n    buy_20_protection__safe_dips_type           = buy_protection_params[20][\"safe_dips_type\"]\n    buy_20_protection__safe_pump                = buy_protection_params[20][\"safe_pump\"]\n    buy_20_protection__safe_pump_type           = buy_protection_params[20][\"safe_pump_type\"]\n    buy_20_protection__safe_pump_period         = buy_protection_params[20][\"safe_pump_period\"]\n    buy_20_protection__btc_1h_not_downtrend     = buy_protection_params[20][\"btc_1h_not_downtrend\"]\n\n    buy_condition_21_enable = buy_protection_params[21][\"enable\"]\n    buy_21_protection__ema_fast                 = buy_protection_params[21][\"ema_fast\"]\n    buy_21_protection__ema_fast_len             = buy_protection_params[21][\"ema_fast_len\"]\n    buy_21_protection__ema_slow                 = buy_protection_params[21][\"ema_slow\"]\n    buy_21_protection__ema_slow_len             = buy_protection_params[21][\"ema_slow_len\"]\n    buy_21_protection__close_above_ema_fast     = buy_protection_params[21][\"close_above_ema_fast\"]\n    buy_21_protection__close_above_ema_fast_len = buy_protection_params[21][\"close_above_ema_fast_len\"]\n    buy_21_protection__close_above_ema_slow     = buy_protection_params[21][\"close_above_ema_slow\"]\n    buy_21_protection__close_above_ema_slow_len = buy_protection_params[21][\"close_above_ema_slow_len\"]\n    buy_21_protection__sma200_rising            = buy_protection_params[21][\"sma200_rising\"]\n    buy_21_protection__sma200_rising_val        = buy_protection_params[21][\"sma200_rising_val\"]\n    buy_21_protection__sma200_1h_rising         = buy_protection_params[21][\"sma200_1h_rising\"]\n    buy_21_protection__sma200_1h_rising_val     = buy_protection_params[21][\"sma200_1h_rising_val\"]\n    buy_21_protection__safe_dips                = buy_protection_params[21][\"safe_dips\"]\n    buy_21_protection__safe_dips_type           = buy_protection_params[21][\"safe_dips_type\"]\n    buy_21_protection__safe_pump                = buy_protection_params[21][\"safe_pump\"]\n    buy_21_protection__safe_pump_type           = buy_protection_params[21][\"safe_pump_type\"]\n    buy_21_protection__safe_pump_period         = buy_protection_params[21][\"safe_pump_period\"]\n    buy_21_protection__btc_1h_not_downtrend     = buy_protection_params[21][\"btc_1h_not_downtrend\"]\n\n    buy_condition_22_enable = buy_protection_params[22][\"enable\"]\n    buy_22_protection__ema_fast                 = buy_protection_params[22][\"ema_fast\"]\n    buy_22_protection__ema_fast_len             = buy_protection_params[22][\"ema_fast_len\"]\n    buy_22_protection__ema_slow                 = buy_protection_params[22][\"ema_slow\"]\n    buy_22_protection__ema_slow_len             = buy_protection_params[22][\"ema_slow_len\"]\n    buy_22_protection__close_above_ema_fast     = buy_protection_params[22][\"close_above_ema_fast\"]\n    buy_22_protection__close_above_ema_fast_len = buy_protection_params[22][\"close_above_ema_fast_len\"]\n    buy_22_protection__close_above_ema_slow     = buy_protection_params[22][\"close_above_ema_slow\"]\n    buy_22_protection__close_above_ema_slow_len = buy_protection_params[22][\"close_above_ema_slow_len\"]\n    buy_22_protection__sma200_rising            = buy_protection_params[22][\"sma200_rising\"]\n    buy_22_protection__sma200_rising_val        = buy_protection_params[22][\"sma200_rising_val\"]\n    buy_22_protection__sma200_1h_rising         = buy_protection_params[22][\"sma200_1h_rising\"]\n    buy_22_protection__sma200_1h_rising_val     = buy_protection_params[22][\"sma200_1h_rising_val\"]\n    buy_22_protection__safe_dips                = buy_protection_params[22][\"safe_dips\"]\n    buy_22_protection__safe_dips_type           = buy_protection_params[22][\"safe_dips_type\"]\n    buy_22_protection__safe_pump                = buy_protection_params[22][\"safe_pump\"]\n    buy_22_protection__safe_pump_type           = buy_protection_params[22][\"safe_pump_type\"]\n    buy_22_protection__safe_pump_period         = buy_protection_params[22][\"safe_pump_period\"]\n    buy_22_protection__btc_1h_not_downtrend     = buy_protection_params[22][\"btc_1h_not_downtrend\"]\n\n    buy_condition_23_enable = buy_protection_params[23][\"enable\"]\n    buy_23_protection__ema_fast                 = buy_protection_params[23][\"ema_fast\"]\n    buy_23_protection__ema_fast_len             = buy_protection_params[23][\"ema_fast_len\"]\n    buy_23_protection__ema_slow                 = buy_protection_params[23][\"ema_slow\"]\n    buy_23_protection__ema_slow_len             = buy_protection_params[23][\"ema_slow_len\"]\n    buy_23_protection__close_above_ema_fast     = buy_protection_params[23][\"close_above_ema_fast\"]\n    buy_23_protection__close_above_ema_fast_len = buy_protection_params[23][\"close_above_ema_fast_len\"]\n    buy_23_protection__close_above_ema_slow     = buy_protection_params[23][\"close_above_ema_slow\"]\n    buy_23_protection__close_above_ema_slow_len = buy_protection_params[23][\"close_above_ema_slow_len\"]\n    buy_23_protection__sma200_rising            = buy_protection_params[23][\"sma200_rising\"]\n    buy_23_protection__sma200_rising_val        = buy_protection_params[23][\"sma200_rising_val\"]\n    buy_23_protection__sma200_1h_rising         = buy_protection_params[23][\"sma200_1h_rising\"]\n    buy_23_protection__sma200_1h_rising_val     = buy_protection_params[23][\"sma200_1h_rising_val\"]\n    buy_23_protection__safe_dips                = buy_protection_params[23][\"safe_dips\"]\n    buy_23_protection__safe_dips_type           = buy_protection_params[23][\"safe_dips_type\"]\n    buy_23_protection__safe_pump                = buy_protection_params[23][\"safe_pump\"]\n    buy_23_protection__safe_pump_type           = buy_protection_params[23][\"safe_pump_type\"]\n    buy_23_protection__safe_pump_period         = buy_protection_params[23][\"safe_pump_period\"]\n    buy_23_protection__btc_1h_not_downtrend     = buy_protection_params[23][\"btc_1h_not_downtrend\"]\n\n    buy_condition_24_enable = buy_protection_params[24][\"enable\"]\n    buy_24_protection__ema_fast                 = buy_protection_params[24][\"ema_fast\"]\n    buy_24_protection__ema_fast_len             = buy_protection_params[24][\"ema_fast_len\"]\n    buy_24_protection__ema_slow                 = buy_protection_params[24][\"ema_slow\"]\n    buy_24_protection__ema_slow_len             = buy_protection_params[24][\"ema_slow_len\"]\n    buy_24_protection__close_above_ema_fast     = buy_protection_params[24][\"close_above_ema_fast\"]\n    buy_24_protection__close_above_ema_fast_len = buy_protection_params[24][\"close_above_ema_fast_len\"]\n    buy_24_protection__close_above_ema_slow     = buy_protection_params[24][\"close_above_ema_slow\"]\n    buy_24_protection__close_above_ema_slow_len = buy_protection_params[24][\"close_above_ema_slow_len\"]\n    buy_24_protection__sma200_rising            = buy_protection_params[24][\"sma200_rising\"]\n    buy_24_protection__sma200_rising_val        = buy_protection_params[24][\"sma200_rising_val\"]\n    buy_24_protection__sma200_1h_rising         = buy_protection_params[24][\"sma200_1h_rising\"]\n    buy_24_protection__sma200_1h_rising_val     = buy_protection_params[24][\"sma200_1h_rising_val\"]\n    buy_24_protection__safe_dips                = buy_protection_params[24][\"safe_dips\"]\n    buy_24_protection__safe_dips_type           = buy_protection_params[24][\"safe_dips_type\"]\n    buy_24_protection__safe_pump                = buy_protection_params[24][\"safe_pump\"]\n    buy_24_protection__safe_pump_type           = buy_protection_params[24][\"safe_pump_type\"]\n    buy_24_protection__safe_pump_period         = buy_protection_params[24][\"safe_pump_period\"]\n    buy_24_protection__btc_1h_not_downtrend     = buy_protection_params[24][\"btc_1h_not_downtrend\"]\n\n    buy_condition_25_enable = buy_protection_params[25][\"enable\"]\n    buy_25_protection__ema_fast                 = buy_protection_params[25][\"ema_fast\"]\n    buy_25_protection__ema_fast_len             = buy_protection_params[25][\"ema_fast_len\"]\n    buy_25_protection__ema_slow                 = buy_protection_params[25][\"ema_slow\"]\n    buy_25_protection__ema_slow_len             = buy_protection_params[25][\"ema_slow_len\"]\n    buy_25_protection__close_above_ema_fast     = buy_protection_params[25][\"close_above_ema_fast\"]\n    buy_25_protection__close_above_ema_fast_len = buy_protection_params[25][\"close_above_ema_fast_len\"]\n    buy_25_protection__close_above_ema_slow     = buy_protection_params[25][\"close_above_ema_slow\"]\n    buy_25_protection__close_above_ema_slow_len = buy_protection_params[25][\"close_above_ema_slow_len\"]\n    buy_25_protection__sma200_rising            = buy_protection_params[25][\"sma200_rising\"]\n    buy_25_protection__sma200_rising_val        = buy_protection_params[25][\"sma200_rising_val\"]\n    buy_25_protection__sma200_1h_rising         = buy_protection_params[25][\"sma200_1h_rising\"]\n    buy_25_protection__sma200_1h_rising_val     = buy_protection_params[25][\"sma200_1h_rising_val\"]\n    buy_25_protection__safe_dips                = buy_protection_params[25][\"safe_dips\"]\n    buy_25_protection__safe_dips_type           = buy_protection_params[25][\"safe_dips_type\"]\n    buy_25_protection__safe_pump                = buy_protection_params[25][\"safe_pump\"]\n    buy_25_protection__safe_pump_type           = buy_protection_params[25][\"safe_pump_type\"]\n    buy_25_protection__safe_pump_period         = buy_protection_params[25][\"safe_pump_period\"]\n    buy_25_protection__btc_1h_not_downtrend     = buy_protection_params[25][\"btc_1h_not_downtrend\"]\n\n    buy_condition_26_enable = buy_protection_params[26][\"enable\"]\n    buy_26_protection__ema_fast                 = buy_protection_params[26][\"ema_fast\"]\n    buy_26_protection__ema_fast_len             = buy_protection_params[26][\"ema_fast_len\"]\n    buy_26_protection__ema_slow                 = buy_protection_params[26][\"ema_slow\"]\n    buy_26_protection__ema_slow_len             = buy_protection_params[26][\"ema_slow_len\"]\n    buy_26_protection__close_above_ema_fast     = buy_protection_params[26][\"close_above_ema_fast\"]\n    buy_26_protection__close_above_ema_fast_len = buy_protection_params[26][\"close_above_ema_fast_len\"]\n    buy_26_protection__close_above_ema_slow     = buy_protection_params[26][\"close_above_ema_slow\"]\n    buy_26_protection__close_above_ema_slow_len = buy_protection_params[26][\"close_above_ema_slow_len\"]\n    buy_26_protection__sma200_rising            = buy_protection_params[26][\"sma200_rising\"]\n    buy_26_protection__sma200_rising_val        = buy_protection_params[26][\"sma200_rising_val\"]\n    buy_26_protection__sma200_1h_rising         = buy_protection_params[26][\"sma200_1h_rising\"]\n    buy_26_protection__sma200_1h_rising_val     = buy_protection_params[26][\"sma200_1h_rising_val\"]\n    buy_26_protection__safe_dips                = buy_protection_params[26][\"safe_dips\"]\n    buy_26_protection__safe_dips_type           = buy_protection_params[26][\"safe_dips_type\"]\n    buy_26_protection__safe_pump                = buy_protection_params[26][\"safe_pump\"]\n    buy_26_protection__safe_pump_type           = buy_protection_params[26][\"safe_pump_type\"]\n    buy_26_protection__safe_pump_period         = buy_protection_params[26][\"safe_pump_period\"]\n    buy_26_protection__btc_1h_not_downtrend     = buy_protection_params[26][\"btc_1h_not_downtrend\"]\n\n    buy_condition_27_enable = buy_protection_params[27][\"enable\"]\n    buy_27_protection__ema_fast                 = buy_protection_params[27][\"ema_fast\"]\n    buy_27_protection__ema_fast_len             = buy_protection_params[27][\"ema_fast_len\"]\n    buy_27_protection__ema_slow                 = buy_protection_params[27][\"ema_slow\"]\n    buy_27_protection__ema_slow_len             = buy_protection_params[27][\"ema_slow_len\"]\n    buy_27_protection__close_above_ema_fast     = buy_protection_params[27][\"close_above_ema_fast\"]\n    buy_27_protection__close_above_ema_fast_len = buy_protection_params[27][\"close_above_ema_fast_len\"]\n    buy_27_protection__close_above_ema_slow     = buy_protection_params[27][\"close_above_ema_slow\"]\n    buy_27_protection__close_above_ema_slow_len = buy_protection_params[27][\"close_above_ema_slow_len\"]\n    buy_27_protection__sma200_rising            = buy_protection_params[27][\"sma200_rising\"]\n    buy_27_protection__sma200_rising_val        = buy_protection_params[27][\"sma200_rising_val\"]\n    buy_27_protection__sma200_1h_rising         = buy_protection_params[27][\"sma200_1h_rising\"]\n    buy_27_protection__sma200_1h_rising_val     = buy_protection_params[27][\"sma200_1h_rising_val\"]\n    buy_27_protection__safe_dips                = buy_protection_params[27][\"safe_dips\"]\n    buy_27_protection__safe_dips_type           = buy_protection_params[27][\"safe_dips_type\"]\n    buy_27_protection__safe_pump                = buy_protection_params[27][\"safe_pump\"]\n    buy_27_protection__safe_pump_type           = buy_protection_params[27][\"safe_pump_type\"]\n    buy_27_protection__safe_pump_period         = buy_protection_params[27][\"safe_pump_period\"]\n    buy_27_protection__btc_1h_not_downtrend     = buy_protection_params[27][\"btc_1h_not_downtrend\"]\n\n    buy_condition_28_enable = buy_protection_params[28][\"enable\"]\n    buy_28_protection__ema_fast                 = buy_protection_params[28][\"ema_fast\"]\n    buy_28_protection__ema_fast_len             = buy_protection_params[28][\"ema_fast_len\"]\n    buy_28_protection__ema_slow                 = buy_protection_params[28][\"ema_slow\"]\n    buy_28_protection__ema_slow_len             = buy_protection_params[28][\"ema_slow_len\"]\n    buy_28_protection__close_above_ema_fast     = buy_protection_params[28][\"close_above_ema_fast\"]\n    buy_28_protection__close_above_ema_fast_len = buy_protection_params[28][\"close_above_ema_fast_len\"]\n    buy_28_protection__close_above_ema_slow     = buy_protection_params[28][\"close_above_ema_slow\"]\n    buy_28_protection__close_above_ema_slow_len = buy_protection_params[28][\"close_above_ema_slow_len\"]\n    buy_28_protection__sma200_rising            = buy_protection_params[28][\"sma200_rising\"]\n    buy_28_protection__sma200_rising_val        = buy_protection_params[28][\"sma200_rising_val\"]\n    buy_28_protection__sma200_1h_rising         = buy_protection_params[28][\"sma200_1h_rising\"]\n    buy_28_protection__sma200_1h_rising_val     = buy_protection_params[28][\"sma200_1h_rising_val\"]\n    buy_28_protection__safe_dips                = buy_protection_params[28][\"safe_dips\"]\n    buy_28_protection__safe_dips_type           = buy_protection_params[28][\"safe_dips_type\"]\n    buy_28_protection__safe_pump                = buy_protection_params[28][\"safe_pump\"]\n    buy_28_protection__safe_pump_type           = buy_protection_params[28][\"safe_pump_type\"]\n    buy_28_protection__safe_pump_period         = buy_protection_params[28][\"safe_pump_period\"]\n    buy_28_protection__btc_1h_not_downtrend     = buy_protection_params[28][\"btc_1h_not_downtrend\"]\n\n    buy_condition_29_enable = buy_protection_params[29][\"enable\"]\n    buy_29_protection__ema_fast                 = buy_protection_params[29][\"ema_fast\"]\n    buy_29_protection__ema_fast_len             = buy_protection_params[29][\"ema_fast_len\"]\n    buy_29_protection__ema_slow                 = buy_protection_params[29][\"ema_slow\"]\n    buy_29_protection__ema_slow_len             = buy_protection_params[29][\"ema_slow_len\"]\n    buy_29_protection__close_above_ema_fast     = buy_protection_params[29][\"close_above_ema_fast\"]\n    buy_29_protection__close_above_ema_fast_len = buy_protection_params[29][\"close_above_ema_fast_len\"]\n    buy_29_protection__close_above_ema_slow     = buy_protection_params[29][\"close_above_ema_slow\"]\n    buy_29_protection__close_above_ema_slow_len = buy_protection_params[29][\"close_above_ema_slow_len\"]\n    buy_29_protection__sma200_rising            = buy_protection_params[29][\"sma200_rising\"]\n    buy_29_protection__sma200_rising_val        = buy_protection_params[29][\"sma200_rising_val\"]\n    buy_29_protection__sma200_1h_rising         = buy_protection_params[29][\"sma200_1h_rising\"]\n    buy_29_protection__sma200_1h_rising_val     = buy_protection_params[29][\"sma200_1h_rising_val\"]\n    buy_29_protection__safe_dips                = buy_protection_params[29][\"safe_dips\"]\n    buy_29_protection__safe_dips_type           = buy_protection_params[29][\"safe_dips_type\"]\n    buy_29_protection__safe_pump                = buy_protection_params[29][\"safe_pump\"]\n    buy_29_protection__safe_pump_type           = buy_protection_params[29][\"safe_pump_type\"]\n    buy_29_protection__safe_pump_period         = buy_protection_params[29][\"safe_pump_period\"]\n    buy_29_protection__btc_1h_not_downtrend     = buy_protection_params[29][\"btc_1h_not_downtrend\"]\n\n    buy_condition_30_enable = buy_protection_params[30][\"enable\"]\n    buy_30_protection__ema_fast                 = buy_protection_params[30][\"ema_fast\"]\n    buy_30_protection__ema_fast_len             = buy_protection_params[30][\"ema_fast_len\"]\n    buy_30_protection__ema_slow                 = buy_protection_params[30][\"ema_slow\"]\n    buy_30_protection__ema_slow_len             = buy_protection_params[30][\"ema_slow_len\"]\n    buy_30_protection__close_above_ema_fast     = buy_protection_params[30][\"close_above_ema_fast\"]\n    buy_30_protection__close_above_ema_fast_len = buy_protection_params[30][\"close_above_ema_fast_len\"]\n    buy_30_protection__close_above_ema_slow     = buy_protection_params[30][\"close_above_ema_slow\"]\n    buy_30_protection__close_above_ema_slow_len = buy_protection_params[30][\"close_above_ema_slow_len\"]\n    buy_30_protection__sma200_rising            = buy_protection_params[30][\"sma200_rising\"]\n    buy_30_protection__sma200_rising_val        = buy_protection_params[30][\"sma200_rising_val\"]\n    buy_30_protection__sma200_1h_rising         = buy_protection_params[30][\"sma200_1h_rising\"]\n    buy_30_protection__sma200_1h_rising_val     = buy_protection_params[30][\"sma200_1h_rising_val\"]\n    buy_30_protection__safe_dips                = buy_protection_params[30][\"safe_dips\"]\n    buy_30_protection__safe_dips_type           = buy_protection_params[30][\"safe_dips_type\"]\n    buy_30_protection__safe_pump                = buy_protection_params[30][\"safe_pump\"]\n    buy_30_protection__safe_pump_type           = buy_protection_params[30][\"safe_pump_type\"]\n    buy_30_protection__safe_pump_period         = buy_protection_params[30][\"safe_pump_period\"]\n    buy_30_protection__btc_1h_not_downtrend     = buy_protection_params[30][\"btc_1h_not_downtrend\"]\n\n    buy_condition_31_enable = buy_protection_params[31][\"enable\"]\n    buy_31_protection__ema_fast                 = buy_protection_params[31][\"ema_fast\"]\n    buy_31_protection__ema_fast_len             = buy_protection_params[31][\"ema_fast_len\"]\n    buy_31_protection__ema_slow                 = buy_protection_params[31][\"ema_slow\"]\n    buy_31_protection__ema_slow_len             = buy_protection_params[31][\"ema_slow_len\"]\n    buy_31_protection__close_above_ema_fast     = buy_protection_params[31][\"close_above_ema_fast\"]\n    buy_31_protection__close_above_ema_fast_len = buy_protection_params[31][\"close_above_ema_fast_len\"]\n    buy_31_protection__close_above_ema_slow     = buy_protection_params[31][\"close_above_ema_slow\"]\n    buy_31_protection__close_above_ema_slow_len = buy_protection_params[31][\"close_above_ema_slow_len\"]\n    buy_31_protection__sma200_rising            = buy_protection_params[31][\"sma200_rising\"]\n    buy_31_protection__sma200_rising_val        = buy_protection_params[31][\"sma200_rising_val\"]\n    buy_31_protection__sma200_1h_rising         = buy_protection_params[31][\"sma200_1h_rising\"]\n    buy_31_protection__sma200_1h_rising_val     = buy_protection_params[31][\"sma200_1h_rising_val\"]\n    buy_31_protection__safe_dips                = buy_protection_params[31][\"safe_dips\"]\n    buy_31_protection__safe_dips_type           = buy_protection_params[31][\"safe_dips_type\"]\n    buy_31_protection__safe_pump                = buy_protection_params[31][\"safe_pump\"]\n    buy_31_protection__safe_pump_type           = buy_protection_params[31][\"safe_pump_type\"]\n    buy_31_protection__safe_pump_period         = buy_protection_params[31][\"safe_pump_period\"]\n    buy_31_protection__btc_1h_not_downtrend     = buy_protection_params[31][\"btc_1h_not_downtrend\"]\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=44.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=2.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=26.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.941, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_14 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(95, 99, default=95.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=97.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = hold_trade_ids_profit_ratio = None\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None and self.hold_trade_ids_profit_ratio is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = set()\n        self.hold_trade_ids_profit_ratio = 0.005\n\n        # Update values from config file, if it exists\n        strat_directory = pathlib.Path(__file__).resolve().parent\n        hold_trades_config_file = strat_directory / \"hold-trades.json\"\n        if not hold_trades_config_file.is_file():\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                    else:\n                        self.hold_trade_ids_profit_ratio = profit_ratio\n                open_trades = {\n                    trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n                }\n                formatted_profit_ratio = \"{}%\".format(self.hold_trade_ids_profit_ratio * 100)\n                for trade_id in hold_trades_config.get(\"trade_ids\", ()):\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids.add(trade_id)\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if current_profit > self.sell_custom_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_11.value:\n                    return True, 'signal_profit_11'\n            elif self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_10.value:\n                    return True, 'signal_profit_10'\n            elif self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_9.value:\n                    return True, 'signal_profit_9'\n            elif self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_8.value:\n                    return True, 'signal_profit_8'\n            elif self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_7'\n            elif self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_6'\n            elif self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_5'\n            elif self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_4'\n            elif self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_3'\n            elif self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_2'\n            elif self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_1'\n            elif self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_0'\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if current_profit > self.sell_custom_under_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_11.value:\n                    return True, 'signal_profit_u_11'\n            elif self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_10.value:\n                    return True, 'signal_profit_u_10'\n            elif self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_9.value:\n                    return True, 'signal_profit_u_9'\n            elif self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_8.value:\n                    return True, 'signal_profit_u_8'\n            elif self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_7.value:\n                    return True, 'signal_profit_u_7'\n            elif self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_6.value:\n                    return True, 'signal_profit_u_6'\n            elif self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_5.value:\n                    return True, 'signal_profit_u_5'\n            elif self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_4.value:\n                    return True, 'signal_profit_u_4'\n            elif self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_3.value:\n                    return True, 'signal_profit_u_3'\n            elif self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_2.value:\n                    return True, 'signal_profit_u_2'\n            elif self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_1.value:\n                    return True, 'signal_profit_u_1'\n            elif self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_u_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n            return True, 'signal_profit_u_t_1'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) & (0.2 > current_profit > 0.07) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n            return True, 'signal_profit_u_e_1'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime', max_loss: float, max_profit: float) -> tuple:\n        if (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < -0.2) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_stoploss_u_1'\n\n        # Under EMA200, pair & BTC negative, low max rate\n        elif (-0.03 > current_profit > -0.07) & (last_candle['btc_not_downtrend_1h'] is False) & (max_profit < 0.005) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_stoploss_u_b_1'\n\n        elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_1'\n\n        elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n            return True, 'signal_stoploss_p_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n            return True, 'signal_stoploss_p_3'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit > 0.02:\n            if last_candle['r_480'] > -2.1:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit > 0.03:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit > 0.04:\n            if last_candle['r_480'] > -2.3:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit > 0.05:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit > 0.06:\n            if last_candle['r_480'] > -2.5: ###\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit > 0.07:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit > 0.08:\n            if last_candle['r_480'] > -5.5:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit > 0.09:\n            if last_candle['r_480'] > -3.0:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit > 0.1:\n            if last_candle['r_480'] > -8.0:\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -1.5) & (last_candle['rsi'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -2.1) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -2.3) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit > 0.05:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit > 0.06:\n            if (last_candle['r_480'] > -2.5) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit > 0.07:\n            if (last_candle['r_480'] > -34.0) & (last_candle['rsi'] > 80.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit > 0.08:\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit > 0.09:\n            if (last_candle['r_480'] > -2.8) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 81.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 81.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -29.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -30.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle_1 = dataframe.iloc[-2].squeeze()\n        previous_candle_2 = dataframe.iloc[-3].squeeze()\n        previous_candle_3 = dataframe.iloc[-4].squeeze()\n        previous_candle_4 = dataframe.iloc[-5].squeeze()\n        previous_candle_5 = dataframe.iloc[-6].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None) & (previous_candle_1 is not None) & (previous_candle_2 is not None) & (previous_candle_3 is not None) & (previous_candle_4 is not None) & (previous_candle_5 is not None):\n            # Over EMA200, main profit targets\n            sell, signal_name = self.sell_over_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Under EMA200, main profit targets\n            sell, signal_name = self.sell_under_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # The pair is pumped\n            sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # The pair is descending\n            sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Trailing\n            sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Duration based\n            sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Under EMA200, exit with any profit\n            sell, signal_name = self.sell_under_min(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Stoplosses\n            sell, signal_name = self.sell_stoploss(current_profit, last_candle, trade, current_time, max_loss, max_profit)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Pumped descending pairs\n            sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Extra sells for pumped pairs\n            sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Extra sells for trades that recovered\n            sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 1\n            sell, signal_name = self.sell_r_1(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 2\n            sell, signal_name = self.sell_r_2(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Williams %R based sell 3\n            sell, signal_name = self.sell_r_3(current_profit, last_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n            # Sell signal 1\n            if self.sell_condition_1_enable.value & (last_candle['rsi'] > self.sell_rsi_bb_1.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) & (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) & (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) & (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n                return 'sell_signal_1'\n\n            # Sell signal 2\n            elif self.sell_condition_2_enable.value & (last_candle['rsi'] > self.sell_rsi_bb_2.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n                return 'sell_signal_2'\n\n            # Sell signal 3\n            # elif (self.sell_condition_3_enable.value) & (last_candle['rsi'] > self.sell_rsi_main_3.value):\n            #     return 'sell_signal_3'\n\n            # Sell signal 4\n            elif self.sell_condition_4_enable.value & (last_candle['rsi'] > self.sell_dual_rsi_rsi_4.value) & (last_candle['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n                return 'sell_signal_4'\n\n            # Sell signal 6\n            elif self.sell_condition_6_enable.value & (last_candle['close'] < last_candle['ema_200']) & (last_candle['close'] > last_candle['ema_50']) & (last_candle['rsi'] > self.sell_rsi_under_6.value):\n                return 'sell_signal_6'\n\n            # Sell signal 7\n            elif self.sell_condition_7_enable.value & (last_candle['rsi_1h'] > self.sell_rsi_1h_7.value) & (last_candle['crossed_below_ema_12_26']):\n                return 'sell_signal_7'\n\n            # Sell signal 8\n            elif self.sell_condition_8_enable.value & (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n                return 'sell_signal_8'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return (df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min()\n        elif method == 'OC':\n            return (df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return (df['open'] - df['close']) / df['close']\n        else:\n            return (df['open'].rolling(length).max() - df['close']) / df['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['open'].rolling(length).max() - df['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['close'] - df['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n\n        # TSI\n        dataframe['tsi_slow'] = tsi(dataframe, window_slow=20, window_fast=5)\n        dataframe['tsi_ema_slow'] = ta.EMA(dataframe['tsi_slow'], timeperiod=5)\n\n        dataframe['tsi_fast'] = tsi(dataframe, window_slow=4, window_fast=2)\n        dataframe['tsi_ema_fast'] = ta.EMA(dataframe['tsi_fast'], timeperiod=2)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        buy_protection_list = []\n\n        # Protections [STANDARD] - Common to every condition\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n            if global_buy_protection_params[\"ema_fast\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len'].value}\"] > dataframe['ema_200'])\n            if global_buy_protection_params[\"ema_slow\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len'].value}_1h\"] > dataframe['ema_200_1h'])\n            if global_buy_protection_params[\"close_above_ema_fast\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len'].value}\"])\n            if global_buy_protection_params[\"close_above_ema_slow\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len'].value}_1h\"])\n            if global_buy_protection_params[\"sma200_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'].value)))\n            if global_buy_protection_params[\"sma200_1h_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'].value)))\n            if global_buy_protection_params[\"safe_dips\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type'].value}\"])\n            if global_buy_protection_params[\"safe_pump\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period'].value}_{global_buy_protection_params['safe_pump_type'].value}_1h\"])\n            if global_buy_protection_params['btc_1h_not_downtrend'].value:\n                item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n            buy_protection_list.append(item_buy_protection_list)\n\n        # Buy Condition #1\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_1_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[0]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #2\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_2_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[1]))\n            item_buy_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #3\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_3_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[2].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[2]))\n            item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n            item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n            item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n            item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n            item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n            item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #4\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_4_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[3]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n            item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #5\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_5_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[4].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[4]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #6\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_6_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[5]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #7\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_7_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[6]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #8\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_8_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[7]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n            item_buy_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n            item_buy_logic.append(dataframe['close'] > dataframe['open'])\n            item_buy_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #9\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_9_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[8].append(dataframe['ema_50'] > dataframe['ema_200'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[8]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #10\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_10_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[9].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[9]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #11\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_11_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[10].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n            buy_protection_list[10].append(dataframe['safe_pump_36_50_1h'])\n            buy_protection_list[10].append(dataframe['safe_pump_48_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[10]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #12\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_12_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[11]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #13\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_13_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[12].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n            # buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[12]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #14\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_14_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[13]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #15\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_15_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[14].append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[14]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #16\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_16_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[15]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #17\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_17_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[16]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #18\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_18_enable']:\n            # Non-Standard protections (add below)\n            # buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n            buy_protection_list[17].append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n            buy_protection_list[17].append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[17]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #19\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_19_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[18].append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[18]))\n            item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n            item_buy_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #20\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_20_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[19]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #21\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_21_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[20]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #22\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_22_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[21].append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n            buy_protection_list[21].append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[21]))\n            item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #23\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_23_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[22]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #24\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_24_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[23]))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n            item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n            item_buy_logic.append(dataframe['cmf_1h'] > 0)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #25\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_25_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[24]))\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_14.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(\n                (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n            )\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #26\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_26_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[25]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #27\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_27_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[26]))\n            item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n            item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] + dataframe['rsi'] < self.buy_27_rsi_max.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #28\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_28_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[27]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * 0.92)\n            item_buy_logic.append(dataframe['ewo'] > 12.4)\n            item_buy_logic.append(dataframe['rsi'] < 38.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #29\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_29_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[28]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * 0.9)\n            item_buy_logic.append(dataframe['ewo'] < -4.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #30\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_30_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[29]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * 0.97)\n            item_buy_logic.append(dataframe['ewo'] > 9.0)\n            item_buy_logic.append(dataframe['rsi'] < 42.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        # Buy Condition #31\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_31_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[30]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * 0.94)\n            item_buy_logic.append(dataframe['ewo'] < -19.0)\n            item_buy_logic.append(dataframe['r_480'] < -99.0)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            conditions.append(reduce(lambda x, y: x & y, item_buy_logic))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:,\"sell\"] = 0\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trade_ids:\n            # We have no pairs we want to hold until profit, sell\n            return True\n        if trade.id not in self.hold_trade_ids:\n            # This pair is not on the list to hold until profit, sell\n            return True\n        if trade.calc_profit_ratio(rate) >= self.hold_trade_ids_profit_ratio:\n            # This pair is on the list to hold, and we reached minimum profit, sell\n            return True\n        # This pair is on the list to hold, and we haven't reached minimum profit, hold\n        return False\n\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\ndef tsi(dataframe: DataFrame, window_slow: int, window_fast: int, fillna=False) -> Series:\n    \"\"\"\n    Indicator: True Strength Index (TSI)\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param window_slow: slow smoothing period\n    :param window_fast: fast smoothing period\n    :param fillna: If True fill NaN values\n    \"\"\"\n    df = dataframe.copy()\n\n    min_periods_slow = 0 if fillna else window_slow\n    min_periods_fast = 0 if fillna else window_fast\n\n    close_diff            = df['close'].diff()\n    close_diff_abs        = close_diff.abs()\n    smooth_close_diff     = close_diff.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n    smooth_close_diff_abs = close_diff_abs.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n\n    tsi = smooth_close_diff / smooth_close_diff_abs * 100\n\n    if fillna:\n        tsi = tsi.replace([np.inf, -np.inf], np.nan).fillna(0)\n\n    return tsi\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )"
  },
  {
    "path": "strategies/NostalgiaForInfinityNext/NostalgiaForInfinityNext.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinity by iterativ    V7.3.1 BUSD                                        ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNext(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 7\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        2: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        3: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        4: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        5: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"130\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        6: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        7: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        8: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        9: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        10: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        11: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        12: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        13: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        14: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        15: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"130\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        16: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        17: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        18: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        19: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        20: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        21: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        22: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        23: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        24: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        25: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        26: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        27: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        28: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n        },\n        29: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        30: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        31: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        32: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        33: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        34: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        34: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        35: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        36: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        37: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        },\n        38: {\n            \"enable\"                    : CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True),\n            \"ema_fast\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_fast_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"ema_slow\"                  : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"ema_slow_len\"              : CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"close_above_ema_fast\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_fast_len\"  : CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"close_above_ema_slow\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"close_above_ema_slow_len\"  : CategoricalParameter([\"15\",\"50\",\"200\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"sma200_rising\"             : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_rising_val\"         : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True),\n            \"sma200_1h_rising\"          : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"sma200_1h_rising_val\"      : CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True),\n            \"safe_dips\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_dips_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True),\n            \"safe_pump\"                 : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True),\n            \"safe_pump_type\"            : CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True),\n            \"safe_pump_period\"          : CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True),\n            \"btc_1h_not_downtrend\"      : CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n        }\n    }\n\n    buy_condition_1_enable = buy_protection_params[1][\"enable\"]\n    buy_1_protection__ema_fast                 = buy_protection_params[1][\"ema_fast\"]\n    buy_1_protection__ema_fast_len             = buy_protection_params[1][\"ema_fast_len\"]\n    buy_1_protection__ema_slow                 = buy_protection_params[1][\"ema_slow\"]\n    buy_1_protection__ema_slow_len             = buy_protection_params[1][\"ema_slow_len\"]\n    buy_1_protection__close_above_ema_fast     = buy_protection_params[1][\"close_above_ema_fast\"]\n    buy_1_protection__close_above_ema_fast_len = buy_protection_params[1][\"close_above_ema_fast_len\"]\n    buy_1_protection__close_above_ema_slow     = buy_protection_params[1][\"close_above_ema_slow\"]\n    buy_1_protection__close_above_ema_slow_len = buy_protection_params[1][\"close_above_ema_slow_len\"]\n    buy_1_protection__sma200_rising            = buy_protection_params[1][\"sma200_rising\"]\n    buy_1_protection__sma200_rising_val        = buy_protection_params[1][\"sma200_rising_val\"]\n    buy_1_protection__sma200_1h_rising         = buy_protection_params[1][\"sma200_1h_rising\"]\n    buy_1_protection__sma200_1h_rising_val     = buy_protection_params[1][\"sma200_1h_rising_val\"]\n    buy_1_protection__safe_dips                = buy_protection_params[1][\"safe_dips\"]\n    buy_1_protection__safe_dips_type           = buy_protection_params[1][\"safe_dips_type\"]\n    buy_1_protection__safe_pump                = buy_protection_params[1][\"safe_pump\"]\n    buy_1_protection__safe_pump_type           = buy_protection_params[1][\"safe_pump_type\"]\n    buy_1_protection__safe_pump_period         = buy_protection_params[1][\"safe_pump_period\"]\n    buy_1_protection__btc_1h_not_downtrend     = buy_protection_params[1][\"btc_1h_not_downtrend\"]\n\n    buy_condition_2_enable = buy_protection_params[2][\"enable\"]\n    buy_2_protection__ema_fast                 = buy_protection_params[2][\"ema_fast\"]\n    buy_2_protection__ema_fast_len             = buy_protection_params[2][\"ema_fast_len\"]\n    buy_2_protection__ema_slow                 = buy_protection_params[2][\"ema_slow\"]\n    buy_2_protection__ema_slow_len             = buy_protection_params[2][\"ema_slow_len\"]\n    buy_2_protection__close_above_ema_fast     = buy_protection_params[2][\"close_above_ema_fast\"]\n    buy_2_protection__close_above_ema_fast_len = buy_protection_params[2][\"close_above_ema_fast_len\"]\n    buy_2_protection__close_above_ema_slow     = buy_protection_params[2][\"close_above_ema_slow\"]\n    buy_2_protection__close_above_ema_slow_len = buy_protection_params[2][\"close_above_ema_slow_len\"]\n    buy_2_protection__sma200_rising            = buy_protection_params[2][\"sma200_rising\"]\n    buy_2_protection__sma200_rising_val        = buy_protection_params[2][\"sma200_rising_val\"]\n    buy_2_protection__sma200_1h_rising         = buy_protection_params[2][\"sma200_1h_rising\"]\n    buy_2_protection__sma200_1h_rising_val     = buy_protection_params[2][\"sma200_1h_rising_val\"]\n    buy_2_protection__safe_dips                = buy_protection_params[2][\"safe_dips\"]\n    buy_2_protection__safe_dips_type           = buy_protection_params[2][\"safe_dips_type\"]\n    buy_2_protection__safe_pump                = buy_protection_params[2][\"safe_pump\"]\n    buy_2_protection__safe_pump_type           = buy_protection_params[2][\"safe_pump_type\"]\n    buy_2_protection__safe_pump_period         = buy_protection_params[2][\"safe_pump_period\"]\n    buy_2_protection__btc_1h_not_downtrend     = buy_protection_params[2][\"btc_1h_not_downtrend\"]\n\n    buy_condition_3_enable = buy_protection_params[3][\"enable\"]\n    buy_3_protection__ema_fast                 = buy_protection_params[3][\"ema_fast\"]\n    buy_3_protection__ema_fast_len             = buy_protection_params[3][\"ema_fast_len\"]\n    buy_3_protection__ema_slow                 = buy_protection_params[3][\"ema_slow\"]\n    buy_3_protection__ema_slow_len             = buy_protection_params[3][\"ema_slow_len\"]\n    buy_3_protection__close_above_ema_fast     = buy_protection_params[3][\"close_above_ema_fast\"]\n    buy_3_protection__close_above_ema_fast_len = buy_protection_params[3][\"close_above_ema_fast_len\"]\n    buy_3_protection__close_above_ema_slow     = buy_protection_params[3][\"close_above_ema_slow\"]\n    buy_3_protection__close_above_ema_slow_len = buy_protection_params[3][\"close_above_ema_slow_len\"]\n    buy_3_protection__sma200_rising            = buy_protection_params[3][\"sma200_rising\"]\n    buy_3_protection__sma200_rising_val        = buy_protection_params[3][\"sma200_rising_val\"]\n    buy_3_protection__sma200_1h_rising         = buy_protection_params[3][\"sma200_1h_rising\"]\n    buy_3_protection__sma200_1h_rising_val     = buy_protection_params[3][\"sma200_1h_rising_val\"]\n    buy_3_protection__safe_dips                = buy_protection_params[3][\"safe_dips\"]\n    buy_3_protection__safe_dips_type           = buy_protection_params[3][\"safe_dips_type\"]\n    buy_3_protection__safe_pump                = buy_protection_params[3][\"safe_pump\"]\n    buy_3_protection__safe_pump_type           = buy_protection_params[3][\"safe_pump_type\"]\n    buy_3_protection__safe_pump_period         = buy_protection_params[3][\"safe_pump_period\"]\n    buy_3_protection__btc_1h_not_downtrend     = buy_protection_params[3][\"btc_1h_not_downtrend\"]\n\n    buy_condition_4_enable = buy_protection_params[4][\"enable\"]\n    buy_4_protection__ema_fast                 = buy_protection_params[4][\"ema_fast\"]\n    buy_4_protection__ema_fast_len             = buy_protection_params[4][\"ema_fast_len\"]\n    buy_4_protection__ema_slow                 = buy_protection_params[4][\"ema_slow\"]\n    buy_4_protection__ema_slow_len             = buy_protection_params[4][\"ema_slow_len\"]\n    buy_4_protection__close_above_ema_fast     = buy_protection_params[4][\"close_above_ema_fast\"]\n    buy_4_protection__close_above_ema_fast_len = buy_protection_params[4][\"close_above_ema_fast_len\"]\n    buy_4_protection__close_above_ema_slow     = buy_protection_params[4][\"close_above_ema_slow\"]\n    buy_4_protection__close_above_ema_slow_len = buy_protection_params[4][\"close_above_ema_slow_len\"]\n    buy_4_protection__sma200_rising            = buy_protection_params[4][\"sma200_rising\"]\n    buy_4_protection__sma200_rising_val        = buy_protection_params[4][\"sma200_rising_val\"]\n    buy_4_protection__sma200_1h_rising         = buy_protection_params[4][\"sma200_1h_rising\"]\n    buy_4_protection__sma200_1h_rising_val     = buy_protection_params[4][\"sma200_1h_rising_val\"]\n    buy_4_protection__safe_dips                = buy_protection_params[4][\"safe_dips\"]\n    buy_4_protection__safe_dips_type           = buy_protection_params[4][\"safe_dips_type\"]\n    buy_4_protection__safe_pump                = buy_protection_params[4][\"safe_pump\"]\n    buy_4_protection__safe_pump_type           = buy_protection_params[4][\"safe_pump_type\"]\n    buy_4_protection__safe_pump_period         = buy_protection_params[4][\"safe_pump_period\"]\n    buy_4_protection__btc_1h_not_downtrend     = buy_protection_params[4][\"btc_1h_not_downtrend\"]\n\n    buy_condition_5_enable = buy_protection_params[5][\"enable\"]\n    buy_5_protection__ema_fast                 = buy_protection_params[5][\"ema_fast\"]\n    buy_5_protection__ema_fast_len             = buy_protection_params[5][\"ema_fast_len\"]\n    buy_5_protection__ema_slow                 = buy_protection_params[5][\"ema_slow\"]\n    buy_5_protection__ema_slow_len             = buy_protection_params[5][\"ema_slow_len\"]\n    buy_5_protection__close_above_ema_fast     = buy_protection_params[5][\"close_above_ema_fast\"]\n    buy_5_protection__close_above_ema_fast_len = buy_protection_params[5][\"close_above_ema_fast_len\"]\n    buy_5_protection__close_above_ema_slow     = buy_protection_params[5][\"close_above_ema_slow\"]\n    buy_5_protection__close_above_ema_slow_len = buy_protection_params[5][\"close_above_ema_slow_len\"]\n    buy_5_protection__sma200_rising            = buy_protection_params[5][\"sma200_rising\"]\n    buy_5_protection__sma200_rising_val        = buy_protection_params[5][\"sma200_rising_val\"]\n    buy_5_protection__sma200_1h_rising         = buy_protection_params[5][\"sma200_1h_rising\"]\n    buy_5_protection__sma200_1h_rising_val     = buy_protection_params[5][\"sma200_1h_rising_val\"]\n    buy_5_protection__safe_dips                = buy_protection_params[5][\"safe_dips\"]\n    buy_5_protection__safe_dips_type           = buy_protection_params[5][\"safe_dips_type\"]\n    buy_5_protection__safe_pump                = buy_protection_params[5][\"safe_pump\"]\n    buy_5_protection__safe_pump_type           = buy_protection_params[5][\"safe_pump_type\"]\n    buy_5_protection__safe_pump_period         = buy_protection_params[5][\"safe_pump_period\"]\n    buy_5_protection__btc_1h_not_downtrend     = buy_protection_params[5][\"btc_1h_not_downtrend\"]\n\n    buy_condition_6_enable = buy_protection_params[6][\"enable\"]\n    buy_6_protection__ema_fast                 = buy_protection_params[6][\"ema_fast\"]\n    buy_6_protection__ema_fast_len             = buy_protection_params[6][\"ema_fast_len\"]\n    buy_6_protection__ema_slow                 = buy_protection_params[6][\"ema_slow\"]\n    buy_6_protection__ema_slow_len             = buy_protection_params[6][\"ema_slow_len\"]\n    buy_6_protection__close_above_ema_fast     = buy_protection_params[6][\"close_above_ema_fast\"]\n    buy_6_protection__close_above_ema_fast_len = buy_protection_params[6][\"close_above_ema_fast_len\"]\n    buy_6_protection__close_above_ema_slow     = buy_protection_params[6][\"close_above_ema_slow\"]\n    buy_6_protection__close_above_ema_slow_len = buy_protection_params[6][\"close_above_ema_slow_len\"]\n    buy_6_protection__sma200_rising            = buy_protection_params[6][\"sma200_rising\"]\n    buy_6_protection__sma200_rising_val        = buy_protection_params[6][\"sma200_rising_val\"]\n    buy_6_protection__sma200_1h_rising         = buy_protection_params[6][\"sma200_1h_rising\"]\n    buy_6_protection__sma200_1h_rising_val     = buy_protection_params[6][\"sma200_1h_rising_val\"]\n    buy_6_protection__safe_dips                = buy_protection_params[6][\"safe_dips\"]\n    buy_6_protection__safe_dips_type           = buy_protection_params[6][\"safe_dips_type\"]\n    buy_6_protection__safe_pump                = buy_protection_params[6][\"safe_pump\"]\n    buy_6_protection__safe_pump_type           = buy_protection_params[6][\"safe_pump_type\"]\n    buy_6_protection__safe_pump_period         = buy_protection_params[6][\"safe_pump_period\"]\n    buy_6_protection__btc_1h_not_downtrend     = buy_protection_params[6][\"btc_1h_not_downtrend\"]\n\n    buy_condition_7_enable = buy_protection_params[7][\"enable\"]\n    buy_7_protection__ema_fast                 = buy_protection_params[7][\"ema_fast\"]\n    buy_7_protection__ema_fast_len             = buy_protection_params[7][\"ema_fast_len\"]\n    buy_7_protection__ema_slow                 = buy_protection_params[7][\"ema_slow\"]\n    buy_7_protection__ema_slow_len             = buy_protection_params[7][\"ema_slow_len\"]\n    buy_7_protection__close_above_ema_fast     = buy_protection_params[7][\"close_above_ema_fast\"]\n    buy_7_protection__close_above_ema_fast_len = buy_protection_params[7][\"close_above_ema_fast_len\"]\n    buy_7_protection__close_above_ema_slow     = buy_protection_params[7][\"close_above_ema_slow\"]\n    buy_7_protection__close_above_ema_slow_len = buy_protection_params[7][\"close_above_ema_slow_len\"]\n    buy_7_protection__sma200_rising            = buy_protection_params[7][\"sma200_rising\"]\n    buy_7_protection__sma200_rising_val        = buy_protection_params[7][\"sma200_rising_val\"]\n    buy_7_protection__sma200_1h_rising         = buy_protection_params[7][\"sma200_1h_rising\"]\n    buy_7_protection__sma200_1h_rising_val     = buy_protection_params[7][\"sma200_1h_rising_val\"]\n    buy_7_protection__safe_dips                = buy_protection_params[7][\"safe_dips\"]\n    buy_7_protection__safe_dips_type           = buy_protection_params[7][\"safe_dips_type\"]\n    buy_7_protection__safe_pump                = buy_protection_params[7][\"safe_pump\"]\n    buy_7_protection__safe_pump_type           = buy_protection_params[7][\"safe_pump_type\"]\n    buy_7_protection__safe_pump_period         = buy_protection_params[7][\"safe_pump_period\"]\n    buy_7_protection__btc_1h_not_downtrend     = buy_protection_params[7][\"btc_1h_not_downtrend\"]\n\n    buy_condition_8_enable = buy_protection_params[8][\"enable\"]\n    buy_8_protection__ema_fast                 = buy_protection_params[8][\"ema_fast\"]\n    buy_8_protection__ema_fast_len             = buy_protection_params[8][\"ema_fast_len\"]\n    buy_8_protection__ema_slow                 = buy_protection_params[8][\"ema_slow\"]\n    buy_8_protection__ema_slow_len             = buy_protection_params[8][\"ema_slow_len\"]\n    buy_8_protection__close_above_ema_fast     = buy_protection_params[8][\"close_above_ema_fast\"]\n    buy_8_protection__close_above_ema_fast_len = buy_protection_params[8][\"close_above_ema_fast_len\"]\n    buy_8_protection__close_above_ema_slow     = buy_protection_params[8][\"close_above_ema_slow\"]\n    buy_8_protection__close_above_ema_slow_len = buy_protection_params[8][\"close_above_ema_slow_len\"]\n    buy_8_protection__sma200_rising            = buy_protection_params[8][\"sma200_rising\"]\n    buy_8_protection__sma200_rising_val        = buy_protection_params[8][\"sma200_rising_val\"]\n    buy_8_protection__sma200_1h_rising         = buy_protection_params[8][\"sma200_1h_rising\"]\n    buy_8_protection__sma200_1h_rising_val     = buy_protection_params[8][\"sma200_1h_rising_val\"]\n    buy_8_protection__safe_dips                = buy_protection_params[8][\"safe_dips\"]\n    buy_8_protection__safe_dips_type           = buy_protection_params[8][\"safe_dips_type\"]\n    buy_8_protection__safe_pump                = buy_protection_params[8][\"safe_pump\"]\n    buy_8_protection__safe_pump_type           = buy_protection_params[8][\"safe_pump_type\"]\n    buy_8_protection__safe_pump_period         = buy_protection_params[8][\"safe_pump_period\"]\n    buy_8_protection__btc_1h_not_downtrend     = buy_protection_params[8][\"btc_1h_not_downtrend\"]\n\n    buy_condition_9_enable = buy_protection_params[9][\"enable\"]\n    buy_9_protection__ema_fast                 = buy_protection_params[9][\"ema_fast\"]\n    buy_9_protection__ema_fast_len             = buy_protection_params[9][\"ema_fast_len\"]\n    buy_9_protection__ema_slow                 = buy_protection_params[9][\"ema_slow\"]\n    buy_9_protection__ema_slow_len             = buy_protection_params[9][\"ema_slow_len\"]\n    buy_9_protection__close_above_ema_fast     = buy_protection_params[9][\"close_above_ema_fast\"]\n    buy_9_protection__close_above_ema_fast_len = buy_protection_params[9][\"close_above_ema_fast_len\"]\n    buy_9_protection__close_above_ema_slow     = buy_protection_params[9][\"close_above_ema_slow\"]\n    buy_9_protection__close_above_ema_slow_len = buy_protection_params[9][\"close_above_ema_slow_len\"]\n    buy_9_protection__sma200_rising            = buy_protection_params[9][\"sma200_rising\"]\n    buy_9_protection__sma200_rising_val        = buy_protection_params[9][\"sma200_rising_val\"]\n    buy_9_protection__sma200_1h_rising         = buy_protection_params[9][\"sma200_1h_rising\"]\n    buy_9_protection__sma200_1h_rising_val     = buy_protection_params[9][\"sma200_1h_rising_val\"]\n    buy_9_protection__safe_dips                = buy_protection_params[9][\"safe_dips\"]\n    buy_9_protection__safe_dips_type           = buy_protection_params[9][\"safe_dips_type\"]\n    buy_9_protection__safe_pump                = buy_protection_params[9][\"safe_pump\"]\n    buy_9_protection__safe_pump_type           = buy_protection_params[9][\"safe_pump_type\"]\n    buy_9_protection__safe_pump_period         = buy_protection_params[9][\"safe_pump_period\"]\n    buy_9_protection__btc_1h_not_downtrend     = buy_protection_params[9][\"btc_1h_not_downtrend\"]\n\n    buy_condition_10_enable = buy_protection_params[10][\"enable\"]\n    buy_10_protection__ema_fast                 = buy_protection_params[10][\"ema_fast\"]\n    buy_10_protection__ema_fast_len             = buy_protection_params[10][\"ema_fast_len\"]\n    buy_10_protection__ema_slow                 = buy_protection_params[10][\"ema_slow\"]\n    buy_10_protection__ema_slow_len             = buy_protection_params[10][\"ema_slow_len\"]\n    buy_10_protection__close_above_ema_fast     = buy_protection_params[10][\"close_above_ema_fast\"]\n    buy_10_protection__close_above_ema_fast_len = buy_protection_params[10][\"close_above_ema_fast_len\"]\n    buy_10_protection__close_above_ema_slow     = buy_protection_params[10][\"close_above_ema_slow\"]\n    buy_10_protection__close_above_ema_slow_len = buy_protection_params[10][\"close_above_ema_slow_len\"]\n    buy_10_protection__sma200_rising            = buy_protection_params[10][\"sma200_rising\"]\n    buy_10_protection__sma200_rising_val        = buy_protection_params[10][\"sma200_rising_val\"]\n    buy_10_protection__sma200_1h_rising         = buy_protection_params[10][\"sma200_1h_rising\"]\n    buy_10_protection__sma200_1h_rising_val     = buy_protection_params[10][\"sma200_1h_rising_val\"]\n    buy_10_protection__safe_dips                = buy_protection_params[10][\"safe_dips\"]\n    buy_10_protection__safe_dips_type           = buy_protection_params[10][\"safe_dips_type\"]\n    buy_10_protection__safe_pump                = buy_protection_params[10][\"safe_pump\"]\n    buy_10_protection__safe_pump_type           = buy_protection_params[10][\"safe_pump_type\"]\n    buy_10_protection__safe_pump_period         = buy_protection_params[10][\"safe_pump_period\"]\n    buy_10_protection__btc_1h_not_downtrend     = buy_protection_params[10][\"btc_1h_not_downtrend\"]\n\n    buy_condition_11_enable = buy_protection_params[11][\"enable\"]\n    buy_11_protection__ema_fast                 = buy_protection_params[11][\"ema_fast\"]\n    buy_11_protection__ema_fast_len             = buy_protection_params[11][\"ema_fast_len\"]\n    buy_11_protection__ema_slow                 = buy_protection_params[11][\"ema_slow\"]\n    buy_11_protection__ema_slow_len             = buy_protection_params[11][\"ema_slow_len\"]\n    buy_11_protection__close_above_ema_fast     = buy_protection_params[11][\"close_above_ema_fast\"]\n    buy_11_protection__close_above_ema_fast_len = buy_protection_params[11][\"close_above_ema_fast_len\"]\n    buy_11_protection__close_above_ema_slow     = buy_protection_params[11][\"close_above_ema_slow\"]\n    buy_11_protection__close_above_ema_slow_len = buy_protection_params[11][\"close_above_ema_slow_len\"]\n    buy_11_protection__sma200_rising            = buy_protection_params[11][\"sma200_rising\"]\n    buy_11_protection__sma200_rising_val        = buy_protection_params[11][\"sma200_rising_val\"]\n    buy_11_protection__sma200_1h_rising         = buy_protection_params[11][\"sma200_1h_rising\"]\n    buy_11_protection__sma200_1h_rising_val     = buy_protection_params[11][\"sma200_1h_rising_val\"]\n    buy_11_protection__safe_dips                = buy_protection_params[11][\"safe_dips\"]\n    buy_11_protection__safe_dips_type           = buy_protection_params[11][\"safe_dips_type\"]\n    buy_11_protection__safe_pump                = buy_protection_params[11][\"safe_pump\"]\n    buy_11_protection__safe_pump_type           = buy_protection_params[11][\"safe_pump_type\"]\n    buy_11_protection__safe_pump_period         = buy_protection_params[11][\"safe_pump_period\"]\n    buy_11_protection__btc_1h_not_downtrend     = buy_protection_params[11][\"btc_1h_not_downtrend\"]\n\n    buy_condition_12_enable = buy_protection_params[12][\"enable\"]\n    buy_12_protection__ema_fast                 = buy_protection_params[12][\"ema_fast\"]\n    buy_12_protection__ema_fast_len             = buy_protection_params[12][\"ema_fast_len\"]\n    buy_12_protection__ema_slow                 = buy_protection_params[12][\"ema_slow\"]\n    buy_12_protection__ema_slow_len             = buy_protection_params[12][\"ema_slow_len\"]\n    buy_12_protection__close_above_ema_fast     = buy_protection_params[12][\"close_above_ema_fast\"]\n    buy_12_protection__close_above_ema_fast_len = buy_protection_params[12][\"close_above_ema_fast_len\"]\n    buy_12_protection__close_above_ema_slow     = buy_protection_params[12][\"close_above_ema_slow\"]\n    buy_12_protection__close_above_ema_slow_len = buy_protection_params[12][\"close_above_ema_slow_len\"]\n    buy_12_protection__sma200_rising            = buy_protection_params[12][\"sma200_rising\"]\n    buy_12_protection__sma200_rising_val        = buy_protection_params[12][\"sma200_rising_val\"]\n    buy_12_protection__sma200_1h_rising         = buy_protection_params[12][\"sma200_1h_rising\"]\n    buy_12_protection__sma200_1h_rising_val     = buy_protection_params[12][\"sma200_1h_rising_val\"]\n    buy_12_protection__safe_dips                = buy_protection_params[12][\"safe_dips\"]\n    buy_12_protection__safe_dips_type           = buy_protection_params[12][\"safe_dips_type\"]\n    buy_12_protection__safe_pump                = buy_protection_params[12][\"safe_pump\"]\n    buy_12_protection__safe_pump_type           = buy_protection_params[12][\"safe_pump_type\"]\n    buy_12_protection__safe_pump_period         = buy_protection_params[12][\"safe_pump_period\"]\n    buy_12_protection__btc_1h_not_downtrend     = buy_protection_params[12][\"btc_1h_not_downtrend\"]\n\n    buy_condition_13_enable = buy_protection_params[13][\"enable\"]\n    buy_13_protection__ema_fast                 = buy_protection_params[13][\"ema_fast\"]\n    buy_13_protection__ema_fast_len             = buy_protection_params[13][\"ema_fast_len\"]\n    buy_13_protection__ema_slow                 = buy_protection_params[13][\"ema_slow\"]\n    buy_13_protection__ema_slow_len             = buy_protection_params[13][\"ema_slow_len\"]\n    buy_13_protection__close_above_ema_fast     = buy_protection_params[13][\"close_above_ema_fast\"]\n    buy_13_protection__close_above_ema_fast_len = buy_protection_params[13][\"close_above_ema_fast_len\"]\n    buy_13_protection__close_above_ema_slow     = buy_protection_params[13][\"close_above_ema_slow\"]\n    buy_13_protection__close_above_ema_slow_len = buy_protection_params[13][\"close_above_ema_slow_len\"]\n    buy_13_protection__sma200_rising            = buy_protection_params[13][\"sma200_rising\"]\n    buy_13_protection__sma200_rising_val        = buy_protection_params[13][\"sma200_rising_val\"]\n    buy_13_protection__sma200_1h_rising         = buy_protection_params[13][\"sma200_1h_rising\"]\n    buy_13_protection__sma200_1h_rising_val     = buy_protection_params[13][\"sma200_1h_rising_val\"]\n    buy_13_protection__safe_dips                = buy_protection_params[13][\"safe_dips\"]\n    buy_13_protection__safe_dips_type           = buy_protection_params[13][\"safe_dips_type\"]\n    buy_13_protection__safe_pump                = buy_protection_params[13][\"safe_pump\"]\n    buy_13_protection__safe_pump_type           = buy_protection_params[13][\"safe_pump_type\"]\n    buy_13_protection__safe_pump_period         = buy_protection_params[13][\"safe_pump_period\"]\n    buy_13_protection__btc_1h_not_downtrend     = buy_protection_params[13][\"btc_1h_not_downtrend\"]\n\n    buy_condition_14_enable = buy_protection_params[14][\"enable\"]\n    buy_14_protection__ema_fast                 = buy_protection_params[14][\"ema_fast\"]\n    buy_14_protection__ema_fast_len             = buy_protection_params[14][\"ema_fast_len\"]\n    buy_14_protection__ema_slow                 = buy_protection_params[14][\"ema_slow\"]\n    buy_14_protection__ema_slow_len             = buy_protection_params[14][\"ema_slow_len\"]\n    buy_14_protection__close_above_ema_fast     = buy_protection_params[14][\"close_above_ema_fast\"]\n    buy_14_protection__close_above_ema_fast_len = buy_protection_params[14][\"close_above_ema_fast_len\"]\n    buy_14_protection__close_above_ema_slow     = buy_protection_params[14][\"close_above_ema_slow\"]\n    buy_14_protection__close_above_ema_slow_len = buy_protection_params[14][\"close_above_ema_slow_len\"]\n    buy_14_protection__sma200_rising            = buy_protection_params[14][\"sma200_rising\"]\n    buy_14_protection__sma200_rising_val        = buy_protection_params[14][\"sma200_rising_val\"]\n    buy_14_protection__sma200_1h_rising         = buy_protection_params[14][\"sma200_1h_rising\"]\n    buy_14_protection__sma200_1h_rising_val     = buy_protection_params[14][\"sma200_1h_rising_val\"]\n    buy_14_protection__safe_dips                = buy_protection_params[14][\"safe_dips\"]\n    buy_14_protection__safe_dips_type           = buy_protection_params[14][\"safe_dips_type\"]\n    buy_14_protection__safe_pump                = buy_protection_params[14][\"safe_pump\"]\n    buy_14_protection__safe_pump_type           = buy_protection_params[14][\"safe_pump_type\"]\n    buy_14_protection__safe_pump_period         = buy_protection_params[14][\"safe_pump_period\"]\n    buy_14_protection__btc_1h_not_downtrend     = buy_protection_params[14][\"btc_1h_not_downtrend\"]\n\n    buy_condition_15_enable = buy_protection_params[15][\"enable\"]\n    buy_15_protection__ema_fast                 = buy_protection_params[15][\"ema_fast\"]\n    buy_15_protection__ema_fast_len             = buy_protection_params[15][\"ema_fast_len\"]\n    buy_15_protection__ema_slow                 = buy_protection_params[15][\"ema_slow\"]\n    buy_15_protection__ema_slow_len             = buy_protection_params[15][\"ema_slow_len\"]\n    buy_15_protection__close_above_ema_fast     = buy_protection_params[15][\"close_above_ema_fast\"]\n    buy_15_protection__close_above_ema_fast_len = buy_protection_params[15][\"close_above_ema_fast_len\"]\n    buy_15_protection__close_above_ema_slow     = buy_protection_params[15][\"close_above_ema_slow\"]\n    buy_15_protection__close_above_ema_slow_len = buy_protection_params[15][\"close_above_ema_slow_len\"]\n    buy_15_protection__sma200_rising            = buy_protection_params[15][\"sma200_rising\"]\n    buy_15_protection__sma200_rising_val        = buy_protection_params[15][\"sma200_rising_val\"]\n    buy_15_protection__sma200_1h_rising         = buy_protection_params[15][\"sma200_1h_rising\"]\n    buy_15_protection__sma200_1h_rising_val     = buy_protection_params[15][\"sma200_1h_rising_val\"]\n    buy_15_protection__safe_dips                = buy_protection_params[15][\"safe_dips\"]\n    buy_15_protection__safe_dips_type           = buy_protection_params[15][\"safe_dips_type\"]\n    buy_15_protection__safe_pump                = buy_protection_params[15][\"safe_pump\"]\n    buy_15_protection__safe_pump_type           = buy_protection_params[15][\"safe_pump_type\"]\n    buy_15_protection__safe_pump_period         = buy_protection_params[15][\"safe_pump_period\"]\n    buy_15_protection__btc_1h_not_downtrend     = buy_protection_params[15][\"btc_1h_not_downtrend\"]\n\n    buy_condition_16_enable = buy_protection_params[16][\"enable\"]\n    buy_16_protection__ema_fast                 = buy_protection_params[16][\"ema_fast\"]\n    buy_16_protection__ema_fast_len             = buy_protection_params[16][\"ema_fast_len\"]\n    buy_16_protection__ema_slow                 = buy_protection_params[16][\"ema_slow\"]\n    buy_16_protection__ema_slow_len             = buy_protection_params[16][\"ema_slow_len\"]\n    buy_16_protection__close_above_ema_fast     = buy_protection_params[16][\"close_above_ema_fast\"]\n    buy_16_protection__close_above_ema_fast_len = buy_protection_params[16][\"close_above_ema_fast_len\"]\n    buy_16_protection__close_above_ema_slow     = buy_protection_params[16][\"close_above_ema_slow\"]\n    buy_16_protection__close_above_ema_slow_len = buy_protection_params[16][\"close_above_ema_slow_len\"]\n    buy_16_protection__sma200_rising            = buy_protection_params[16][\"sma200_rising\"]\n    buy_16_protection__sma200_rising_val        = buy_protection_params[16][\"sma200_rising_val\"]\n    buy_16_protection__sma200_1h_rising         = buy_protection_params[16][\"sma200_1h_rising\"]\n    buy_16_protection__sma200_1h_rising_val     = buy_protection_params[16][\"sma200_1h_rising_val\"]\n    buy_16_protection__safe_dips                = buy_protection_params[16][\"safe_dips\"]\n    buy_16_protection__safe_dips_type           = buy_protection_params[16][\"safe_dips_type\"]\n    buy_16_protection__safe_pump                = buy_protection_params[16][\"safe_pump\"]\n    buy_16_protection__safe_pump_type           = buy_protection_params[16][\"safe_pump_type\"]\n    buy_16_protection__safe_pump_period         = buy_protection_params[16][\"safe_pump_period\"]\n    buy_16_protection__btc_1h_not_downtrend     = buy_protection_params[16][\"btc_1h_not_downtrend\"]\n\n    buy_condition_17_enable = buy_protection_params[17][\"enable\"]\n    buy_17_protection__ema_fast                 = buy_protection_params[17][\"ema_fast\"]\n    buy_17_protection__ema_fast_len             = buy_protection_params[17][\"ema_fast_len\"]\n    buy_17_protection__ema_slow                 = buy_protection_params[17][\"ema_slow\"]\n    buy_17_protection__ema_slow_len             = buy_protection_params[17][\"ema_slow_len\"]\n    buy_17_protection__close_above_ema_fast     = buy_protection_params[17][\"close_above_ema_fast\"]\n    buy_17_protection__close_above_ema_fast_len = buy_protection_params[17][\"close_above_ema_fast_len\"]\n    buy_17_protection__close_above_ema_slow     = buy_protection_params[17][\"close_above_ema_slow\"]\n    buy_17_protection__close_above_ema_slow_len = buy_protection_params[17][\"close_above_ema_slow_len\"]\n    buy_17_protection__sma200_rising            = buy_protection_params[17][\"sma200_rising\"]\n    buy_17_protection__sma200_rising_val        = buy_protection_params[17][\"sma200_rising_val\"]\n    buy_17_protection__sma200_1h_rising         = buy_protection_params[17][\"sma200_1h_rising\"]\n    buy_17_protection__sma200_1h_rising_val     = buy_protection_params[17][\"sma200_1h_rising_val\"]\n    buy_17_protection__safe_dips                = buy_protection_params[17][\"safe_dips\"]\n    buy_17_protection__safe_dips_type           = buy_protection_params[17][\"safe_dips_type\"]\n    buy_17_protection__safe_pump                = buy_protection_params[17][\"safe_pump\"]\n    buy_17_protection__safe_pump_type           = buy_protection_params[17][\"safe_pump_type\"]\n    buy_17_protection__safe_pump_period         = buy_protection_params[17][\"safe_pump_period\"]\n    buy_17_protection__btc_1h_not_downtrend     = buy_protection_params[17][\"btc_1h_not_downtrend\"]\n\n    buy_condition_18_enable = buy_protection_params[18][\"enable\"]\n    buy_18_protection__ema_fast                 = buy_protection_params[18][\"ema_fast\"]\n    buy_18_protection__ema_fast_len             = buy_protection_params[18][\"ema_fast_len\"]\n    buy_18_protection__ema_slow                 = buy_protection_params[18][\"ema_slow\"]\n    buy_18_protection__ema_slow_len             = buy_protection_params[18][\"ema_slow_len\"]\n    buy_18_protection__close_above_ema_fast     = buy_protection_params[18][\"close_above_ema_fast\"]\n    buy_18_protection__close_above_ema_fast_len = buy_protection_params[18][\"close_above_ema_fast_len\"]\n    buy_18_protection__close_above_ema_slow     = buy_protection_params[18][\"close_above_ema_slow\"]\n    buy_18_protection__close_above_ema_slow_len = buy_protection_params[18][\"close_above_ema_slow_len\"]\n    buy_18_protection__sma200_rising            = buy_protection_params[18][\"sma200_rising\"]\n    buy_18_protection__sma200_rising_val        = buy_protection_params[18][\"sma200_rising_val\"]\n    buy_18_protection__sma200_1h_rising         = buy_protection_params[18][\"sma200_1h_rising\"]\n    buy_18_protection__sma200_1h_rising_val     = buy_protection_params[18][\"sma200_1h_rising_val\"]\n    buy_18_protection__safe_dips                = buy_protection_params[18][\"safe_dips\"]\n    buy_18_protection__safe_dips_type           = buy_protection_params[18][\"safe_dips_type\"]\n    buy_18_protection__safe_pump                = buy_protection_params[18][\"safe_pump\"]\n    buy_18_protection__safe_pump_type           = buy_protection_params[18][\"safe_pump_type\"]\n    buy_18_protection__safe_pump_period         = buy_protection_params[18][\"safe_pump_period\"]\n    buy_18_protection__btc_1h_not_downtrend     = buy_protection_params[18][\"btc_1h_not_downtrend\"]\n\n    buy_condition_19_enable = buy_protection_params[19][\"enable\"]\n    buy_19_protection__ema_fast                 = buy_protection_params[19][\"ema_fast\"]\n    buy_19_protection__ema_fast_len             = buy_protection_params[19][\"ema_fast_len\"]\n    buy_19_protection__ema_slow                 = buy_protection_params[19][\"ema_slow\"]\n    buy_19_protection__ema_slow_len             = buy_protection_params[19][\"ema_slow_len\"]\n    buy_19_protection__close_above_ema_fast     = buy_protection_params[19][\"close_above_ema_fast\"]\n    buy_19_protection__close_above_ema_fast_len = buy_protection_params[19][\"close_above_ema_fast_len\"]\n    buy_19_protection__close_above_ema_slow     = buy_protection_params[19][\"close_above_ema_slow\"]\n    buy_19_protection__close_above_ema_slow_len = buy_protection_params[19][\"close_above_ema_slow_len\"]\n    buy_19_protection__sma200_rising            = buy_protection_params[19][\"sma200_rising\"]\n    buy_19_protection__sma200_rising_val        = buy_protection_params[19][\"sma200_rising_val\"]\n    buy_19_protection__sma200_1h_rising         = buy_protection_params[19][\"sma200_1h_rising\"]\n    buy_19_protection__sma200_1h_rising_val     = buy_protection_params[19][\"sma200_1h_rising_val\"]\n    buy_19_protection__safe_dips                = buy_protection_params[19][\"safe_dips\"]\n    buy_19_protection__safe_dips_type           = buy_protection_params[19][\"safe_dips_type\"]\n    buy_19_protection__safe_pump                = buy_protection_params[19][\"safe_pump\"]\n    buy_19_protection__safe_pump_type           = buy_protection_params[19][\"safe_pump_type\"]\n    buy_19_protection__safe_pump_period         = buy_protection_params[19][\"safe_pump_period\"]\n    buy_19_protection__btc_1h_not_downtrend     = buy_protection_params[19][\"btc_1h_not_downtrend\"]\n\n    buy_condition_20_enable = buy_protection_params[20][\"enable\"]\n    buy_20_protection__ema_fast                 = buy_protection_params[20][\"ema_fast\"]\n    buy_20_protection__ema_fast_len             = buy_protection_params[20][\"ema_fast_len\"]\n    buy_20_protection__ema_slow                 = buy_protection_params[20][\"ema_slow\"]\n    buy_20_protection__ema_slow_len             = buy_protection_params[20][\"ema_slow_len\"]\n    buy_20_protection__close_above_ema_fast     = buy_protection_params[20][\"close_above_ema_fast\"]\n    buy_20_protection__close_above_ema_fast_len = buy_protection_params[20][\"close_above_ema_fast_len\"]\n    buy_20_protection__close_above_ema_slow     = buy_protection_params[20][\"close_above_ema_slow\"]\n    buy_20_protection__close_above_ema_slow_len = buy_protection_params[20][\"close_above_ema_slow_len\"]\n    buy_20_protection__sma200_rising            = buy_protection_params[20][\"sma200_rising\"]\n    buy_20_protection__sma200_rising_val        = buy_protection_params[20][\"sma200_rising_val\"]\n    buy_20_protection__sma200_1h_rising         = buy_protection_params[20][\"sma200_1h_rising\"]\n    buy_20_protection__sma200_1h_rising_val     = buy_protection_params[20][\"sma200_1h_rising_val\"]\n    buy_20_protection__safe_dips                = buy_protection_params[20][\"safe_dips\"]\n    buy_20_protection__safe_dips_type           = buy_protection_params[20][\"safe_dips_type\"]\n    buy_20_protection__safe_pump                = buy_protection_params[20][\"safe_pump\"]\n    buy_20_protection__safe_pump_type           = buy_protection_params[20][\"safe_pump_type\"]\n    buy_20_protection__safe_pump_period         = buy_protection_params[20][\"safe_pump_period\"]\n    buy_20_protection__btc_1h_not_downtrend     = buy_protection_params[20][\"btc_1h_not_downtrend\"]\n\n    buy_condition_21_enable = buy_protection_params[21][\"enable\"]\n    buy_21_protection__ema_fast                 = buy_protection_params[21][\"ema_fast\"]\n    buy_21_protection__ema_fast_len             = buy_protection_params[21][\"ema_fast_len\"]\n    buy_21_protection__ema_slow                 = buy_protection_params[21][\"ema_slow\"]\n    buy_21_protection__ema_slow_len             = buy_protection_params[21][\"ema_slow_len\"]\n    buy_21_protection__close_above_ema_fast     = buy_protection_params[21][\"close_above_ema_fast\"]\n    buy_21_protection__close_above_ema_fast_len = buy_protection_params[21][\"close_above_ema_fast_len\"]\n    buy_21_protection__close_above_ema_slow     = buy_protection_params[21][\"close_above_ema_slow\"]\n    buy_21_protection__close_above_ema_slow_len = buy_protection_params[21][\"close_above_ema_slow_len\"]\n    buy_21_protection__sma200_rising            = buy_protection_params[21][\"sma200_rising\"]\n    buy_21_protection__sma200_rising_val        = buy_protection_params[21][\"sma200_rising_val\"]\n    buy_21_protection__sma200_1h_rising         = buy_protection_params[21][\"sma200_1h_rising\"]\n    buy_21_protection__sma200_1h_rising_val     = buy_protection_params[21][\"sma200_1h_rising_val\"]\n    buy_21_protection__safe_dips                = buy_protection_params[21][\"safe_dips\"]\n    buy_21_protection__safe_dips_type           = buy_protection_params[21][\"safe_dips_type\"]\n    buy_21_protection__safe_pump                = buy_protection_params[21][\"safe_pump\"]\n    buy_21_protection__safe_pump_type           = buy_protection_params[21][\"safe_pump_type\"]\n    buy_21_protection__safe_pump_period         = buy_protection_params[21][\"safe_pump_period\"]\n    buy_21_protection__btc_1h_not_downtrend     = buy_protection_params[21][\"btc_1h_not_downtrend\"]\n\n    buy_condition_22_enable = buy_protection_params[22][\"enable\"]\n    buy_22_protection__ema_fast                 = buy_protection_params[22][\"ema_fast\"]\n    buy_22_protection__ema_fast_len             = buy_protection_params[22][\"ema_fast_len\"]\n    buy_22_protection__ema_slow                 = buy_protection_params[22][\"ema_slow\"]\n    buy_22_protection__ema_slow_len             = buy_protection_params[22][\"ema_slow_len\"]\n    buy_22_protection__close_above_ema_fast     = buy_protection_params[22][\"close_above_ema_fast\"]\n    buy_22_protection__close_above_ema_fast_len = buy_protection_params[22][\"close_above_ema_fast_len\"]\n    buy_22_protection__close_above_ema_slow     = buy_protection_params[22][\"close_above_ema_slow\"]\n    buy_22_protection__close_above_ema_slow_len = buy_protection_params[22][\"close_above_ema_slow_len\"]\n    buy_22_protection__sma200_rising            = buy_protection_params[22][\"sma200_rising\"]\n    buy_22_protection__sma200_rising_val        = buy_protection_params[22][\"sma200_rising_val\"]\n    buy_22_protection__sma200_1h_rising         = buy_protection_params[22][\"sma200_1h_rising\"]\n    buy_22_protection__sma200_1h_rising_val     = buy_protection_params[22][\"sma200_1h_rising_val\"]\n    buy_22_protection__safe_dips                = buy_protection_params[22][\"safe_dips\"]\n    buy_22_protection__safe_dips_type           = buy_protection_params[22][\"safe_dips_type\"]\n    buy_22_protection__safe_pump                = buy_protection_params[22][\"safe_pump\"]\n    buy_22_protection__safe_pump_type           = buy_protection_params[22][\"safe_pump_type\"]\n    buy_22_protection__safe_pump_period         = buy_protection_params[22][\"safe_pump_period\"]\n    buy_22_protection__btc_1h_not_downtrend     = buy_protection_params[22][\"btc_1h_not_downtrend\"]\n\n    buy_condition_23_enable = buy_protection_params[23][\"enable\"]\n    buy_23_protection__ema_fast                 = buy_protection_params[23][\"ema_fast\"]\n    buy_23_protection__ema_fast_len             = buy_protection_params[23][\"ema_fast_len\"]\n    buy_23_protection__ema_slow                 = buy_protection_params[23][\"ema_slow\"]\n    buy_23_protection__ema_slow_len             = buy_protection_params[23][\"ema_slow_len\"]\n    buy_23_protection__close_above_ema_fast     = buy_protection_params[23][\"close_above_ema_fast\"]\n    buy_23_protection__close_above_ema_fast_len = buy_protection_params[23][\"close_above_ema_fast_len\"]\n    buy_23_protection__close_above_ema_slow     = buy_protection_params[23][\"close_above_ema_slow\"]\n    buy_23_protection__close_above_ema_slow_len = buy_protection_params[23][\"close_above_ema_slow_len\"]\n    buy_23_protection__sma200_rising            = buy_protection_params[23][\"sma200_rising\"]\n    buy_23_protection__sma200_rising_val        = buy_protection_params[23][\"sma200_rising_val\"]\n    buy_23_protection__sma200_1h_rising         = buy_protection_params[23][\"sma200_1h_rising\"]\n    buy_23_protection__sma200_1h_rising_val     = buy_protection_params[23][\"sma200_1h_rising_val\"]\n    buy_23_protection__safe_dips                = buy_protection_params[23][\"safe_dips\"]\n    buy_23_protection__safe_dips_type           = buy_protection_params[23][\"safe_dips_type\"]\n    buy_23_protection__safe_pump                = buy_protection_params[23][\"safe_pump\"]\n    buy_23_protection__safe_pump_type           = buy_protection_params[23][\"safe_pump_type\"]\n    buy_23_protection__safe_pump_period         = buy_protection_params[23][\"safe_pump_period\"]\n    buy_23_protection__btc_1h_not_downtrend     = buy_protection_params[23][\"btc_1h_not_downtrend\"]\n\n    buy_condition_24_enable = buy_protection_params[24][\"enable\"]\n    buy_24_protection__ema_fast                 = buy_protection_params[24][\"ema_fast\"]\n    buy_24_protection__ema_fast_len             = buy_protection_params[24][\"ema_fast_len\"]\n    buy_24_protection__ema_slow                 = buy_protection_params[24][\"ema_slow\"]\n    buy_24_protection__ema_slow_len             = buy_protection_params[24][\"ema_slow_len\"]\n    buy_24_protection__close_above_ema_fast     = buy_protection_params[24][\"close_above_ema_fast\"]\n    buy_24_protection__close_above_ema_fast_len = buy_protection_params[24][\"close_above_ema_fast_len\"]\n    buy_24_protection__close_above_ema_slow     = buy_protection_params[24][\"close_above_ema_slow\"]\n    buy_24_protection__close_above_ema_slow_len = buy_protection_params[24][\"close_above_ema_slow_len\"]\n    buy_24_protection__sma200_rising            = buy_protection_params[24][\"sma200_rising\"]\n    buy_24_protection__sma200_rising_val        = buy_protection_params[24][\"sma200_rising_val\"]\n    buy_24_protection__sma200_1h_rising         = buy_protection_params[24][\"sma200_1h_rising\"]\n    buy_24_protection__sma200_1h_rising_val     = buy_protection_params[24][\"sma200_1h_rising_val\"]\n    buy_24_protection__safe_dips                = buy_protection_params[24][\"safe_dips\"]\n    buy_24_protection__safe_dips_type           = buy_protection_params[24][\"safe_dips_type\"]\n    buy_24_protection__safe_pump                = buy_protection_params[24][\"safe_pump\"]\n    buy_24_protection__safe_pump_type           = buy_protection_params[24][\"safe_pump_type\"]\n    buy_24_protection__safe_pump_period         = buy_protection_params[24][\"safe_pump_period\"]\n    buy_24_protection__btc_1h_not_downtrend     = buy_protection_params[24][\"btc_1h_not_downtrend\"]\n\n    buy_condition_25_enable = buy_protection_params[25][\"enable\"]\n    buy_25_protection__ema_fast                 = buy_protection_params[25][\"ema_fast\"]\n    buy_25_protection__ema_fast_len             = buy_protection_params[25][\"ema_fast_len\"]\n    buy_25_protection__ema_slow                 = buy_protection_params[25][\"ema_slow\"]\n    buy_25_protection__ema_slow_len             = buy_protection_params[25][\"ema_slow_len\"]\n    buy_25_protection__close_above_ema_fast     = buy_protection_params[25][\"close_above_ema_fast\"]\n    buy_25_protection__close_above_ema_fast_len = buy_protection_params[25][\"close_above_ema_fast_len\"]\n    buy_25_protection__close_above_ema_slow     = buy_protection_params[25][\"close_above_ema_slow\"]\n    buy_25_protection__close_above_ema_slow_len = buy_protection_params[25][\"close_above_ema_slow_len\"]\n    buy_25_protection__sma200_rising            = buy_protection_params[25][\"sma200_rising\"]\n    buy_25_protection__sma200_rising_val        = buy_protection_params[25][\"sma200_rising_val\"]\n    buy_25_protection__sma200_1h_rising         = buy_protection_params[25][\"sma200_1h_rising\"]\n    buy_25_protection__sma200_1h_rising_val     = buy_protection_params[25][\"sma200_1h_rising_val\"]\n    buy_25_protection__safe_dips                = buy_protection_params[25][\"safe_dips\"]\n    buy_25_protection__safe_dips_type           = buy_protection_params[25][\"safe_dips_type\"]\n    buy_25_protection__safe_pump                = buy_protection_params[25][\"safe_pump\"]\n    buy_25_protection__safe_pump_type           = buy_protection_params[25][\"safe_pump_type\"]\n    buy_25_protection__safe_pump_period         = buy_protection_params[25][\"safe_pump_period\"]\n    buy_25_protection__btc_1h_not_downtrend     = buy_protection_params[25][\"btc_1h_not_downtrend\"]\n\n    buy_condition_26_enable = buy_protection_params[26][\"enable\"]\n    buy_26_protection__ema_fast                 = buy_protection_params[26][\"ema_fast\"]\n    buy_26_protection__ema_fast_len             = buy_protection_params[26][\"ema_fast_len\"]\n    buy_26_protection__ema_slow                 = buy_protection_params[26][\"ema_slow\"]\n    buy_26_protection__ema_slow_len             = buy_protection_params[26][\"ema_slow_len\"]\n    buy_26_protection__close_above_ema_fast     = buy_protection_params[26][\"close_above_ema_fast\"]\n    buy_26_protection__close_above_ema_fast_len = buy_protection_params[26][\"close_above_ema_fast_len\"]\n    buy_26_protection__close_above_ema_slow     = buy_protection_params[26][\"close_above_ema_slow\"]\n    buy_26_protection__close_above_ema_slow_len = buy_protection_params[26][\"close_above_ema_slow_len\"]\n    buy_26_protection__sma200_rising            = buy_protection_params[26][\"sma200_rising\"]\n    buy_26_protection__sma200_rising_val        = buy_protection_params[26][\"sma200_rising_val\"]\n    buy_26_protection__sma200_1h_rising         = buy_protection_params[26][\"sma200_1h_rising\"]\n    buy_26_protection__sma200_1h_rising_val     = buy_protection_params[26][\"sma200_1h_rising_val\"]\n    buy_26_protection__safe_dips                = buy_protection_params[26][\"safe_dips\"]\n    buy_26_protection__safe_dips_type           = buy_protection_params[26][\"safe_dips_type\"]\n    buy_26_protection__safe_pump                = buy_protection_params[26][\"safe_pump\"]\n    buy_26_protection__safe_pump_type           = buy_protection_params[26][\"safe_pump_type\"]\n    buy_26_protection__safe_pump_period         = buy_protection_params[26][\"safe_pump_period\"]\n    buy_26_protection__btc_1h_not_downtrend     = buy_protection_params[26][\"btc_1h_not_downtrend\"]\n\n    buy_condition_27_enable = buy_protection_params[27][\"enable\"]\n    buy_27_protection__ema_fast                 = buy_protection_params[27][\"ema_fast\"]\n    buy_27_protection__ema_fast_len             = buy_protection_params[27][\"ema_fast_len\"]\n    buy_27_protection__ema_slow                 = buy_protection_params[27][\"ema_slow\"]\n    buy_27_protection__ema_slow_len             = buy_protection_params[27][\"ema_slow_len\"]\n    buy_27_protection__close_above_ema_fast     = buy_protection_params[27][\"close_above_ema_fast\"]\n    buy_27_protection__close_above_ema_fast_len = buy_protection_params[27][\"close_above_ema_fast_len\"]\n    buy_27_protection__close_above_ema_slow     = buy_protection_params[27][\"close_above_ema_slow\"]\n    buy_27_protection__close_above_ema_slow_len = buy_protection_params[27][\"close_above_ema_slow_len\"]\n    buy_27_protection__sma200_rising            = buy_protection_params[27][\"sma200_rising\"]\n    buy_27_protection__sma200_rising_val        = buy_protection_params[27][\"sma200_rising_val\"]\n    buy_27_protection__sma200_1h_rising         = buy_protection_params[27][\"sma200_1h_rising\"]\n    buy_27_protection__sma200_1h_rising_val     = buy_protection_params[27][\"sma200_1h_rising_val\"]\n    buy_27_protection__safe_dips                = buy_protection_params[27][\"safe_dips\"]\n    buy_27_protection__safe_dips_type           = buy_protection_params[27][\"safe_dips_type\"]\n    buy_27_protection__safe_pump                = buy_protection_params[27][\"safe_pump\"]\n    buy_27_protection__safe_pump_type           = buy_protection_params[27][\"safe_pump_type\"]\n    buy_27_protection__safe_pump_period         = buy_protection_params[27][\"safe_pump_period\"]\n    buy_27_protection__btc_1h_not_downtrend     = buy_protection_params[27][\"btc_1h_not_downtrend\"]\n\n    buy_condition_28_enable = buy_protection_params[28][\"enable\"]\n    buy_28_protection__ema_fast                 = buy_protection_params[28][\"ema_fast\"]\n    buy_28_protection__ema_fast_len             = buy_protection_params[28][\"ema_fast_len\"]\n    buy_28_protection__ema_slow                 = buy_protection_params[28][\"ema_slow\"]\n    buy_28_protection__ema_slow_len             = buy_protection_params[28][\"ema_slow_len\"]\n    buy_28_protection__close_above_ema_fast     = buy_protection_params[28][\"close_above_ema_fast\"]\n    buy_28_protection__close_above_ema_fast_len = buy_protection_params[28][\"close_above_ema_fast_len\"]\n    buy_28_protection__close_above_ema_slow     = buy_protection_params[28][\"close_above_ema_slow\"]\n    buy_28_protection__close_above_ema_slow_len = buy_protection_params[28][\"close_above_ema_slow_len\"]\n    buy_28_protection__sma200_rising            = buy_protection_params[28][\"sma200_rising\"]\n    buy_28_protection__sma200_rising_val        = buy_protection_params[28][\"sma200_rising_val\"]\n    buy_28_protection__sma200_1h_rising         = buy_protection_params[28][\"sma200_1h_rising\"]\n    buy_28_protection__sma200_1h_rising_val     = buy_protection_params[28][\"sma200_1h_rising_val\"]\n    buy_28_protection__safe_dips                = buy_protection_params[28][\"safe_dips\"]\n    buy_28_protection__safe_dips_type           = buy_protection_params[28][\"safe_dips_type\"]\n    buy_28_protection__safe_pump                = buy_protection_params[28][\"safe_pump\"]\n    buy_28_protection__safe_pump_type           = buy_protection_params[28][\"safe_pump_type\"]\n    buy_28_protection__safe_pump_period         = buy_protection_params[28][\"safe_pump_period\"]\n    buy_28_protection__btc_1h_not_downtrend     = buy_protection_params[28][\"btc_1h_not_downtrend\"]\n\n    buy_condition_29_enable = buy_protection_params[29][\"enable\"]\n    buy_29_protection__ema_fast                 = buy_protection_params[29][\"ema_fast\"]\n    buy_29_protection__ema_fast_len             = buy_protection_params[29][\"ema_fast_len\"]\n    buy_29_protection__ema_slow                 = buy_protection_params[29][\"ema_slow\"]\n    buy_29_protection__ema_slow_len             = buy_protection_params[29][\"ema_slow_len\"]\n    buy_29_protection__close_above_ema_fast     = buy_protection_params[29][\"close_above_ema_fast\"]\n    buy_29_protection__close_above_ema_fast_len = buy_protection_params[29][\"close_above_ema_fast_len\"]\n    buy_29_protection__close_above_ema_slow     = buy_protection_params[29][\"close_above_ema_slow\"]\n    buy_29_protection__close_above_ema_slow_len = buy_protection_params[29][\"close_above_ema_slow_len\"]\n    buy_29_protection__sma200_rising            = buy_protection_params[29][\"sma200_rising\"]\n    buy_29_protection__sma200_rising_val        = buy_protection_params[29][\"sma200_rising_val\"]\n    buy_29_protection__sma200_1h_rising         = buy_protection_params[29][\"sma200_1h_rising\"]\n    buy_29_protection__sma200_1h_rising_val     = buy_protection_params[29][\"sma200_1h_rising_val\"]\n    buy_29_protection__safe_dips                = buy_protection_params[29][\"safe_dips\"]\n    buy_29_protection__safe_dips_type           = buy_protection_params[29][\"safe_dips_type\"]\n    buy_29_protection__safe_pump                = buy_protection_params[29][\"safe_pump\"]\n    buy_29_protection__safe_pump_type           = buy_protection_params[29][\"safe_pump_type\"]\n    buy_29_protection__safe_pump_period         = buy_protection_params[29][\"safe_pump_period\"]\n    buy_29_protection__btc_1h_not_downtrend     = buy_protection_params[29][\"btc_1h_not_downtrend\"]\n\n    buy_condition_30_enable = buy_protection_params[30][\"enable\"]\n    buy_30_protection__ema_fast                 = buy_protection_params[30][\"ema_fast\"]\n    buy_30_protection__ema_fast_len             = buy_protection_params[30][\"ema_fast_len\"]\n    buy_30_protection__ema_slow                 = buy_protection_params[30][\"ema_slow\"]\n    buy_30_protection__ema_slow_len             = buy_protection_params[30][\"ema_slow_len\"]\n    buy_30_protection__close_above_ema_fast     = buy_protection_params[30][\"close_above_ema_fast\"]\n    buy_30_protection__close_above_ema_fast_len = buy_protection_params[30][\"close_above_ema_fast_len\"]\n    buy_30_protection__close_above_ema_slow     = buy_protection_params[30][\"close_above_ema_slow\"]\n    buy_30_protection__close_above_ema_slow_len = buy_protection_params[30][\"close_above_ema_slow_len\"]\n    buy_30_protection__sma200_rising            = buy_protection_params[30][\"sma200_rising\"]\n    buy_30_protection__sma200_rising_val        = buy_protection_params[30][\"sma200_rising_val\"]\n    buy_30_protection__sma200_1h_rising         = buy_protection_params[30][\"sma200_1h_rising\"]\n    buy_30_protection__sma200_1h_rising_val     = buy_protection_params[30][\"sma200_1h_rising_val\"]\n    buy_30_protection__safe_dips                = buy_protection_params[30][\"safe_dips\"]\n    buy_30_protection__safe_dips_type           = buy_protection_params[30][\"safe_dips_type\"]\n    buy_30_protection__safe_pump                = buy_protection_params[30][\"safe_pump\"]\n    buy_30_protection__safe_pump_type           = buy_protection_params[30][\"safe_pump_type\"]\n    buy_30_protection__safe_pump_period         = buy_protection_params[30][\"safe_pump_period\"]\n    buy_30_protection__btc_1h_not_downtrend     = buy_protection_params[30][\"btc_1h_not_downtrend\"]\n\n    buy_condition_31_enable = buy_protection_params[31][\"enable\"]\n    buy_31_protection__ema_fast                 = buy_protection_params[31][\"ema_fast\"]\n    buy_31_protection__ema_fast_len             = buy_protection_params[31][\"ema_fast_len\"]\n    buy_31_protection__ema_slow                 = buy_protection_params[31][\"ema_slow\"]\n    buy_31_protection__ema_slow_len             = buy_protection_params[31][\"ema_slow_len\"]\n    buy_31_protection__close_above_ema_fast     = buy_protection_params[31][\"close_above_ema_fast\"]\n    buy_31_protection__close_above_ema_fast_len = buy_protection_params[31][\"close_above_ema_fast_len\"]\n    buy_31_protection__close_above_ema_slow     = buy_protection_params[31][\"close_above_ema_slow\"]\n    buy_31_protection__close_above_ema_slow_len = buy_protection_params[31][\"close_above_ema_slow_len\"]\n    buy_31_protection__sma200_rising            = buy_protection_params[31][\"sma200_rising\"]\n    buy_31_protection__sma200_rising_val        = buy_protection_params[31][\"sma200_rising_val\"]\n    buy_31_protection__sma200_1h_rising         = buy_protection_params[31][\"sma200_1h_rising\"]\n    buy_31_protection__sma200_1h_rising_val     = buy_protection_params[31][\"sma200_1h_rising_val\"]\n    buy_31_protection__safe_dips                = buy_protection_params[31][\"safe_dips\"]\n    buy_31_protection__safe_dips_type           = buy_protection_params[31][\"safe_dips_type\"]\n    buy_31_protection__safe_pump                = buy_protection_params[31][\"safe_pump\"]\n    buy_31_protection__safe_pump_type           = buy_protection_params[31][\"safe_pump_type\"]\n    buy_31_protection__safe_pump_period         = buy_protection_params[31][\"safe_pump_period\"]\n    buy_31_protection__btc_1h_not_downtrend     = buy_protection_params[31][\"btc_1h_not_downtrend\"]\n\n    buy_condition_32_enable = buy_protection_params[32][\"enable\"]\n    buy_32_protection__ema_fast                 = buy_protection_params[32][\"ema_fast\"]\n    buy_32_protection__ema_fast_len             = buy_protection_params[32][\"ema_fast_len\"]\n    buy_32_protection__ema_slow                 = buy_protection_params[32][\"ema_slow\"]\n    buy_32_protection__ema_slow_len             = buy_protection_params[32][\"ema_slow_len\"]\n    buy_32_protection__close_above_ema_fast     = buy_protection_params[32][\"close_above_ema_fast\"]\n    buy_32_protection__close_above_ema_fast_len = buy_protection_params[32][\"close_above_ema_fast_len\"]\n    buy_32_protection__close_above_ema_slow     = buy_protection_params[32][\"close_above_ema_slow\"]\n    buy_32_protection__close_above_ema_slow_len = buy_protection_params[32][\"close_above_ema_slow_len\"]\n    buy_32_protection__sma200_rising            = buy_protection_params[32][\"sma200_rising\"]\n    buy_32_protection__sma200_rising_val        = buy_protection_params[32][\"sma200_rising_val\"]\n    buy_32_protection__sma200_1h_rising         = buy_protection_params[32][\"sma200_1h_rising\"]\n    buy_32_protection__sma200_1h_rising_val     = buy_protection_params[32][\"sma200_1h_rising_val\"]\n    buy_32_protection__safe_dips                = buy_protection_params[32][\"safe_dips\"]\n    buy_32_protection__safe_dips_type           = buy_protection_params[32][\"safe_dips_type\"]\n    buy_32_protection__safe_pump                = buy_protection_params[32][\"safe_pump\"]\n    buy_32_protection__safe_pump_type           = buy_protection_params[32][\"safe_pump_type\"]\n    buy_32_protection__safe_pump_period         = buy_protection_params[32][\"safe_pump_period\"]\n    buy_32_protection__btc_1h_not_downtrend     = buy_protection_params[32][\"btc_1h_not_downtrend\"]\n\n    buy_condition_33_enable = buy_protection_params[33][\"enable\"]\n    buy_33_protection__ema_fast                 = buy_protection_params[33][\"ema_fast\"]\n    buy_33_protection__ema_fast_len             = buy_protection_params[33][\"ema_fast_len\"]\n    buy_33_protection__ema_slow                 = buy_protection_params[33][\"ema_slow\"]\n    buy_33_protection__ema_slow_len             = buy_protection_params[33][\"ema_slow_len\"]\n    buy_33_protection__close_above_ema_fast     = buy_protection_params[33][\"close_above_ema_fast\"]\n    buy_33_protection__close_above_ema_fast_len = buy_protection_params[33][\"close_above_ema_fast_len\"]\n    buy_33_protection__close_above_ema_slow     = buy_protection_params[33][\"close_above_ema_slow\"]\n    buy_33_protection__close_above_ema_slow_len = buy_protection_params[33][\"close_above_ema_slow_len\"]\n    buy_33_protection__sma200_rising            = buy_protection_params[33][\"sma200_rising\"]\n    buy_33_protection__sma200_rising_val        = buy_protection_params[33][\"sma200_rising_val\"]\n    buy_33_protection__sma200_1h_rising         = buy_protection_params[33][\"sma200_1h_rising\"]\n    buy_33_protection__sma200_1h_rising_val     = buy_protection_params[33][\"sma200_1h_rising_val\"]\n    buy_33_protection__safe_dips                = buy_protection_params[33][\"safe_dips\"]\n    buy_33_protection__safe_dips_type           = buy_protection_params[33][\"safe_dips_type\"]\n    buy_33_protection__safe_pump                = buy_protection_params[33][\"safe_pump\"]\n    buy_33_protection__safe_pump_type           = buy_protection_params[33][\"safe_pump_type\"]\n    buy_33_protection__safe_pump_period         = buy_protection_params[33][\"safe_pump_period\"]\n    buy_33_protection__btc_1h_not_downtrend     = buy_protection_params[33][\"btc_1h_not_downtrend\"]\n\n    buy_condition_34_enable = buy_protection_params[34][\"enable\"]\n    buy_34_protection__ema_fast                 = buy_protection_params[34][\"ema_fast\"]\n    buy_34_protection__ema_fast_len             = buy_protection_params[34][\"ema_fast_len\"]\n    buy_34_protection__ema_slow                 = buy_protection_params[34][\"ema_slow\"]\n    buy_34_protection__ema_slow_len             = buy_protection_params[34][\"ema_slow_len\"]\n    buy_34_protection__close_above_ema_fast     = buy_protection_params[34][\"close_above_ema_fast\"]\n    buy_34_protection__close_above_ema_fast_len = buy_protection_params[34][\"close_above_ema_fast_len\"]\n    buy_34_protection__close_above_ema_slow     = buy_protection_params[34][\"close_above_ema_slow\"]\n    buy_34_protection__close_above_ema_slow_len = buy_protection_params[34][\"close_above_ema_slow_len\"]\n    buy_34_protection__sma200_rising            = buy_protection_params[34][\"sma200_rising\"]\n    buy_34_protection__sma200_rising_val        = buy_protection_params[34][\"sma200_rising_val\"]\n    buy_34_protection__sma200_1h_rising         = buy_protection_params[34][\"sma200_1h_rising\"]\n    buy_34_protection__sma200_1h_rising_val     = buy_protection_params[34][\"sma200_1h_rising_val\"]\n    buy_34_protection__safe_dips                = buy_protection_params[34][\"safe_dips\"]\n    buy_34_protection__safe_dips_type           = buy_protection_params[34][\"safe_dips_type\"]\n    buy_34_protection__safe_pump                = buy_protection_params[34][\"safe_pump\"]\n    buy_34_protection__safe_pump_type           = buy_protection_params[34][\"safe_pump_type\"]\n    buy_34_protection__safe_pump_period         = buy_protection_params[34][\"safe_pump_period\"]\n    buy_34_protection__btc_1h_not_downtrend     = buy_protection_params[34][\"btc_1h_not_downtrend\"]\n\n    buy_condition_35_enable = buy_protection_params[35][\"enable\"]\n    buy_35_protection__ema_fast                 = buy_protection_params[35][\"ema_fast\"]\n    buy_35_protection__ema_fast_len             = buy_protection_params[35][\"ema_fast_len\"]\n    buy_35_protection__ema_slow                 = buy_protection_params[35][\"ema_slow\"]\n    buy_35_protection__ema_slow_len             = buy_protection_params[35][\"ema_slow_len\"]\n    buy_35_protection__close_above_ema_fast     = buy_protection_params[35][\"close_above_ema_fast\"]\n    buy_35_protection__close_above_ema_fast_len = buy_protection_params[35][\"close_above_ema_fast_len\"]\n    buy_35_protection__close_above_ema_slow     = buy_protection_params[35][\"close_above_ema_slow\"]\n    buy_35_protection__close_above_ema_slow_len = buy_protection_params[35][\"close_above_ema_slow_len\"]\n    buy_35_protection__sma200_rising            = buy_protection_params[35][\"sma200_rising\"]\n    buy_35_protection__sma200_rising_val        = buy_protection_params[35][\"sma200_rising_val\"]\n    buy_35_protection__sma200_1h_rising         = buy_protection_params[35][\"sma200_1h_rising\"]\n    buy_35_protection__sma200_1h_rising_val     = buy_protection_params[35][\"sma200_1h_rising_val\"]\n    buy_35_protection__safe_dips                = buy_protection_params[35][\"safe_dips\"]\n    buy_35_protection__safe_dips_type           = buy_protection_params[35][\"safe_dips_type\"]\n    buy_35_protection__safe_pump                = buy_protection_params[35][\"safe_pump\"]\n    buy_35_protection__safe_pump_type           = buy_protection_params[35][\"safe_pump_type\"]\n    buy_35_protection__safe_pump_period         = buy_protection_params[35][\"safe_pump_period\"]\n    buy_35_protection__btc_1h_not_downtrend     = buy_protection_params[35][\"btc_1h_not_downtrend\"]\n\n    buy_condition_36_enable = buy_protection_params[36][\"enable\"]\n    buy_36_protection__ema_fast                 = buy_protection_params[36][\"ema_fast\"]\n    buy_36_protection__ema_fast_len             = buy_protection_params[36][\"ema_fast_len\"]\n    buy_36_protection__ema_slow                 = buy_protection_params[36][\"ema_slow\"]\n    buy_36_protection__ema_slow_len             = buy_protection_params[36][\"ema_slow_len\"]\n    buy_36_protection__close_above_ema_fast     = buy_protection_params[36][\"close_above_ema_fast\"]\n    buy_36_protection__close_above_ema_fast_len = buy_protection_params[36][\"close_above_ema_fast_len\"]\n    buy_36_protection__close_above_ema_slow     = buy_protection_params[36][\"close_above_ema_slow\"]\n    buy_36_protection__close_above_ema_slow_len = buy_protection_params[36][\"close_above_ema_slow_len\"]\n    buy_36_protection__sma200_rising            = buy_protection_params[36][\"sma200_rising\"]\n    buy_36_protection__sma200_rising_val        = buy_protection_params[36][\"sma200_rising_val\"]\n    buy_36_protection__sma200_1h_rising         = buy_protection_params[36][\"sma200_1h_rising\"]\n    buy_36_protection__sma200_1h_rising_val     = buy_protection_params[36][\"sma200_1h_rising_val\"]\n    buy_36_protection__safe_dips                = buy_protection_params[36][\"safe_dips\"]\n    buy_36_protection__safe_dips_type           = buy_protection_params[36][\"safe_dips_type\"]\n    buy_36_protection__safe_pump                = buy_protection_params[36][\"safe_pump\"]\n    buy_36_protection__safe_pump_type           = buy_protection_params[36][\"safe_pump_type\"]\n    buy_36_protection__safe_pump_period         = buy_protection_params[36][\"safe_pump_period\"]\n    buy_36_protection__btc_1h_not_downtrend     = buy_protection_params[36][\"btc_1h_not_downtrend\"]\n\n    buy_condition_37_enable = buy_protection_params[37][\"enable\"]\n    buy_37_protection__ema_fast                 = buy_protection_params[37][\"ema_fast\"]\n    buy_37_protection__ema_fast_len             = buy_protection_params[37][\"ema_fast_len\"]\n    buy_37_protection__ema_slow                 = buy_protection_params[37][\"ema_slow\"]\n    buy_37_protection__ema_slow_len             = buy_protection_params[37][\"ema_slow_len\"]\n    buy_37_protection__close_above_ema_fast     = buy_protection_params[37][\"close_above_ema_fast\"]\n    buy_37_protection__close_above_ema_fast_len = buy_protection_params[37][\"close_above_ema_fast_len\"]\n    buy_37_protection__close_above_ema_slow     = buy_protection_params[37][\"close_above_ema_slow\"]\n    buy_37_protection__close_above_ema_slow_len = buy_protection_params[37][\"close_above_ema_slow_len\"]\n    buy_37_protection__sma200_rising            = buy_protection_params[37][\"sma200_rising\"]\n    buy_37_protection__sma200_rising_val        = buy_protection_params[37][\"sma200_rising_val\"]\n    buy_37_protection__sma200_1h_rising         = buy_protection_params[37][\"sma200_1h_rising\"]\n    buy_37_protection__sma200_1h_rising_val     = buy_protection_params[37][\"sma200_1h_rising_val\"]\n    buy_37_protection__safe_dips                = buy_protection_params[37][\"safe_dips\"]\n    buy_37_protection__safe_dips_type           = buy_protection_params[37][\"safe_dips_type\"]\n    buy_37_protection__safe_pump                = buy_protection_params[37][\"safe_pump\"]\n    buy_37_protection__safe_pump_type           = buy_protection_params[37][\"safe_pump_type\"]\n    buy_37_protection__safe_pump_period         = buy_protection_params[37][\"safe_pump_period\"]\n    buy_37_protection__btc_1h_not_downtrend     = buy_protection_params[37][\"btc_1h_not_downtrend\"]\n\n    buy_condition_38_enable = buy_protection_params[38][\"enable\"]\n    buy_38_protection__ema_fast                 = buy_protection_params[38][\"ema_fast\"]\n    buy_38_protection__ema_fast_len             = buy_protection_params[38][\"ema_fast_len\"]\n    buy_38_protection__ema_slow                 = buy_protection_params[38][\"ema_slow\"]\n    buy_38_protection__ema_slow_len             = buy_protection_params[38][\"ema_slow_len\"]\n    buy_38_protection__close_above_ema_fast     = buy_protection_params[38][\"close_above_ema_fast\"]\n    buy_38_protection__close_above_ema_fast_len = buy_protection_params[38][\"close_above_ema_fast_len\"]\n    buy_38_protection__close_above_ema_slow     = buy_protection_params[38][\"close_above_ema_slow\"]\n    buy_38_protection__close_above_ema_slow_len = buy_protection_params[38][\"close_above_ema_slow_len\"]\n    buy_38_protection__sma200_rising            = buy_protection_params[38][\"sma200_rising\"]\n    buy_38_protection__sma200_rising_val        = buy_protection_params[38][\"sma200_rising_val\"]\n    buy_38_protection__sma200_1h_rising         = buy_protection_params[38][\"sma200_1h_rising\"]\n    buy_38_protection__sma200_1h_rising_val     = buy_protection_params[38][\"sma200_1h_rising_val\"]\n    buy_38_protection__safe_dips                = buy_protection_params[38][\"safe_dips\"]\n    buy_38_protection__safe_dips_type           = buy_protection_params[38][\"safe_dips_type\"]\n    buy_38_protection__safe_pump                = buy_protection_params[38][\"safe_pump\"]\n    buy_38_protection__safe_pump_type           = buy_protection_params[38][\"safe_pump_type\"]\n    buy_38_protection__safe_pump_period         = buy_protection_params[38][\"safe_pump_period\"]\n    buy_38_protection__btc_1h_not_downtrend     = buy_protection_params[38][\"btc_1h_not_downtrend\"]\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_2 = DecimalParameter(0.16, 0.3, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_3 = DecimalParameter(0.3, 0.5, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_4 = DecimalParameter(0.6, 1.0, default=0.86, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_2 = DecimalParameter(0.16, 0.34, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_3 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_4 = DecimalParameter(0.6, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=35.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_1 = DecimalParameter(-0.99, -0.5, default=-0.87, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=38.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_2 = DecimalParameter(0.6, 6.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.045, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.022, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_3 = DecimalParameter(-0.99, -0.5, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_cti_4 = DecimalParameter(-0.99, -0.5, default=-0.68, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.938, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_5 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_5 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.031, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_7 = DecimalParameter(-0.99, -0.5, default=-0.89, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_cti_8 = DecimalParameter(-0.99, -0.5, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(20.0, 50.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_8 = DecimalParameter(0.98, 1.0, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_8 = DecimalParameter(40.0, 66.0, default=64.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_8 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=44.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.907, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=34.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_13 = DecimalParameter(-0.99, -0.5, default=-0.74, space='buy', decimals=2, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-9.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_14 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.96, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.977, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_16 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_17 = DecimalParameter(-0.99, -0.5, default=-0.92, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_17 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_18 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_18 = DecimalParameter(-0.99, -0.5, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=16.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_20 = DecimalParameter(-0.99, -0.5, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_20 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=14.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_21 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.946, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=6.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.932, space='buy', optimize=False, load=True)\n    buy_26_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n    buy_26_volume = DecimalParameter(0.6, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(95, 99, default=99.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=97.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n    buy_27_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_27_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_28_ma_offset = DecimalParameter(0.90, 0.99, default=0.92, space='buy', optimize=False, load=True)\n    buy_28_ewo = DecimalParameter(2.0, 14.0, default=12.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_rsi = DecimalParameter(24.0, 44.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_cti = DecimalParameter(-0.99, -0.4, default=-0.6, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_29_ma_offset = DecimalParameter(0.90, 0.99, default=0.91, space='buy', optimize=False, load=True)\n    buy_29_ewo = DecimalParameter(-14.0, -2.0, default=-4.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_29_cti = DecimalParameter(-0.99, -0.4, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_30_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_30_ewo = DecimalParameter(2.0, 14.0, default=7.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_rsi = DecimalParameter(24.0, 48.0, default=42.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_31_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_31_ewo = DecimalParameter(-22.0, -8.0, default=-19.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_31_wr = DecimalParameter(-99.9, -95.0, default=-98.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_32_ma_offset = DecimalParameter(0.90, 0.99, default=0.946, space='buy', optimize=False, load=True)\n    buy_32_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_32_rsi = DecimalParameter(24.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_32_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_33_ma_offset = DecimalParameter(0.90, 0.99, default=0.974, space='buy', optimize=False, load=True)\n    buy_33_rsi = DecimalParameter(24.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_33_ewo = DecimalParameter(2.0, 14.0, default=9.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_34_ma_offset = DecimalParameter(0.90, 0.99, default=0.968, space='buy', optimize=False, load=True)\n    buy_34_dip = DecimalParameter(0.001, 0.02, default=0.002, space='buy', decimals=3, optimize=False, load=True)\n    buy_34_ewo = DecimalParameter(-24.0, -8.0, default=-20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_34_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_34_volume = DecimalParameter(0.6, 6.0, default=1.1, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = DecimalParameter(0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_profit_max_1 = DecimalParameter(0.0, 0.05, default=0.02, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = None\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = {}\n\n        # Update values from config file, if it exists\n        hold_trades_config_file = NostalgiaForInfinityNext.get_hold_trades_config_file()\n        if not hold_trades_config_file:\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            trade_ids = None\n            hold_trades_config = None\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                trade_ids = hold_trades_config.get(\"trade_ids\")\n\n            if not trade_ids:\n                return\n\n            open_trades = {\n                trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n            }\n\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    try:\n                        trade_id = int(trade_id)\n                    except ValueError:\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            hold_trades_config_file\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if current_profit > self.sell_custom_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_11.value:\n                    return True, 'signal_profit_11'\n            elif self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_10.value:\n                    return True, 'signal_profit_10'\n            elif self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_9.value:\n                    return True, 'signal_profit_9'\n            elif self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_rsi_8.value:\n                    return True, 'signal_profit_8'\n            elif self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_7.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_7'\n            elif self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_6.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_6'\n            elif self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_5.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_5'\n            elif self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_4.value) & (last_candle['cmf'] < 0.0) :\n                    return True, 'signal_profit_4'\n            elif self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_3.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_3'\n            elif self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_2.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_2'\n            elif self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_1.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_1'\n            elif self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_0'\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if current_profit > self.sell_custom_under_profit_11.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_11.value:\n                    return True, 'signal_profit_u_11'\n            elif self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_10.value:\n                    return True, 'signal_profit_u_10'\n            elif self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_9.value:\n                    return True, 'signal_profit_u_9'\n            elif self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_8.value:\n                    return True, 'signal_profit_u_8'\n            elif self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_7.value:\n                    return True, 'signal_profit_u_7'\n            elif self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_6.value:\n                    return True, 'signal_profit_u_6'\n            elif self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_5.value:\n                    return True, 'signal_profit_u_5'\n            elif self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_4.value:\n                    return True, 'signal_profit_u_4'\n            elif self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_3.value:\n                    return True, 'signal_profit_u_3'\n            elif self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_2.value:\n                    return True, 'signal_profit_u_2'\n            elif self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value:\n                if last_candle['rsi'] < self.sell_custom_under_rsi_1.value:\n                    return True, 'signal_profit_u_1'\n            elif self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value:\n                if (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['cmf'] < 0.0):\n                    return True, 'signal_profit_u_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit > self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)) & (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit > self.sell_trail_profit_min_4.value) & (max_profit > (current_profit + self.sell_trail_down_4.value)) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) & (0.2 > current_profit > 0.07) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1.value > current_profit > self.sell_custom_profit_under_profit_min_1.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit > self.sell_custom_profit_under_profit_2.value) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime', max_loss: float, max_profit: float) -> tuple:\n        if (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['cmf'] < -0.2) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_stoploss_u_1'\n\n        # Under EMA200, pair & BTC negative, low max rate\n        elif (-0.1 > current_profit > -0.14) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (max_profit < 0.005) & (max_loss < 0.14) & (last_candle['sma_200_dec_24']) & (last_candle['cmf'] < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -50.0):\n            return True, 'signal_stoploss_u_b_1'\n\n        # Under EMA200, pair & BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (-0.1 > current_profit > -0.2) & (last_candle['btc_not_downtrend_1h'] == False) & (last_candle['moderi_32'] == False) & (last_candle['moderi_64'] == False) & (last_candle['moderi_96'] == False) & (max_profit < 0.05) & (max_loss < 0.2) & (last_candle['sma_200_dec_24'])& (last_candle['sma_200_dec_20_1h']) & (last_candle['cmf'] < -0.45) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['ema_25'] < last_candle['ema_50']) & (last_candle['cti'] < -0.8) & (last_candle['r_480'] < -97.0):\n            return True, 'signal_stoploss_u_b_2'\n\n        elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['cmf'] < 0.0) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_1'\n\n        elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200']) & (last_candle['cmf'] < 0.0) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n            return True, 'signal_stoploss_l_r_u_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['cmf'] < 0.0) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n            return True, 'signal_stoploss_p_2'\n\n        elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n            return True, 'signal_stoploss_p_3'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value) & (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit > 0.02:\n            if last_candle['r_480'] > -1.2:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit > 0.03:\n            if last_candle['r_480'] > -1.4:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit > 0.04:\n            if last_candle['r_480'] > -1.6:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit > 0.05:\n            if last_candle['r_480'] > -1.8:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit > 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit > 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit > 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit > 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -1.5) & (last_candle['rsi'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -1.0) & (last_candle['rsi'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -2.1) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -2.3) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit > 0.05:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit > 0.06:\n            if (last_candle['r_480'] > -2.5) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit > 0.07:\n            if (last_candle['r_480'] > -34.0) & (last_candle['rsi'] > 80.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit > 0.08:\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit > 0.09:\n            if (last_candle['r_480'] > -2.8) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit > 0.1:\n            if (last_candle['r_480'] > -2.4) & (last_candle['rsi'] > 80.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit > 0.12:\n            if (last_candle['r_480'] > -2.2) & (last_candle['rsi'] > 81.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit > 0.2:\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 81.5) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit > 0.012:\n            if (last_candle['r_480'] > -6.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0) & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit > 0.02:\n            if (last_candle['r_480'] > -8.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit > 0.03:\n            if (last_candle['r_480'] > -29.0) & (last_candle['rsi'] > 74.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit > 0.04:\n            if (last_candle['r_480'] > -30.0) & (last_candle['rsi'] > 79.0) & (last_candle['stochrsi_fastk_96'] > 99.0)  & (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit > 0.012):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit > 0.02):\n            if (last_candle['r_480'] > -3.5) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit > 0.03):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit > 0.04):\n            if (last_candle['r_480'] > -4.5) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit > 0.05):\n            if (last_candle['r_480'] > -24.0) & (last_candle['rsi'] > 68.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit > 0.06):\n            if (last_candle['r_480'] > -26.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit > 0.07):\n            if (last_candle['r_480'] > -20.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit > 0.08):\n            if (last_candle['r_480'] > -18.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit > 0.09):\n            if (last_candle['r_480'] > -16.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit > 0.1):\n            if (last_candle['r_480'] > -4.0) & (last_candle['rsi'] > 79.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit > 0.12):\n            if (last_candle['r_480'] > -3.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit > 0.2):\n            if (last_candle['r_480'] > -2.0) & (last_candle['rsi'] > 80.0) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1, buy_signal_candle) -> tuple:\n        if buy_signal_candle['buy_condition_32'] or buy_signal_candle['buy_condition_33'] or buy_signal_candle['buy_condition_34'] or buy_signal_candle['buy_condition_35'] or buy_signal_candle['buy_condition_36'] or buy_signal_candle['buy_condition_37'] or buy_signal_candle['buy_condition_38']:\n            if (0.06 > current_profit > 0.02) & (last_candle['rsi'] > 79.0):\n                return True, 'signal_profit_q_1'\n\n            if (0.06 > current_profit > 0.02) & (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_q_2'\n\n            if (current_profit < -0.1):\n                return True, 'signal_stoploss_q_1'\n\n            if(last_candle['close'] < last_candle['atr_high_thresh']) & (previous_candle_1['close'] > previous_candle_1['atr_high_thresh']):\n                return True, 'signal_stoploss_q_atr'\n\n            if (current_profit > 0.0):\n                if (last_candle['pm'] <= last_candle['pmax_thresh']) & (last_candle['close'] > last_candle['sma_21'] * 1.039):\n                    return True, 'signal_profit_q_pmax_bull'\n                if (last_candle['pm'] > last_candle['pmax_thresh']) & (last_candle['close'] > last_candle['sma_21'] * 1.012):\n                    return True, 'signal_profit_q_pmax_bear'\n                if (last_candle['pm'] > last_candle['pmax_thresh']) & (last_candle['crsi'] >= 70):\n                    return True, 'signal_profit_q_pmax_c'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle_1 = dataframe.iloc[-2].squeeze()\n        previous_candle_2 = dataframe.iloc[-3].squeeze()\n        previous_candle_3 = dataframe.iloc[-4].squeeze()\n        previous_candle_4 = dataframe.iloc[-5].squeeze()\n        previous_candle_5 = dataframe.iloc[-6].squeeze()\n\n        trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n        buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n        if not buy_signal.empty:\n            buy_signal_candle = buy_signal.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if not buy_signal.empty:\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1, buy_signal_candle)\n            if sell and (signal_name is not None):\n                return signal_name\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, trade, current_time, max_loss, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name\n\n        # Sell signal 1\n        if self.sell_condition_1_enable.value & (last_candle['rsi'] > self.sell_rsi_bb_1.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) & (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) & (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) & (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1'\n                elif (max_loss > 0.1):\n                    return 'sell_signal_1_1_2'\n            else:\n                return 'sell_signal_1_2'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable.value) & (last_candle['rsi'] > self.sell_rsi_bb_2.value) & (last_candle['close'] > last_candle['bb20_2_upp']) & (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) & (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1'\n                elif (max_loss > 0.07):\n                    return 'sell_signal_2_1_2'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1'\n                elif (max_loss > 0.07):\n                    return 'sell_signal_2_2_2'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable.value & (last_candle['rsi'] > self.sell_dual_rsi_rsi_4.value) & (last_candle['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n            return 'sell_signal_4'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable.value & (last_candle['close'] < last_candle['ema_200']) & (last_candle['close'] > last_candle['ema_50']) & (last_candle['rsi'] > self.sell_rsi_under_6.value):\n            if (current_profit > 0.0):\n                    return 'sell_signal_6_1'\n            elif (max_loss > 0.08):\n                return 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable.value & (last_candle['rsi_1h'] > self.sell_rsi_1h_7.value) & (last_candle['crossed_below_ema_12_26']):\n            return 'sell_signal_7'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable.value & (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n            return 'sell_signal_8'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return (df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min()\n        elif method == 'OC':\n            return (df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return (df['open'] - df['close']) / df['close']\n        else:\n            return (df['open'].rolling(length).max() - df['close']) / df['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['open'].rolling(length).max() - df['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return df['close'] - df['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h.copy()\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # TSI\n        dataframe['tsi_slow'] = tsi(dataframe, window_slow=20, window_fast=5)\n        dataframe['tsi_ema_slow'] = ta.EMA(dataframe['tsi_slow'], timeperiod=5)\n\n        dataframe['tsi_fast'] = tsi(dataframe, window_slow=4, window_fast=2)\n        dataframe['tsi_ema_fast'] = ta.EMA(dataframe['tsi_fast'], timeperiod=2)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh'] = (dataframe['high'] - (dataframe['atr'] * 2.83))\n\n        dataframe['rsi_5'] = ta.RSI(dataframe, 5)\n        dataframe['streak'] = calc_streaks(dataframe[\"close\"])\n        dataframe['srsi'] = ta.RSI(dataframe['streak'], 2)\n        dataframe['roc'] = ta.ROC(dataframe, 5)\n        dataframe['crsi'] = (dataframe['rsi_5'] + dataframe['srsi'] + dataframe['roc']) / 3\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1.value, self.buy_dip_threshold_120_2.value, self.buy_dip_threshold_120_3.value, self.buy_dip_threshold_120_4.value)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1.value, self.buy_dip_threshold_130_2.value, self.buy_dip_threshold_130_3.value, self.buy_dip_threshold_130_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe.copy()\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        buy_protection_list = []\n\n        # Protections [STANDARD] - Common to every condition\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n            if global_buy_protection_params[\"ema_fast\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len'].value}\"] > dataframe['ema_200'])\n            if global_buy_protection_params[\"ema_slow\"].value:\n                item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len'].value}_1h\"] > dataframe['ema_200_1h'])\n            if global_buy_protection_params[\"close_above_ema_fast\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len'].value}\"])\n            if global_buy_protection_params[\"close_above_ema_slow\"].value:\n                item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len'].value}_1h\"])\n            if global_buy_protection_params[\"sma200_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'].value)))\n            if global_buy_protection_params[\"sma200_1h_rising\"].value:\n                item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'].value)))\n            if global_buy_protection_params[\"safe_dips\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type'].value}\"])\n            if global_buy_protection_params[\"safe_pump\"].value:\n                item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period'].value}_{global_buy_protection_params['safe_pump_type'].value}_1h\"])\n            if global_buy_protection_params['btc_1h_not_downtrend'].value:\n                item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n            if not self.config['runmode'].value in ('live', 'dry_run'):\n                if self.has_bt_agefilter:\n                    item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n            else:\n                if self.has_downtime_protection:\n                    item_buy_protection_list.append(dataframe['live_data_ok'])\n            buy_protection_list.append(item_buy_protection_list)\n\n        # Buy Condition #1\n        dataframe.loc[:,'buy_condition_1'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_1_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[0]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_1.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_1'] = True\n\n        # Buy Condition #2\n        dataframe.loc[:,'buy_condition_2'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_2_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[1]))\n            item_buy_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_2'] = True\n\n        # Buy Condition #3\n        dataframe.loc[:,'buy_condition_3'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_3_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[2].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[2]))\n            item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n            item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n            item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n            item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n            item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n            item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_3.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_3'] = True\n\n        # Buy Condition #4\n        dataframe.loc[:,'buy_condition_4'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_4_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[3]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n            item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_4.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_4'] = True\n\n        # Buy Condition #5\n        dataframe.loc[:,'buy_condition_5'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_5_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[4].append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[4]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_5.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_5'] = True\n\n        # Buy Condition #6\n        dataframe.loc[:,'buy_condition_6'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_6_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[5]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_6'] = True\n\n        # Buy Condition #7\n        dataframe.loc[:,'buy_condition_7'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_7_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[6]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_7.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_7'] = True\n\n        # Buy Condition #8\n        dataframe.loc[:,'buy_condition_8'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_8_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[7]))\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_8.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8.value))\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_8.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_8'] = True\n\n        # Buy Condition #9\n        dataframe.loc[:,'buy_condition_9'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_9_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[8].append(dataframe['ema_50'] > dataframe['ema_200'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[8]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_9'] = True\n\n        # Buy Condition #10\n        dataframe.loc[:,'buy_condition_10'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_10_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[9].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[9]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_10'] = True\n\n        # Buy Condition #11\n        dataframe.loc[:,'buy_condition_11'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_11_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[10].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[10]))\n            item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n            item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_11'] = True\n\n        # Buy Condition #12\n        dataframe.loc[:,'buy_condition_12'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_12_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[11]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_12'] = True\n\n        # Buy Condition #13\n        dataframe.loc[:,'buy_condition_13'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_13_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[12].append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[12]))\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_13.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_13'] = True\n\n        # Buy Condition #14\n        dataframe.loc[ :,'buy_condition_14'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_14_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[13]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_14.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_14'] = True\n\n        # Buy Condition #15\n        dataframe.loc[:,'buy_condition_15'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_15_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[14].append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[14]))\n            item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n            item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n            item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_15'] = True\n\n        # Buy Condition #16\n        dataframe.loc[:,'buy_condition_16'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_16_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[15]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_16.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_16'] = True\n\n        # Buy Condition #17\n        dataframe.loc[:,'buy_condition_17'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_17_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[16]))\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_17.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_17'] = True\n\n        # Buy Condition #18\n        dataframe.loc[:,'buy_condition_18'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_18_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[17].append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n            buy_protection_list[17].append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[17]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_18.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_18'] = True\n\n        # Buy Condition #19\n        dataframe.loc[:,'buy_condition_19'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_19_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[18]))\n            item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n            item_buy_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n            item_buy_logic.append(dataframe['moderi_32'] == True)\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['moderi_96'] == True)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_19'] = True\n\n        # Buy Condition #20\n        dataframe.loc[:,'buy_condition_20'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_20_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[19]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_20.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_20'] = True\n\n        # Buy Condition #21\n        dataframe.loc[:,'buy_condition_21'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_21_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[20]))\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_21'] = True\n\n        # Buy Condition #22\n        dataframe.loc[:,'buy_condition_22'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_22_enable']:\n            # Non-Standard protections (add below)\n            buy_protection_list[21].append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n            buy_protection_list[21].append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[21]))\n            item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n            item_buy_logic.append(dataframe['safe_dump_20_1h'])\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_22'] = True\n\n        # Buy Condition #23\n        dataframe.loc[:,'buy_condition_23'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_23_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[22]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n            item_buy_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_23'] = True\n\n        # Buy Condition #24\n        dataframe.loc[:,'buy_condition_24'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_24_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[23]))\n            item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n            item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n            item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n            item_buy_logic.append(dataframe['cmf_1h'] > 0)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_24'] = True\n\n        # Buy Condition #25\n        dataframe.loc[:,'buy_condition_25'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_25_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[24]))\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n            item_buy_logic.append(\n                (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n            )\n            item_buy_logic.append(dataframe['cti'] < self.buy_25_cti.value)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_25'] = True\n\n        # Buy Condition #26\n        dataframe.loc[:,'buy_condition_26'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_26_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[25]))\n            item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset.value))\n            item_buy_logic.append(dataframe['cti'] < self.buy_26_cti.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_26'] = True\n\n        # Buy Condition #27\n        dataframe.loc[:,'buy_condition_27'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_27_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[26]))\n            item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n            item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n            item_buy_logic.append(dataframe['rsi_1h'] + dataframe['rsi'] < self.buy_27_rsi_max.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_27_cti.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_27'] = True\n\n        # Buy Condition #28\n        dataframe.loc[:,'buy_condition_28'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_28_enable']:\n            # Non-Standard protections (add below)\n\n            # Logic\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[27]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_28_rsi.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_28_cti.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_28'] = True\n\n        # Buy Condition #29\n        dataframe.loc[:,'buy_condition_29'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_29_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[28]))\n            item_buy_logic.append(dataframe['moderi_64'] == True)\n            item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_29_cti.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_29'] = True\n\n        # Buy Condition #30\n        dataframe.loc[:,'buy_condition_30'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_30_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[29]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_30_rsi.value)\n            item_buy_logic.append(dataframe['cti'] < self.buy_30_cti.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_30'] = True\n\n        # Buy Condition #31\n        dataframe.loc[:,'buy_condition_31'] = False\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_31_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[30]))\n            item_buy_logic.append(dataframe['moderi_64'] == False)\n            item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset.value )\n            item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo.value)\n            item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr.value)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_31'] = True\n\n        # Buy Condition #32\n        dataframe.loc[:,'buy_condition_32'] = False\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_32_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[31]))\n            item_buy_logic.append(dataframe['moderi_32'])\n            item_buy_logic.append(dataframe['moderi_64'])\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_32_cti.value)\n            item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n            item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi.value)\n            item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset.value))\n            item_buy_logic.append(\n                ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_32'] = True\n\n        # Buy Condition #33\n        dataframe.loc[:,'buy_condition_33'] = False\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_33_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[32]))\n            item_buy_logic.append(dataframe['moderi_96'])\n            item_buy_logic.append(dataframe['cti'] < self.buy_33_cti.value)\n            item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset.value))\n            item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo.value)\n            item_buy_logic.append(dataframe['rsi'] < self.buy_33_rsi.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_33'] = True\n\n        # Buy Condition #34\n        dataframe.loc[:,'buy_condition_34'] = False\n        # Quick mode buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_34_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[33]))\n            item_buy_logic.append(dataframe['cti'] < self.buy_34_cti.value)\n            item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip.value)\n            item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset.value)\n            item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo.value)\n            item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume.value))\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_34'] = True\n\n        # Buy Condition #35\n        # PMAX0 buy\n        # -----------------------------------------------------------------------------------------\n        dataframe.loc[:,'buy_condition_35'] = False\n        if self.buy_params['buy_condition_35_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[34]))\n            item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n            item_buy_logic.append(dataframe['ewo'] > 8.2)\n            item_buy_logic.append(dataframe['rsi'] < 32.0)\n            item_buy_logic.append(dataframe['cti'] < -0.5)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_35'] = True\n\n        # Buy Condition #36\n        dataframe.loc[:,'buy_condition_36'] = False\n        # PMAX1 buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_36_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[35]))\n            item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n            item_buy_logic.append(dataframe['ewo'] < -8.0)\n            item_buy_logic.append(dataframe['cti'] < -0.8)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_36'] = True\n\n        # Buy Condition #37\n        dataframe.loc[:,'buy_condition_37'] = False\n        # PMAX2 buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_37_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[36]))\n            item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.93)\n            item_buy_logic.append(dataframe['ewo'] > 8.0)\n            item_buy_logic.append(dataframe['rsi'] < 56.0)\n            item_buy_logic.append(dataframe['cti'] < -0.84)\n            item_buy_logic.append(dataframe['safe_dump_50_1h'])\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_37'] = True\n\n        # Buy Condition #38\n        dataframe.loc[:,'buy_condition_38'] = False\n        # PMAX3 buy\n        # -----------------------------------------------------------------------------------------\n        if self.buy_params['buy_condition_38_enable']:\n            # Non-Standard protections (add below)\n\n            item_buy_logic = []\n            item_buy_logic.append(reduce(lambda x, y: x & y, buy_protection_list[37]))\n            item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n            item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.7)\n            item_buy_logic.append(dataframe['ewo'] < -2.0)\n            item_buy_logic.append(dataframe['cti'] < -0.86)\n            item_buy_logic.append(dataframe['volume'] > 0)\n            item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n            conditions.append(item_buy)\n\n            dataframe.loc[item_buy,'buy_condition_38'] = True\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            if not self.hold_trade_ids:\n                # We have no pairs we want to hold until profit, sell\n                return True\n\n            if trade.id not in self.hold_trade_ids:\n                # This pair is not on the list to hold until profit, sell\n                return True\n\n            trade_profit_ratio = self.hold_trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return True\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return True\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return False\n        else:\n            return True\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\ndef tsi(dataframe: DataFrame, window_slow: int, window_fast: int, fillna=False) -> Series:\n    \"\"\"\n    Indicator: True Strength Index (TSI)\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param window_slow: slow smoothing period\n    :param window_fast: fast smoothing period\n    :param fillna: If True fill NaN values\n    \"\"\"\n    df = dataframe.copy()\n\n    min_periods_slow = 0 if fillna else window_slow\n    min_periods_fast = 0 if fillna else window_fast\n\n    close_diff            = df['close'].diff()\n    close_diff_abs        = close_diff.abs()\n    smooth_close_diff     = close_diff.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n    smooth_close_diff_abs = close_diff_abs.ewm(span=window_slow, min_periods=min_periods_slow, adjust=False).mean().ewm(span=window_fast, min_periods=min_periods_fast, adjust=False).mean()\n\n    tsi = smooth_close_diff / smooth_close_diff_abs * 100\n\n    if fillna:\n        tsi = tsi.replace([np.inf, -np.inf], np.nan).fillna(0)\n\n    return tsi\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityNextGen/NostalgiaForInfinityNextGen.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV9 by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 15m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=37365811                                       ##\n##  Kucoin: https://www.kucoin.com/ucenter/signup?rcode=rJTLZ9K                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNextGen(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.50\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n    res_timeframe = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_1d = '1d'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.36,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.45,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        3: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.05,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.3,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.045,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : 0.34,\n            \"safe_dips_threshold_144\"   : 0.48,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : 0.42,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.97,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.14,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.5,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.3\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.08,\n            \"safe_dips_threshold_2\"     : 0.16,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : 0.8,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.3,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.15\n        },\n        7: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.05,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.2,\n            \"safe_dips_threshold_144\"   : 0.6,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.18,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.15\n        },\n        9: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.07,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.08,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.22,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.3,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.74,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.42,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : 0.48,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.08,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.08,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        18: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.08,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.75,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        19: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.08,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.75,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.05,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        }\n    }\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = 0.4\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = 0.44\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = 0.50\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = 0.58\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = 0.66\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = 0.74\n\n    # Sell\n    sell_condition_1_enable = True\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = 0.9\n    sell_pump_threshold_48_2 = 0.7\n    sell_pump_threshold_48_3 = 0.5\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = 0.72\n    sell_pump_threshold_36_2 = 4.0\n    sell_pump_threshold_36_3 = 1.0\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = 0.68\n    sell_pump_threshold_24_2 = 0.62\n    sell_pump_threshold_24_3 = 0.88\n\n    sell_rsi_bb_1 = 74.0\n    sell_rsi_bb_2 = 75.0\n\n    sell_rsi_main_3 = 78.0\n\n    sell_dual_rsi_rsi_4 = 68.4\n    sell_dual_rsi_rsi_1h_4 = 74.6\n\n    sell_ema_relative_5 = 0.024\n    sell_rsi_diff_5 = 4.4\n\n    sell_rsi_under_6 = 74.0\n\n    sell_rsi_1h_7 = 76.7\n\n    sell_bb_relative_8 = 1.1\n\n    #############################################################\n\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def is_support(self, row_data) -> bool:\n        if row_data[0] > row_data[1] and row_data[1] > row_data[2] and row_data[2] < row_data[3] and row_data[3] < row_data[4]:\n            return True\n        return False\n\n    def is_resistance(self, row_data) -> bool:\n        if row_data[0] < row_data[1] and row_data[1] < row_data[2] and row_data[2] > row_data[3] and row_data[3] > row_data[4]:\n            return True\n        return False\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 78.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_1_2_2'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_2_2_2'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 82.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_3_2_2'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_4_2_2'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_signal_6_1'\n            elif (current_profit < -0.05) and (max_loss > 0.12):\n                return True, 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_7_2_2'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_8_2_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Under & near EMA200, local uptrend move\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.015)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'sell_stoploss_u_e_1'\n\n        # Under EMA200, local strong uptrend move\n        if (\n                (current_profit < -0.08)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 24.0))\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'sell_stoploss_u_e_2'\n\n        # Under EMA200, pair negative, low max rate\n        if (\n                (current_profit < -0.08)\n                and (max_profit < 0.04)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (last_candle['close'] < last_candle['sup_level_1h'])\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (current_time - timedelta(minutes=1440) > trade.open_date_utc)\n        ):\n            return True, 'sell_stoploss_u_e_doom'\n\n        # Under EMA200, pair and BTC negative, low max rate\n        if (\n                (-0.05 > current_profit > -0.09)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (max_profit < 0.005)\n                and (max_loss < 0.09)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -50.0)\n        ):\n            return True, 'sell_stoploss_u_e_b_1'\n\n        # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (\n                (-0.1 > current_profit > -0.2)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (max_profit < 0.05)\n                and (max_loss < 0.2)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['cmf'] < -0.45)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -97.0)\n        ):\n            return True, 'signal_stoploss_u_e_b_2'\n\n        return False, None\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 30.0):\n                        return True, 'sell_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_12_2'\n                    elif (last_candle['rsi_14'] < 31.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bull_12_3'\n                    elif (last_candle['rsi_14'] < 31.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bull_11_3'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_11_4'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_10_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bull_10_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_10_4'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_9_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_o_bull_9_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_8_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_7_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bull_6_1'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bull_5_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_4_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_3_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_2_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.16) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_2_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_2_4'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_1_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_1_4'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_12_2'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bear_12_3'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_11_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bear_11_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_11_4'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_10_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bear_10_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_10_4'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_o_bear_9_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_3_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_2_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_2_4'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_1_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_1_4'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'signal_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_12_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bull_12_3'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_11_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bull_11_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_11_4'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_10_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bull_10_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_10_4'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_u_bull_9_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_9_4'\n                elif (0.09 > current_profit >= 0.08):\n                    if last_candle['rsi_14'] < 47.0:\n                        return True, 'sell_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_u_bull_7_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_u_bull_6_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bull_5_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_3_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.16) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_2_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_1_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_1_4'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_u_bear_12_1'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_12_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bear_12_3'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_u_bear_11_1'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_11_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bear_11_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_11_4'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_u_bear_10_1'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_10_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bear_10_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_10_4'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_u_bear_9_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_8_2'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_u_bear_8_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_7_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_u_bear_7_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bear_6_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_5_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_4_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_3_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_2_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_1_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_1_4'\n\n        return False, None\n\n    def sell_r(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.4:\n                return True, 'sell_profit_w_1_1'\n            elif (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_1_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_1_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_1_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.96):\n                return True, 'sell_profit_w_1_5'\n            elif (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_480_1h'] > -3.0):\n                return True, 'sell_profit_w_1_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_7'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_1_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 190.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_1_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.95) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 150.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_1_11'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_1h'] < -0.25):\n                return True, 'sell_profit_w_1_12'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 400.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_13'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_1_14'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_480_1h'] > -12.0) and (last_candle['rsi_14'] > 79.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_15'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_1_16'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_1_17'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_1_18'\n            elif (last_candle['r_96'] > -4.0) and  (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -6.0) and (last_candle['rsi_14_1h'] > 74.0):\n                return True, 'sell_profit_w_1_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.88):\n                return True, 'sell_profit_w_1_20'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_1_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_22'\n            elif (last_candle['r_24'] > -5.0) and (last_candle['r_32'] > -5.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_1_23'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_1_24'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.5:\n                return True, 'sell_profit_w_2_1'\n            elif (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_2_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_2_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.5):\n                return True, 'sell_profit_w_2_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.958):\n                return True, 'sell_profit_w_2_5'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_480_1h'] > -3.5):\n                return True, 'sell_profit_w_2_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_2_7'\n            elif (last_candle['r_14'] > -0.2) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_2_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.86) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_2_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.93) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_2_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 140.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_2_11'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_1h'] < -0.23):\n                return True, 'sell_profit_w_2_12'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 360.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_13'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_2_14'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_480_1h'] > -14.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_2_15'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_w_2_16'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_2_17'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_2_18'\n            elif (last_candle['r_96'] > -8.0) and  (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -10.0) and (last_candle['rsi_14_1h'] > 72.0):\n                return True, 'sell_profit_w_2_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.87):\n                return True, 'sell_profit_w_2_20'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_2_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_22'\n            elif (last_candle['r_24'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_2_23'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_2_24'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.6:\n                return True, 'sell_profit_w_3_1'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_3_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_3_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_3_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.956):\n                return True, 'sell_profit_w_3_5'\n            elif (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_3_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_3_7'\n            elif (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_3_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.84) and (last_candle['cci'] > 170.0) and (last_candle['r_480_1h'] > -12.0):\n                return True, 'sell_profit_w_3_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.92) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_3_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.87) and (last_candle['cci'] > 130.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_3_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf_1h'] < -0.22):\n                return True, 'sell_profit_w_3_12'\n            elif (last_candle['r_14'] >= -6.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_13'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_3_14'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_480_1h'] > -16.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_3_15'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 46.0):\n                return True, 'sell_profit_w_3_16'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] < 56.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 46.0):\n                return True, 'sell_profit_w_3_17'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 180.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_3_18'\n            elif (last_candle['r_96'] > -12.0) and  (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 190.0) and (last_candle['r_480_1h'] > -14.0) and (last_candle['rsi_14_1h'] > 70.0):\n                return True, 'sell_profit_w_3_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.86):\n                return True, 'sell_profit_w_3_20'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_3_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_22'\n            elif (last_candle['r_24'] > -7.0) and (last_candle['r_32'] > -7.0) and (last_candle['r_64'] > -6.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_3_23'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_3_24'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.7:\n                return True, 'sell_profit_w_4_1'\n            elif (last_candle['r_480'] > -5.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_4_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_4_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.5):\n                return True, 'sell_profit_w_4_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.954):\n                return True, 'sell_profit_w_4_5'\n            elif (last_candle['r_480'] > -7.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] > -4.5):\n                return True, 'sell_profit_w_4_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 75.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_4_7'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_4_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.83) and (last_candle['cci'] > 170.0) and (last_candle['r_480_1h'] > -13.0):\n                return True, 'sell_profit_w_4_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.91) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_4_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.86) and (last_candle['cci'] > 120.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_4_11'\n            elif (last_candle['r_14'] > -1.5) and (last_candle['rsi_14'] < 54.0) and (last_candle['cmf_1h'] < -0.21):\n                return True, 'sell_profit_w_4_12'\n            elif (last_candle['r_14'] >= -9.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_13'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_4_14'\n            elif (last_candle['r_14'] > -12.0) and (last_candle['r_480_1h'] > -18.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_4_15'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 48.0):\n                return True, 'sell_profit_w_4_16'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] < 57.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 47.0):\n                return True, 'sell_profit_w_4_17'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 190.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_4_18'\n            elif (last_candle['r_96'] > -11.0) and  (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -13.0) and (last_candle['rsi_14_1h'] > 70.0):\n                return True, 'sell_profit_w_4_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_20'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_4_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_22'\n            elif (last_candle['r_24'] > -8.0) and (last_candle['r_32'] > -8.0) and (last_candle['r_64'] > -7.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_4_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.5) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_4_24'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -1.0:\n                return True, 'sell_profit_w_5_1'\n            elif (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_5_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_5_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_5_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.952):\n                return True, 'sell_profit_w_5_5'\n            elif (last_candle['r_480'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -5.0):\n                return True, 'sell_profit_w_5_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_5_7'\n            elif (last_candle['r_14'] > -0.6) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_5_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.82) and (last_candle['cci'] > 170.0) and (last_candle['r_480_1h'] > -14.0):\n                return True, 'sell_profit_w_5_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.92) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_5_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 120.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_5_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 56.0) and (last_candle['cmf_1h'] < -0.2):\n                return True, 'sell_profit_w_5_12'\n            elif (last_candle['r_14'] >= -6.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 300.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_13'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_5_14'\n            elif (last_candle['r_14'] > -14.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_5_15'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] < 56.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_16'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] < 54.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_w_5_17'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_5_18'\n            elif (last_candle['r_96'] > -10.0) and  (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -12.0) and (last_candle['rsi_14_1h'] > 72.0):\n                return True, 'sell_profit_w_5_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.84):\n                return True, 'sell_profit_w_5_20'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_5_21'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_22'\n            elif (last_candle['r_24'] > -9.0) and (last_candle['r_32'] > -9.0) and (last_candle['r_64'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_5_23'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_5_24'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'sell_profit_w_6_1'\n            elif (last_candle['r_480'] > -6.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_6_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 53.0):\n                return True, 'sell_profit_w_6_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.5):\n                return True, 'sell_profit_w_6_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.95):\n                return True, 'sell_profit_w_6_5'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -6.0):\n                return True, 'sell_profit_w_6_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 74.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_6_7'\n            elif (last_candle['r_14'] > -0.7) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_6_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.83) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -12.0):\n                return True, 'sell_profit_w_6_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.93) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_6_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.84) and (last_candle['cci'] > 100.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_6_11'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['rsi_14'] < 58.0) and (last_candle['cmf_1h'] < -0.19):\n                return True, 'sell_profit_w_6_12'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_13'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_6_14'\n            elif (last_candle['r_14'] > -12.0) and (last_candle['r_480_1h'] > -18.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_6_15'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 48.0):\n                return True, 'sell_profit_w_6_16'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 43.0):\n                return True, 'sell_profit_w_6_17'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 210.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_6_18'\n            elif (last_candle['r_96'] > -9.0) and  (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 210.0) and (last_candle['r_480_1h'] > -11.0) and (last_candle['rsi_14_1h'] > 72.0):\n                return True, 'sell_profit_w_6_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.83):\n                return True, 'sell_profit_w_6_20'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.5):\n                return True, 'sell_profit_w_6_21'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_22'\n            elif (last_candle['r_24'] > -8.0) and (last_candle['r_32'] > -8.0) and (last_candle['r_64'] > -7.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_6_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_6_24'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'sell_profit_w_7_1'\n            elif (last_candle['r_480'] > -7.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_7_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_7_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_7_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.952):\n                return True, 'sell_profit_w_7_5'\n            elif (last_candle['r_480'] > -12.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -7.0):\n                return True, 'sell_profit_w_7_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_7_7'\n            elif (last_candle['r_14'] > -0.8) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_7_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.84) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_7_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.94) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_7_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.83) and (last_candle['cci'] > 100.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_7_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 60.0) and (last_candle['cmf_1h'] < -0.18):\n                return True, 'sell_profit_w_7_12'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 340.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_13'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 280.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_7_14'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_480_1h'] > -16.0) and (last_candle['rsi_14'] > 77.5) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_7_15'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 46.0):\n                return True, 'sell_profit_w_7_16'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_7_17'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_7_18'\n            elif (last_candle['r_96'] > -8.0) and  (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -10.0) and (last_candle['rsi_14_1h'] > 74.0):\n                return True, 'sell_profit_w_7_19'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.82):\n                return True, 'sell_profit_w_7_20'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_21'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_22'\n            elif (last_candle['r_24'] > -7.0) and (last_candle['r_32'] > -7.0) and (last_candle['r_64'] > -6.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_7_23'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_7_24'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'sell_profit_w_8_1'\n            elif (last_candle['r_480'] > -7.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_8_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_8_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_8_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.954):\n                return True, 'sell_profit_w_8_5'\n            elif (last_candle['r_480'] > -14.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_8_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_8_7'\n            elif (last_candle['r_14'] > -0.6) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_8_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_8_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.95) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_8_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 110.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_8_11'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 62.0) and (last_candle['cmf_1h'] < -0.15):\n                return True, 'sell_profit_w_8_12'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 360.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 300.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_8_14'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_480_1h'] > -14.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_8_15'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_w_8_16'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_17'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 230.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_8_18'\n            elif (last_candle['r_96'] > -7.0) and  (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -9.0) and (last_candle['rsi_14_1h'] > 74.0):\n                return True, 'sell_profit_w_8_19'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.81):\n                return True, 'sell_profit_w_8_20'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_8_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_22'\n            elif (last_candle['r_24'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_8_23'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_8_24'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'sell_profit_w_9_1'\n            elif (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_9_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_9_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_9_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.956):\n                return True, 'sell_profit_w_9_5'\n            elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -9.0):\n                return True, 'sell_profit_w_9_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_9_7'\n            elif (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_9_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 190.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_9_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_9_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.87) and (last_candle['cci'] > 120.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_9_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 58.0) and (last_candle['cmf_1h'] < -0.19):\n                return True, 'sell_profit_w_9_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 380.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_9_14'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_480_1h'] > -12.0) and (last_candle['rsi_14'] > 78.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_9_15'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_9_16'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_9_17'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_9_18'\n            elif (last_candle['r_96'] > -6.0) and  (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -8.0) and (last_candle['rsi_14_1h'] > 75.0):\n                return True, 'sell_profit_w_9_19'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_9_20'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_9_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_22'\n            elif (last_candle['r_24'] > -5.0) and (last_candle['r_32'] > -5.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_9_23'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_9_24'\n        elif 0.12 > current_profit >= 0.1:\n            if last_candle['r_480'] > -1.0:\n                return True, 'sell_profit_w_10_1'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_10_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_10_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.5):\n                return True, 'sell_profit_w_10_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.96):\n                return True, 'sell_profit_w_10_5'\n            elif (last_candle['r_480'] > -18.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['r_480_1h'] > -11.0):\n                return True, 'sell_profit_w_10_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_10_7'\n            elif (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_10_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_10_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_10_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 130.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_10_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf_1h'] < -0.22):\n                return True, 'sell_profit_w_10_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 400.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 340.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_10_14'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_480_1h'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 330.0):\n                return True, 'sell_profit_w_10_15'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_16'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 37.0):\n                return True, 'sell_profit_w_10_17'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 250.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_10_18'\n            elif (last_candle['r_96'] > -5.0) and  (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -7.0) and (last_candle['rsi_14_1h'] > 75.0):\n                return True, 'sell_profit_w_10_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.82):\n                return True, 'sell_profit_w_10_20'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_10_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_22'\n            elif (last_candle['r_24'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_10_23'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_10_24'\n        elif 0.2 > current_profit >= 0.12:\n            if last_candle['r_480'] > -0.5:\n                return True, 'sell_profit_w_11_1'\n            elif (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_11_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_w_11_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_11_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.965):\n                return True, 'sell_profit_w_11_5'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -7.0):\n                return True, 'sell_profit_w_11_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_11_7'\n            elif (last_candle['r_14'] > -0.2) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_11_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_11_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_11_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.89) and (last_candle['cci'] > 140.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_11_11'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.25):\n                return True, 'sell_profit_w_11_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 420.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 360.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_11_14'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_480_1h'] > -8.0) and (last_candle['rsi_14'] > 79.5) and (last_candle['cci'] > 340.0):\n                return True, 'sell_profit_w_11_15'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_11_16'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 36.0):\n                return True, 'sell_profit_w_11_17'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_11_18'\n            elif (last_candle['r_96'] > -4.0) and  (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -6.0) and (last_candle['rsi_14_1h'] > 76.0):\n                return True, 'sell_profit_w_11_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.84):\n                return True, 'sell_profit_w_11_20'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_11_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_22'\n            elif (last_candle['r_24'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_11_23'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_11_24'\n        elif current_profit >= 0.2:\n            if last_candle['r_480'] > -0.4:\n                return True, 'sell_profit_w_12_1'\n            elif (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_12_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 32.0):\n                return True, 'sell_profit_w_12_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.5):\n                return True, 'sell_profit_w_12_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.97):\n                return True, 'sell_profit_w_12_5'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_12_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_12_7'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_12_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_12_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_12_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 150.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_12_11'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_1h'] < -0.28):\n                return True, 'sell_profit_w_12_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 440.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 380.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_12_14'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_480_1h'] > -6.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 350.0):\n                return True, 'sell_profit_w_12_15'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 32.0) and (last_candle['rsi_14_1h'] < 36.0):\n                return True, 'sell_profit_w_12_16'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 35.0):\n                return True, 'sell_profit_w_12_17'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 270.0) and (last_candle['cmf_1h'] < -0.0) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return True, 'sell_profit_w_12_18'\n            elif (last_candle['r_96'] > -3.0) and  (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -5.0) and (last_candle['rsi_14_1h'] > 77.0):\n                return True, 'sell_profit_w_12_19'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.88):\n                return True, 'sell_profit_w_12_20'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -2.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_12_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_22'\n            elif (last_candle['r_24'] > -2.0) and (last_candle['r_32'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.8):\n                return True, 'sell_profit_w_12_23'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 400.0):\n                return True, 'sell_profit_w_12_24'\n\n        return False, None\n\n    def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.075)):\n                return True, 'sell_profit_t_1_0'\n            if (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_1_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.9):\n                return True, 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_1_6'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 52.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_1_8'\n        elif 0.03 > current_profit >= 0.02:\n            if (max_profit > (current_profit + 0.08)):\n                return True, 'sell_profit_t_2_0'\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_2_1'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_2_3'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] < -0.8):\n                return True, 'sell_profit_t_2_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_2_5'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_2_6'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_t_2_7'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_2_8'\n        elif 0.04 > current_profit >= 0.03:\n            if (max_profit > (current_profit + 0.08)):\n                return True, 'sell_profit_t_3_0'\n            if (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_3_1'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_3_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_3_3'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['cti_1h'] < -0.6):\n                return True, 'sell_profit_t_3_4'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_3_5'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_3_6'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['rsi_14_1h'] < 43.0):\n                return True, 'sell_profit_t_3_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 48.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_3_8'\n        elif 0.05 > current_profit >= 0.04:\n            if (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 37.0):\n                return True, 'sell_profit_t_4_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_4_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_4_3'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_4_4'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_4_5'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_4_6'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_t_4_7'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_4_8'\n        elif 0.06 > current_profit >= 0.05:\n            if (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_5_1'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_t_5_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_5_3'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_5_4'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_5_5'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_5_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 41.0):\n                return True, 'sell_profit_t_5_7'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_5_8'\n        elif 0.07 > current_profit >= 0.06:\n            # if (max_profit > (current_profit + 0.095)):\n            #     return True, 'sell_profit_t_6_0'\n            if (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_6_1'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 49.0):\n                return True, 'sell_profit_t_6_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_6_3'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_6_4'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_6_5'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_6_6'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_t_6_7'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 42.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_6_8'\n        elif 0.08 > current_profit >= 0.07:\n            if (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_7_1'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_t_7_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_7_3'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_7_4'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_7_5'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_7_6'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 39.0):\n                return True, 'sell_profit_t_7_7'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_7_8'\n        elif 0.09 > current_profit >= 0.08:\n            if (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_8_1'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 51.0):\n                return True, 'sell_profit_t_8_2'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_8_3'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_8_4'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_8_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_8_6'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 32.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_t_8_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_8_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_9_1'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_t_9_2'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_9_3'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_9_4'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_9_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_9_6'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 31.0) and (last_candle['rsi_14_1h'] < 37.0):\n                return True, 'sell_profit_t_9_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_9_8'\n        elif 0.12 > current_profit >= 0.1:\n            if (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_10_1'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_t_10_2'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_10_3'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_10_4'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_10_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_10_6'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14'] < 30.0) and (last_candle['rsi_14_1h'] < 36.0):\n                return True, 'sell_profit_t_10_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_10_8'\n        elif 0.2 > current_profit >= 0.12:\n            if (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_11_1'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_11_2'\n            elif (max_profit > (current_profit + 0.14)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_11_3'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_11_4'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_11_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_11_6'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 29.0) and (last_candle['rsi_14_1h'] < 35.0):\n                return True, 'sell_profit_t_11_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 32.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_11_8'\n        elif current_profit >= 0.2:\n            if (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_12_1'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_t_12_2'\n            elif (max_profit > (current_profit + 0.16)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_12_3'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14_1h'] < 31.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_12_4'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_12_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_12_6'\n            elif (max_profit > (current_profit + 0.13)) and (last_candle['rsi_14'] < 28.0) and (last_candle['rsi_14_1h'] < 34.0):\n                return True, 'sell_profit_t_12_7'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14'] < 32.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_12_8'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['close'] > last_candle['ema_200']):\n            if 0.02 > current_profit >= 0.012:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):\n                    return True, 'sell_profit_d_o_1_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_3'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_2_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_3'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_3_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_3'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):\n                    return True, 'sell_profit_d_o_4_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_4_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_3'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_5_1'\n                elif (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_o_5_2'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_3'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_6_1'\n                elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_6_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_3'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_7_1'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_o_7_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_3'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):\n                    return True, 'sell_profit_d_o_8_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_3'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_9_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_3'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_10_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_o_10_2'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_3'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_11_1'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):\n                    return True, 'sell_profit_d_o_11_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_3'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_12_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_12_2'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_3'\n        else:\n            if 0.02 > current_profit >= 0.012:\n                if (last_candle['rsi_14'] < 55.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_1_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_1_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_3'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_2_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_2_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_3'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_3_1'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_3'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_4_1'\n                elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_4_2'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_3'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_5_1'\n                elif (last_candle['rsi_14'] < 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                    return True, 'sell_profit_d_u_5_2'\n                elif (last_candle['rsi_14'] < 53.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_3'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_6_1'\n                elif (last_candle['rsi_14'] < 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):\n                    return True, 'sell_profit_d_u_6_2'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_3'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 55.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_7_1'\n                elif (last_candle['rsi_14'] < 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_7_2'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_3'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_8_1'\n                elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_8_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_3'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 53.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_9_1'\n                elif (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_9_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_3'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_10_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_2'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_3'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_11_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_2'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_3'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_12_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_u_12_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_3'\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_48_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_6_4'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_6_5'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_48_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_5_4'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_5_5'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_48_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_4_4'\n                    elif (last_candle['rsi_14'] > 73.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_4_5'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_48_1_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_3_4'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_3_5'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_48_1_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_2_4'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_2_5'\n                    elif (last_candle['rsi_14'] > 64.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_48_1_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_1_4'\n                    elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_1_5'\n                    elif (last_candle['rsi_14'] > 69.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_48_1_1_6'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_48_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_6_4'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_6_5'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_48_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_5_4'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_5_5'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_48_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_4_4'\n                    elif (last_candle['rsi_14'] > 72.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_4_5'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_48_1_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_3_4'\n                    elif (last_candle['rsi_14'] > 74.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_3_5'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_48_1_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_2_4'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_2_5'\n                    elif (last_candle['rsi_14'] > 63.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_48_1_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_1_4'\n                    elif (last_candle['rsi_14'] > 78.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_1_5'\n                    elif (last_candle['rsi_14'] > 68.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_48_1_1_6'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.8):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_2_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.5):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_12_1'\n                    elif (last_candle['rsi_14'] > 80.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_12_2'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_11_1'\n                    elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_10_1'\n                    elif (last_candle['rsi_14'] > 78.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_3_9_1'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_8_1'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_7_1'\n                    elif (last_candle['rsi_14'] > 74.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_6_1'\n                    elif (last_candle['rsi_14'] > 72.0) and (last_candle['r_14'] > -2.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_1'\n                    elif (last_candle['rsi_14'] > 70.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_4_1'\n                    elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bull_48_3_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_3_1'\n                    elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bull_48_3_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                    elif (last_candle['rsi_14'] > 72.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_1_2'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_12_1'\n                    elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_12_2'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_11_1'\n                    elif (last_candle['rsi_14'] > 78.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_10_1'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bear_48_3_9_1'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_8_1'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_7_1'\n                    elif (last_candle['rsi_14'] > 73.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_6_1'\n                    elif (last_candle['rsi_14'] > 71.0) and (last_candle['r_14'] > -2.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_1'\n                    elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_4_1'\n                    elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_3_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_3_1'\n                    elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_3_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_2_1'\n                    elif (last_candle['rsi_14'] > 71.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_1'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.72):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_36_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_36_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_36_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_36_1_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_36_1_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_36_1_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_36_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_36_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_36_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_36_1_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_36_1_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_36_1_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_1_4'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.68):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_24_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_24_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_24_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_24_1_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_24_1_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_24_1_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_24_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_24_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_24_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_24_1_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_24_1_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_24_1_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_1_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.05 > current_profit > 0.01) and (last_candle['hl_pct_change_24_1h'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'sell_profit_p_d_1'\n\n        elif (0.05 > current_profit > 0.02) and (last_candle['hl_pct_change_36_1h'] > 1.2) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'sell_profit_p_d_2'\n\n        elif (0.06 > current_profit > 0.04) and (last_candle['hl_pct_change_48_1h'] > 1.4) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'sell_profit_p_d_3'\n\n        return False, None\n\n    def sell_pump_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.03 > current_profit > 0.01) and (last_candle['hl_pct_change_6_1h'] > 0.16) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.0) and (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_p_t_1'\n\n        return False, None\n\n    def sell_pump_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.005)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_1'\n            elif (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.02)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_36_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\n            if (\n                    (-0.05 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n                    and (last_candle['rsi_14'] < 40.0)\n            ):\n                return True, 'sell_stoploss_p_36_2_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_24_1_1'\n\n\n        return False, None\n\n    def sell_duration(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n            if current_profit >= 0.2:\n                if (last_candle['rsi_14'] > 81.5):\n                    return True, 'sell_profit_l_12_1'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] > 81.0):\n                    return True, 'sell_profit_l_11_1'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] > 80.5):\n                    return True, 'sell_profit_l_10_1'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] > 80.0):\n                    return True, 'sell_profit_l_9_1'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] > 79.5):\n                    return True, 'sell_profit_l_8_1'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] > 79.0):\n                    return True, 'sell_profit_l_7_1'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] > 78.5):\n                    return True, 'sell_profit_l_6_1'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] > 78.0):\n                    return True, 'sell_profit_l_5_1'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] > 79.0):\n                    return True, 'sell_profit_l_4_1'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] > 80.0):\n                    return True, 'sell_profit_l_3_1'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] > 80.5):\n                    return True, 'sell_profit_l_2_1'\n            elif 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] > 81.0):\n                    return True, 'sell_profit_l_1_1'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.04 > current_profit >= 0.02):\n            if (max_profit > (current_profit + 0.02)):\n                return True, 'sell_profit_q_t_1'\n        elif (0.06 > current_profit >= 0.04):\n            if (max_profit > (current_profit + 0.03)):\n                return True, 'sell_profit_q_t_2'\n        elif (0.08 > current_profit >= 0.06):\n            if (max_profit > (current_profit + 0.04)):\n                return True, 'sell_profit_q_t_3'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if all(c in ['empty', '19'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sells\n        sell, signal_name = self.sell_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Sell logic for pumped pairs\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, descending\n        sell, signal_name = self.sell_pump_dec(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, trailing\n        sell, signal_name = self.sell_pump_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, stoploss\n        sell, signal_name = self.sell_pump_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trade duration based sell logic\n        sell, signal_name = self.sell_duration(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        # S/R\n        res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n        informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()\n        informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EMAs\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # EWO\n        informative_1h['ewo'] = ewo(informative_1h, 50, 200)\n        informative_1h['ewo_ema'] = ewo_ema(informative_1h, 50, 200)\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # S/R\n        res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n        informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)\n        informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n\n        # RSI\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # EMAs\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_24'] = williams_r(dataframe, period=24)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n        dataframe['ewo_ema'] = ewo_ema(dataframe, 50, 200)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Volume\n        dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)\n        dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)\n        dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,3)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,48)\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump_6h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params[\"safe_pump_6h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_12h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params[\"safe_pump_12h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_24h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params[\"safe_pump_24h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_36h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params[\"safe_pump_36h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_48h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params[\"safe_pump_48h_threshold\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(4).min()) / dataframe['open'].rolling(4).min()) > 0.04)\n                    item_buy_logic.append(dataframe['rsi_14'] < 33.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 30.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 50.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -99.0)\n\n                # Condition #2 - Semi swing. Local dip. Uptrend.\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.025))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))\n\n                # Condition #3 - Semi swing. Local dip. Strong uptrend.\n                elif index == 3:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'] > 4.2)\n                    item_buy_logic.append(dataframe['rsi_14'] < 29.2)\n                    item_buy_logic.append(dataframe['cti'] < -0.88)\n                    item_buy_logic.append(dataframe['cci'] < -133.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n\n                # Condition #4 - Semi swing. Local dip. Uptrend. Strict pump & dip protections.\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.032))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_64'] < -90.0)\n                    item_buy_logic.append(dataframe['r_96'] < -80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.8)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -35.0)\n\n                # Condition #5 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 5:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_26'] * 0.966)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 4.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 26.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n                    item_buy_logic.append(dataframe['mfi'] < 20.0)\n\n                # Condition #6 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.958)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.4)\n                    item_buy_logic.append(dataframe['cci'] < -190.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 4.0)\n                    item_buy_logic.append((dataframe['rsi_14_1h'] + dataframe['rsi_14']) < 74.0)\n\n                # Condition #7 - Semi swing. 1h uptrend.\n                elif index == 7:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(4))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(4) > dataframe['ema_200_1h'].shift(8))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.026))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))\n\n                # Condition #8 - Semi swing. Local dip. 1h minor dip.\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * 0.95))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -92.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.1)\n\n                # Condition #9 - Semi swing. Local deep. Uptrend, 1h uptrend.\n                elif index == 9:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.97))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['ewo_ema'] > 4.2)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -94.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 2.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.75)\n\n                # Condition #10 - Semi swing. Local dip.\n                elif index == 10:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.026))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.942)\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.2)\n                    item_buy_logic.append(dataframe['crsi'] > 10.0)\n\n                # Condition #11 - Semi swing. Deep local dip. Mild uptrend.\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.938)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.87)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -85.0)\n\n                # Condition #12 - Semi swing. Downtrend. Dip.\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.954))\n                    item_buy_logic.append(dataframe['ewo_ema'] < -8.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -94.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 3.0)\n\n                # Condition #13 - Semi swing. 1h uptrend. BTC not downtrend.\n                elif index == 13:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0242))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.998))\n\n                # Condition #14 - Semi swing. Uptrend. Local dip.\n                elif index == 14:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'] > 7.5)\n                    item_buy_logic.append(dataframe['close'] > (dataframe['close'].shift(1)))\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['bb20_2_low'].shift(1) * 0.985))\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n                    item_buy_logic.append(dataframe['r_96'].shift(1) < -85.0)\n\n                # Condition #15 - Semi swing. Downtrend.Local dip.\n                elif index == 15:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'].shift(1) < -10.4)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.88)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -90.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 2.0)\n\n                # Condition #16 - Semi swing. Strong uptrend. 1h uptrend. Local dip. BTC not downtrend.\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'].shift(1) > 6.5)\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_30'].shift(1) * 0.988))\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['bb20_2_low'].shift(1) * 0.996))\n                    item_buy_logic.append(dataframe['rsi_14'].shift(1) < 31.2)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -94.0)\n                    item_buy_logic.append(dataframe['r_96'].shift(1) < -80.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n\n                # Condition #17 - Semi swing. Strong 1h uptrend. BTC not negative. Local dip.\n                elif index == 17:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(4))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(4) > dataframe['ema_200_1h'].shift(8))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(8) > dataframe['ema_200_1h'].shift(12))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018)) # 0.018\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_96'] < -90.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 12.4) # 12.0\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #18 - Semi swing. Uptrend. 1h uptrend. Local dip.\n                elif index == 18:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'] > 6.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 2.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #19 - Quick mode. Uptrend. Local dip.\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'] > 6.8)\n                    item_buy_logic.append(dataframe['cci'] < -180.0)\n                    item_buy_logic.append(dataframe['r_14'] < -95.0)\n                    item_buy_logic.append(qtpylib.crossed_below(dataframe['close'], dataframe['ema_200']))\n\n                # Condition #20 - Swing. Uptrend. Bounce from daily support level\n                elif index == 20:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close_1h'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['sup_level_1d'] * 1.05)\n                    item_buy_logic.append(dataframe['low_1h'] < dataframe['sup_level_1d'] * 0.99)\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['res_level_1h'])\n                    item_buy_logic.append(dataframe['res_level_1d'] > dataframe['sup_level_1d'])\n                    #item_buy_logic.append(dataframe['close'].shift(1) < dataframe['sup_level_1d'])\n                    #item_buy_logic.append(dataframe['close'].shift(2) < dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['volume'] > dataframe['volume'].shift() * 3)\n                    item_buy_logic.append(dataframe['rsi_14'] < 65)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 48)\n                    item_buy_logic.append(dataframe['vol_osc'] > 0)\n\n                    # Confirm uptrend - Heikin-Ashi\n                    item_buy_logic.append(dataframe['open_sha_1d'] < dataframe['close_sha_1d'])\n                    item_buy_logic.append(dataframe['open_sha_1d'].shift(96) < dataframe['close_sha_1d'].shift(96))\n\n                    item_buy_logic.append(dataframe['pivot_1d'] > dataframe['pivot_1d'].shift(96) * 0.95)\n\n                # Condition 21 - Semi swing. Uptrend. Local dip. Movement divergence.\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_25'] * 0.942))\n                    item_buy_logic.append(dataframe['momdiv_buy'])\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.5)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0) # -97.0\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.5)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        return True\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.SMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.SMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\ndef ewo_ema(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityNextGen_TSL/NostalgiaForInfinityNextGen_TSL.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV9 by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 15m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=37365811                                       ##\n##  Kucoin: https://www.kucoin.com/ucenter/signup?rcode=rJTLZ9K                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNextGen_TSL(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.1\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = True\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n    res_timeframe = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_1d = '1d'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.36,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.45,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        3: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.035,\n            \"safe_dips_threshold_2\"     : 0.08,\n            \"safe_dips_threshold_12\"    : 0.2,\n            \"safe_dips_threshold_144\"   : 0.28,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.045,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : 0.34,\n            \"safe_dips_threshold_144\"   : 0.48,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : 0.42,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.97,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.14,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.5,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.3\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.08,\n            \"safe_dips_threshold_2\"     : 0.16,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : 0.8,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.3,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.15\n        },\n        7: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.05,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.2,\n            \"safe_dips_threshold_144\"   : 0.6,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.18,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.15\n        },\n        9: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.07,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : 0.2,\n            \"safe_pump_12h_threshold\"   : 0.3,\n            \"safe_pump_24h_threshold\"   : 0.5,\n            \"safe_pump_36h_threshold\"   : 0.6,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.08,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : 0.2,\n            \"safe_pump_12h_threshold\"   : 0.4,\n            \"safe_pump_24h_threshold\"   : 0.6,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.2,\n            \"safe_pump_12h_threshold\"   : 0.4,\n            \"safe_pump_24h_threshold\"   : 0.6,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.9,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.04,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.3,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.74,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.24,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.24,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.06,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.24,\n            \"safe_dips_threshold_144\"   : 0.38,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : 0.5,\n            \"safe_pump_24h_threshold\"   : 0.7,\n            \"safe_pump_36h_threshold\"   : 1.1,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        }\n    }\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = 0.4\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = 0.44\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = 0.50\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = 0.58\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = 0.66\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = 0.74\n\n    # Sell\n    sell_condition_1_enable = True\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = 0.9\n    sell_pump_threshold_48_2 = 0.7\n    sell_pump_threshold_48_3 = 0.5\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = 0.72\n    sell_pump_threshold_36_2 = 4.0\n    sell_pump_threshold_36_3 = 1.0\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = 0.68\n    sell_pump_threshold_24_2 = 0.62\n    sell_pump_threshold_24_3 = 0.88\n\n    sell_rsi_bb_1 = 74.0\n    sell_rsi_bb_2 = 75.0\n\n    sell_rsi_main_3 = 78.0\n\n    sell_dual_rsi_rsi_4 = 68.4\n    sell_dual_rsi_rsi_1h_4 = 74.6\n\n    sell_ema_relative_5 = 0.024\n    sell_rsi_diff_5 = 4.4\n\n    sell_rsi_under_6 = 74.0\n\n    sell_rsi_1h_7 = 76.7\n\n    sell_bb_relative_8 = 1.1\n\n    #############################################################\n\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        self.coin_metrics['tg_dataframe'].to_html('pct_df.html')\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def is_support(self, row_data) -> bool:\n        if row_data[0] > row_data[1] and row_data[1] > row_data[2] and row_data[2] < row_data[3] and row_data[3] < row_data[4]:\n            return True\n        return False\n\n    def is_resistance(self, row_data) -> bool:\n        if row_data[0] < row_data[1] and row_data[1] < row_data[2] and row_data[2] > row_data[3] and row_data[3] > row_data[4]:\n            return True\n        return False\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 78.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_1_2_2'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_2_2_2'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 82.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_3_2_2'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_4_2_2'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_signal_6_1'\n            elif (current_profit < -0.05) and (max_loss > 0.12):\n                return True, 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_7_2_2'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_2_1'\n                elif (current_profit < -0.05) and (max_loss > 0.12):\n                    return True, 'sell_signal_8_2_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Under & near EMA200, local uptrend move\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.015)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'sell_stoploss_u_e_1'\n\n        # Under EMA200, local strong uptrend move\n        if (\n                (current_profit < -0.08)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 24.0))\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'sell_stoploss_u_e_2'\n\n        # Under EMA200, pair negative, low max rate\n        if (\n                (current_profit < -0.08)\n                and (max_profit < 0.04)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (last_candle['close'] < last_candle['sup_level_1h'])\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (current_time - timedelta(minutes=1440) > trade.open_date_utc)\n        ):\n            return True, 'sell_stoploss_u_e_doom'\n\n        # Under EMA200, pair and BTC negative, low max rate\n        if (\n                (-0.05 > current_profit > -0.09)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (max_profit < 0.005)\n                and (max_loss < 0.09)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -50.0)\n        ):\n            return True, 'sell_stoploss_u_e_b_1'\n\n        # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (\n                (-0.1 > current_profit > -0.2)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (max_profit < 0.05)\n                and (max_loss < 0.2)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['cmf'] < -0.45)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -97.0)\n        ):\n            return True, 'signal_stoploss_u_e_b_2'\n\n        # Under EMA200, pair and BTC negative, low max rate\n        if (\n                (-0.04 > current_profit > -0.07)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (max_profit < 0.005)\n                and (max_loss < 0.07)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['r_480'] < -50.0)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n        ):\n            return True, 'sell_stoploss_u_e_b_3'\n\n\n        # Under EMA200, pair & BTC negative, low max rate, short trade duration\n        if (\n                (-0.04 > current_profit > -0.09)\n                and (max_profit < 0.005)\n                and (max_loss < 0.09)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0 )\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.1)\n                and (last_candle['r_480'] < -75.0)\n                and (last_candle['close'] < last_candle['sup_level_1h'])\n                and (current_time - timedelta(minutes=60) < trade.open_date_utc)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n        ):\n            return True, 'sell_stoploss_u_e_b_4'\n\n        # Under EMA200, pair & BTC negative, low max rate, short trade duration\n        if (\n                (-0.04 > current_profit > -0.09)\n                and (max_profit < 0.015)\n                and (max_loss < 0.09)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0 )\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.2)\n                and (last_candle['close'] < last_candle['sup_level_1h'])\n                and (current_time - timedelta(minutes=180) < trade.open_date_utc)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n        ):\n            return True, 'sell_stoploss_u_e_b_5'\n\n        # Under EMA200, pair & BTC negative, low max rate, short trade duration\n        if (\n                (-0.04 > current_profit > -0.1)\n                and (max_profit < 0.015)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0 )\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.25)\n                and (last_candle['r_480'] < -75.0)\n                and (last_candle['close'] < last_candle['sup_level_1h'])\n                and (current_time - timedelta(minutes=60) < trade.open_date_utc)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n        ):\n            return True, 'sell_stoploss_u_e_b_6'\n\n        return False, None\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0:\n                        return True, 'sell_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_12_2'\n                    elif (last_candle['rsi_14'] < 31.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bull_12_3'\n                    elif (last_candle['rsi_14'] < 31.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 32.0:\n                        return True, 'sell_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bull_11_3'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_11_4'\n                elif 0.12 > current_profit >= 0.1:\n                    if last_candle['rsi_14'] < 40.0:\n                        return True, 'sell_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_10_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bull_10_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_10_4'\n                elif 0.1 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'sell_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_9_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_o_bull_9_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_8_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_o_bull_7_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bull_6_1'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bull_5_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_4_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_3_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_2_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.16) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_2_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_2_4'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bull_1_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bull_1_4'\n            else:\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 31.0:\n                        return True, 'sell_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_12_2'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bear_12_3'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 33.0:\n                        return True, 'sell_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_11_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bear_11_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_11_4'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 41.0:\n                        return True, 'sell_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_10_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bear_10_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_10_4'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 51.0:\n                        return True, 'sell_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_o_bear_9_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_3_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_2_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_2_4'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_1_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_o_bear_1_4'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 31.0:\n                        return True, 'signal_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_12_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bull_12_3'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 33.0:\n                        return True, 'sell_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_11_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bull_11_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_11_4'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 41.0:\n                        return True, 'sell_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_10_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bull_10_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_10_4'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 51.0:\n                        return True, 'sell_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_u_bull_9_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'sell_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if last_candle['rsi_14'] < 49.0:\n                        return True, 'sell_profit_u_bull_7_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if last_candle['rsi_14'] < 47.0:\n                        return True, 'sell_profit_u_bull_6_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if last_candle['rsi_14'] < 45.0:\n                        return True, 'sell_profit_u_bull_5_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if last_candle['rsi_14'] < 43.0:\n                        return True, 'sell_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if last_candle['rsi_14'] < 39.0:\n                        return True, 'sell_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_3_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if last_candle['rsi_14'] < 35.0:\n                        return True, 'sell_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.16) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_2_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bull_1_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bull_1_4'\n            else:\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 32.0:\n                        return True, 'sell_profit_u_bear_12_1'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.28) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_12_2'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bear_12_3'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_12_4'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 34.0:\n                        return True, 'sell_profit_u_bear_11_1'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.24) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_11_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bear_11_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_11_4'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 42.0:\n                        return True, 'sell_profit_u_bear_10_1'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.22) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_10_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bear_10_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_10_4'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 54.0:\n                        return True, 'sell_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['rsi_14_1h'] < 43.0):\n                        return True, 'sell_profit_u_bear_9_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_9_4'\n                elif 0.09 > current_profit >= 0.08:\n                    if last_candle['rsi_14'] < 52.0:\n                        return True, 'sell_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_8_2'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['rsi_14_1h'] < 42.0):\n                        return True, 'sell_profit_u_bear_8_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_8_4'\n                elif 0.08 > current_profit >= 0.07:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'sell_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_7_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['rsi_14_1h'] < 41.0):\n                        return True, 'sell_profit_u_bear_7_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_7_4'\n                elif 0.07 > current_profit >= 0.06:\n                    if last_candle['rsi_14'] < 48.0:\n                        return True, 'sell_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_1h'] < 40.0):\n                        return True, 'sell_profit_u_bear_6_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if last_candle['rsi_14'] < 46.0:\n                        return True, 'sell_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12) and (last_candle['rsi_14_1h'] < 51.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_5_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] < 39.0):\n                        return True, 'sell_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if last_candle['rsi_14'] < 44.0:\n                        return True, 'sell_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.13) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_4_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] < 38.0):\n                        return True, 'sell_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if last_candle['rsi_14'] < 40.0:\n                        return True, 'sell_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.14) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_3_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] < 37.0):\n                        return True, 'sell_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if last_candle['rsi_14'] < 36.0:\n                        return True, 'sell_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_2_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['rsi_14_1h'] < 36.0):\n                        return True, 'sell_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']):\n                        return True, 'sell_profit_u_bear_1_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 35.0):\n                        return True, 'sell_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.15) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['ema_12'] < last_candle['ema_26']) and (last_candle['ema_25'] < last_candle['ema_50']) and (last_candle['close'] < last_candle['sup_level_1h']):\n                        return True, 'sell_profit_u_bear_1_4'\n\n        return False, None\n\n    def sell_r(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.4:\n                return True, 'sell_profit_w_1_1'\n            elif (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_1_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_1_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 81.0):\n                return True, 'sell_profit_w_1_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.96):\n                return True, 'sell_profit_w_1_5'\n            elif (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_480_1h'] > -3.0):\n                return True, 'sell_profit_w_1_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_7'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_1_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 190.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_1_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.95) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 150.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_1_11'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_1h'] < -0.25):\n                return True, 'sell_profit_w_1_12'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 400.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_13'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_1_14'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_480_1h'] > -12.0) and (last_candle['rsi_14'] > 79.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_15'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_1_16'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_1_17'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.5:\n                return True, 'sell_profit_w_2_1'\n            elif (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_2_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_2_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 80.5):\n                return True, 'sell_profit_w_2_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.958):\n                return True, 'sell_profit_w_2_5'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_480_1h'] > -3.5):\n                return True, 'sell_profit_w_2_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_2_7'\n            elif (last_candle['r_14'] > -0.2) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_2_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.86) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_2_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.93) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_2_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 140.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_2_11'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_1h'] < -0.23):\n                return True, 'sell_profit_w_2_12'\n            elif (last_candle['r_14'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 360.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_13'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_2_14'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_480_1h'] > -14.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_2_15'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_w_2_16'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_2_17'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.6:\n                return True, 'sell_profit_w_3_1'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_3_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_3_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'sell_profit_w_3_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.956):\n                return True, 'sell_profit_w_3_5'\n            elif (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_3_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_3_7'\n            elif (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_3_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.84) and (last_candle['cci'] > 170.0) and (last_candle['r_480_1h'] > -12.0):\n                return True, 'sell_profit_w_3_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.92) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_3_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.87) and (last_candle['cci'] > 130.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_3_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf_1h'] < -0.22):\n                return True, 'sell_profit_w_3_12'\n            elif (last_candle['r_14'] >= -6.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_13'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_3_14'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_480_1h'] > -16.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_3_15'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 46.0):\n                return True, 'sell_profit_w_3_16'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] < 56.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 46.0):\n                return True, 'sell_profit_w_3_17'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.7:\n                return True, 'sell_profit_w_4_1'\n            elif (last_candle['r_480'] > -5.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_4_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_4_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.5):\n                return True, 'sell_profit_w_4_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.954):\n                return True, 'sell_profit_w_4_5'\n            elif (last_candle['r_480'] > -7.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] > -4.5):\n                return True, 'sell_profit_w_4_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_4_7'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_4_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.83) and (last_candle['cci'] > 170.0) and (last_candle['r_480_1h'] > -13.0):\n                return True, 'sell_profit_w_4_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.91) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_4_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.86) and (last_candle['cci'] > 120.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_4_11'\n            elif (last_candle['r_14'] > -1.5) and (last_candle['rsi_14'] < 54.0) and (last_candle['cmf_1h'] < -0.21):\n                return True, 'sell_profit_w_4_12'\n            elif (last_candle['r_14'] >= -9.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_13'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_4_14'\n            elif (last_candle['r_14'] > -12.0) and (last_candle['r_480_1h'] > -18.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_4_15'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 48.0):\n                return True, 'sell_profit_w_4_16'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] < 57.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 47.0):\n                return True, 'sell_profit_w_4_17'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -1.0:\n                return True, 'sell_profit_w_5_1'\n            elif (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_5_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_5_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_5_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.952):\n                return True, 'sell_profit_w_5_5'\n            elif (last_candle['r_480'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -5.0):\n                return True, 'sell_profit_w_5_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_5_7'\n            elif (last_candle['r_14'] > -0.6) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_5_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.82) and (last_candle['cci'] > 170.0) and (last_candle['r_480_1h'] > -14.0):\n                return True, 'sell_profit_w_5_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.92) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_5_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 120.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_5_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 56.0) and (last_candle['cmf_1h'] < -0.2):\n                return True, 'sell_profit_w_5_12'\n            elif (last_candle['r_14'] >= -6.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 300.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_13'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_5_14'\n            elif (last_candle['r_14'] > -14.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_5_15'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] < 56.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_16'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] < 54.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_w_5_17'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'sell_profit_w_6_1'\n            elif (last_candle['r_480'] > -6.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_6_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 53.0):\n                return True, 'sell_profit_w_6_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.5):\n                return True, 'sell_profit_w_6_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.95):\n                return True, 'sell_profit_w_6_5'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -6.0):\n                return True, 'sell_profit_w_6_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 75.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_6_7'\n            elif (last_candle['r_14'] > -0.7) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_6_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.83) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -12.0):\n                return True, 'sell_profit_w_6_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.93) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_6_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.84) and (last_candle['cci'] > 100.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_6_11'\n            elif (last_candle['r_14'] > -2.5) and (last_candle['rsi_14'] < 58.0) and (last_candle['cmf_1h'] < -0.19):\n                return True, 'sell_profit_w_6_12'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_13'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_6_14'\n            elif (last_candle['r_14'] > -12.0) and (last_candle['r_480_1h'] > -18.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_6_15'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['rsi_14_1h'] < 48.0):\n                return True, 'sell_profit_w_6_16'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['rsi_14'] < 52.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 43.0):\n                return True, 'sell_profit_w_6_17'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'sell_profit_w_7_1'\n            elif (last_candle['r_480'] > -7.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_7_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_7_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_7_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.952):\n                return True, 'sell_profit_w_7_5'\n            elif (last_candle['r_480'] > -12.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -7.0):\n                return True, 'sell_profit_w_7_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_7_7'\n            elif (last_candle['r_14'] > -0.8) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_7_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.84) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_7_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.94) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_7_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.83) and (last_candle['cci'] > 100.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_7_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 60.0) and (last_candle['cmf_1h'] < -0.18):\n                return True, 'sell_profit_w_7_12'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 340.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_13'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 280.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_7_14'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_480_1h'] > -16.0) and (last_candle['rsi_14'] > 77.5) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_7_15'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] < 46.0):\n                return True, 'sell_profit_w_7_16'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_7_17'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'sell_profit_w_8_1'\n            elif (last_candle['r_480'] > -7.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_8_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_8_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_8_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.954):\n                return True, 'sell_profit_w_8_5'\n            elif (last_candle['r_480'] > -14.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_8_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_8_7'\n            elif (last_candle['r_14'] > -0.6) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_8_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 180.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_8_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.95) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_8_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 110.0) and (last_candle['r_480'] < -45.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_8_11'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 62.0) and (last_candle['cmf_1h'] < -0.15):\n                return True, 'sell_profit_w_8_12'\n            elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 360.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 300.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_8_14'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_480_1h'] > -14.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_8_15'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_w_8_16'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_17'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'sell_profit_w_9_1'\n            elif (last_candle['r_480'] > -6.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_9_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_9_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'sell_profit_w_9_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.956):\n                return True, 'sell_profit_w_9_5'\n            elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -9.0):\n                return True, 'sell_profit_w_9_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_9_7'\n            elif (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_9_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 190.0) and (last_candle['r_480_1h'] > -10.0):\n                return True, 'sell_profit_w_9_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_9_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.87) and (last_candle['cci'] > 120.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_9_11'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 58.0) and (last_candle['cmf_1h'] < -0.19):\n                return True, 'sell_profit_w_9_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 380.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_9_14'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_480_1h'] > -12.0) and (last_candle['rsi_14'] > 78.5) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_9_15'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_w_9_16'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_9_17'\n        elif 0.12 > current_profit >= 0.1:\n            if last_candle['r_480'] > -1.0:\n                return True, 'sell_profit_w_10_1'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_10_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_10_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 80.5):\n                return True, 'sell_profit_w_10_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.96):\n                return True, 'sell_profit_w_10_5'\n            elif (last_candle['r_480'] > -18.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['r_480_1h'] > -11.0):\n                return True, 'sell_profit_w_10_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_10_7'\n            elif (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_10_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_10_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_10_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.88) and (last_candle['cci'] > 130.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_10_11'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf_1h'] < -0.22):\n                return True, 'sell_profit_w_10_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 400.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 340.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_10_14'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_480_1h'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 330.0):\n                return True, 'sell_profit_w_10_15'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_16'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 37.0):\n                return True, 'sell_profit_w_10_17'\n        elif 0.2 > current_profit >= 0.12:\n            if last_candle['r_480'] > -0.5:\n                return True, 'sell_profit_w_11_1'\n            elif (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_11_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_w_11_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 81.0):\n                return True, 'sell_profit_w_11_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.965):\n                return True, 'sell_profit_w_11_5'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -7.0):\n                return True, 'sell_profit_w_11_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_11_7'\n            elif (last_candle['r_14'] > -0.2) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_11_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_11_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_11_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.89) and (last_candle['cci'] > 140.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_11_11'\n            elif (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.25):\n                return True, 'sell_profit_w_11_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 420.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 360.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_11_14'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_480_1h'] > -8.0) and (last_candle['rsi_14'] > 79.5) and (last_candle['cci'] > 340.0):\n                return True, 'sell_profit_w_11_15'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_11_16'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 36.0):\n                return True, 'sell_profit_w_11_17'\n        elif current_profit >= 0.2:\n            if last_candle['r_480'] > -0.4:\n                return True, 'sell_profit_w_12_1'\n            elif (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_12_2'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] < 32.0):\n                return True, 'sell_profit_w_12_3'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 81.5):\n                return True, 'sell_profit_w_12_4'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.97):\n                return True, 'sell_profit_w_12_5'\n            elif (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] > -4.0):\n                return True, 'sell_profit_w_12_6'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_12_7'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 220.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_w_12_8'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 200.0) and (last_candle['r_480_1h'] > -8.0):\n                return True, 'sell_profit_w_12_9'\n            elif (last_candle['r_480'] < -65.0) and (last_candle['cti'] > 0.96) and (last_candle['rsi_14'] > 79.0):\n                return True, 'sell_profit_w_12_10'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cci'] > 150.0) and (last_candle['r_480'] < -50.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_12_11'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_1h'] < -0.28):\n                return True, 'sell_profit_w_12_12'\n            elif (last_candle['r_14'] >= -0.1) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 440.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_13'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 380.0) and (last_candle['hl_pct_change_48_1h'] > 0.5):\n                return True, 'sell_profit_w_12_14'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_480_1h'] > -6.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 350.0):\n                return True, 'sell_profit_w_12_15'\n            elif (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] < 32.0) and (last_candle['rsi_14_1h'] < 36.0):\n                return True, 'sell_profit_w_12_16'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['r_480'] < -50.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['rsi_14_1h'] < 35.0):\n                return True, 'sell_profit_w_12_17'\n\n        return False, None\n\n    def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_1_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.9):\n                return True, 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_1_6'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 52.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_1_8'\n        elif 0.03 > current_profit >= 0.02:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_2_1'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_2_3'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] < -0.8):\n                return True, 'sell_profit_t_2_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_2_5'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_2_6'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_1h'] < 44.0):\n                return True, 'sell_profit_t_2_7'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_2_8'\n        elif 0.04 > current_profit >= 0.03:\n            if (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_3_1'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_3_2'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_3_3'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_1h'] < 49.0) and (last_candle['cti_1h'] < -0.6):\n                return True, 'sell_profit_t_3_4'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_3_5'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_3_6'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['rsi_14_1h'] < 43.0):\n                return True, 'sell_profit_t_3_7'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 48.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_3_8'\n        elif 0.05 > current_profit >= 0.04:\n            if (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 37.0):\n                return True, 'sell_profit_t_4_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 47.0):\n                return True, 'sell_profit_t_4_2'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_4_3'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_4_4'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_4_5'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_4_6'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_1h'] < 42.0):\n                return True, 'sell_profit_t_4_7'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_4_8'\n        elif 0.06 > current_profit >= 0.05:\n            if (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_5_1'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_t_5_2'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_5_3'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_5_4'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_5_5'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_5_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 35.0) and (last_candle['rsi_14_1h'] < 41.0):\n                return True, 'sell_profit_t_5_7'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_5_8'\n        elif 0.07 > current_profit >= 0.06:\n            if (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_6_1'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 49.0):\n                return True, 'sell_profit_t_6_2'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_6_3'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_6_4'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_6_5'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_6_6'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 34.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_t_6_7'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 42.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_6_8'\n        elif 0.08 > current_profit >= 0.07:\n            if (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_7_1'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_t_7_2'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_7_3'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_7_4'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_7_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_7_6'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 33.0) and (last_candle['rsi_14_1h'] < 39.0):\n                return True, 'sell_profit_t_7_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_7_8'\n        elif 0.09 > current_profit >= 0.08:\n            if (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_8_1'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 51.0):\n                return True, 'sell_profit_t_8_2'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_8_3'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_8_4'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_8_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_8_6'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 32.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_t_8_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_8_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_9_1'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_t_9_2'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_9_3'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_9_4'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_9_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_9_6'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 31.0) and (last_candle['rsi_14_1h'] < 37.0):\n                return True, 'sell_profit_t_9_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_9_8'\n        elif 0.12 > current_profit >= 0.1:\n            if (max_profit > (current_profit + 0.09)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_10_1'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_t_10_2'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_10_3'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_10_4'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_10_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_10_6'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14'] < 30.0) and (last_candle['rsi_14_1h'] < 36.0):\n                return True, 'sell_profit_t_10_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_10_8'\n        elif 0.2 > current_profit >= 0.12:\n            if (max_profit > (current_profit + 0.095)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_11_1'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_11_2'\n            elif (max_profit > (current_profit + 0.14)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_11_3'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_11_4'\n            elif (max_profit > (current_profit + 0.095)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_11_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_11_6'\n            elif (max_profit > (current_profit + 0.12)) and (last_candle['rsi_14'] < 29.0) and (last_candle['rsi_14_1h'] < 35.0):\n                return True, 'sell_profit_t_11_7'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 32.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_11_8'\n        elif current_profit >= 0.2:\n            if (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_12_1'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_t_12_2'\n            elif (max_profit > (current_profit + 0.16)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_12_3'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14_1h'] < 31.0) and (last_candle['cti_1h'] < -0.85):\n                return True, 'sell_profit_t_12_4'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_12_5'\n            elif (max_profit > (current_profit + 0.1)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.1) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_t_12_6'\n            elif (max_profit > (current_profit + 0.13)) and (last_candle['rsi_14'] < 28.0) and (last_candle['rsi_14_1h'] < 34.0):\n                return True, 'sell_profit_t_12_7'\n            elif (max_profit > (current_profit + 0.11)) and (last_candle['rsi_14'] < 32.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0)and (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n                return True, 'sell_profit_t_12_8'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['close'] > last_candle['ema_200']):\n            if 0.02 > current_profit >= 0.012:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):\n                    return True, 'sell_profit_d_o_1_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_3'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_2_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_3'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_3_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_3'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):\n                    return True, 'sell_profit_d_o_4_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_4_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_3'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_5_1'\n                elif (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_o_5_2'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_3'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_6_1'\n                elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_6_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_3'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_7_1'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_o_7_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_3'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):\n                    return True, 'sell_profit_d_o_8_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_3'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_9_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_3'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_10_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_o_10_2'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_3'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_11_1'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):\n                    return True, 'sell_profit_d_o_11_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_3'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_12_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_12_2'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_3'\n        else:\n            if 0.02 > current_profit >= 0.012:\n                if (last_candle['rsi_14'] < 55.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_1_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_1_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_3'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_2_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_2_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_3'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_3_1'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_3'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_4_1'\n                elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_4_2'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_3'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_5_1'\n                elif (last_candle['rsi_14'] < 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                    return True, 'sell_profit_d_u_5_2'\n                elif (last_candle['rsi_14'] < 53.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_3'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_6_1'\n                elif (last_candle['rsi_14'] < 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):\n                    return True, 'sell_profit_d_u_6_2'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_3'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 55.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_7_1'\n                elif (last_candle['rsi_14'] < 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_7_2'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_3'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_8_1'\n                elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_8_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_3'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 53.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_9_1'\n                elif (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_9_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_3'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_10_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_2'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_3'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_11_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_2'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_3'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_12_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_u_12_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_3'\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_48_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_6_4'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_6_5'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_48_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_5_4'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_5_5'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_48_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_4_4'\n                    elif (last_candle['rsi_14'] > 73.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_4_5'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_48_1_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_3_4'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_3_5'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_48_1_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_2_4'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_2_5'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_48_1_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_48_1_1_4'\n                    elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bull_48_1_1_5'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_48_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_6_4'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_6_5'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_48_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_5_4'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_5_5'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_48_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_4_4'\n                    elif (last_candle['rsi_14'] > 72.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_4_5'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_48_1_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_3_4'\n                    elif (last_candle['rsi_14'] > 74.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_3_5'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_48_1_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_2_4'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_2_5'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_48_1_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_48_1_1_4'\n                    elif (last_candle['rsi_14'] > 78.0) and (last_candle['r_14'] >= -0.1):\n                        return True, 'sell_profit_p_bear_48_1_1_5'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.8):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_2_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.5):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_12_1'\n                    elif (last_candle['rsi_14'] > 80.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_12_2'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_11_1'\n                    elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_10_1'\n                    elif (last_candle['rsi_14'] > 78.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_3_9_1'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_8_1'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_7_1'\n                    elif (last_candle['rsi_14'] > 74.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_6_1'\n                    elif (last_candle['rsi_14'] > 72.0) and (last_candle['r_14'] > -2.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_1'\n                    elif (last_candle['rsi_14'] > 70.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_4_1'\n                    elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bull_48_3_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_3_1'\n                    elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bull_48_3_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                    elif (last_candle['rsi_14'] > 72.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_1_2'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_12_1'\n                    elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_12_2'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_11_1'\n                    elif (last_candle['rsi_14'] > 78.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_10_1'\n                    elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bear_48_3_9_1'\n                    elif (last_candle['rsi_14'] > 76.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_8_1'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] > -0.1) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_7_1'\n                    elif (last_candle['rsi_14'] > 73.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_6_1'\n                    elif (last_candle['rsi_14'] > 71.0) and (last_candle['r_14'] > -2.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_1'\n                    elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_4_1'\n                    elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_3_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_3_1'\n                    elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -10.0) and (last_candle['cmf_1h'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_3_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_2_1'\n                    elif (last_candle['rsi_14'] > 71.0) and (last_candle['r_14'] > -5.0) and (last_candle['cmf_1h'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_1'\n                    elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] > -1.0) and (last_candle['cmf_1h'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.72):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_36_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_36_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_36_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_36_1_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_36_1_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_36_1_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_36_1_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_36_1_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_36_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_36_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_36_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_36_1_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_36_1_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_36_1_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_36_1_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_36_1_1_4'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.68):\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_24_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_24_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_24_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_24_1_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_24_1_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_24_1_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bull_24_1_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bull_24_1_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_24_1_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_24_1_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_24_1_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_24_1_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_24_1_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_24_1_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'sell_profit_p_bear_24_1_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'sell_profit_p_bear_24_1_1_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.05 > current_profit > 0.01) and (last_candle['hl_pct_change_24_1h'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'sell_profit_p_d_1'\n\n        elif (0.05 > current_profit > 0.02) and (last_candle['hl_pct_change_36_1h'] > 1.2) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'sell_profit_p_d_2'\n\n        elif (0.06 > current_profit > 0.04) and (last_candle['hl_pct_change_48_1h'] > 1.4) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'sell_profit_p_d_3'\n\n        return False, None\n\n    def sell_pump_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.03 > current_profit > 0.01) and (last_candle['hl_pct_change_6_1h'] > 0.16) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.0) and (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_p_t_1'\n\n        return False, None\n\n    def sell_pump_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.005)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_1'\n            elif (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.02)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_36_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\n            if (\n                    (-0.05 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n                    and (last_candle['rsi_14'] < 40.0)\n            ):\n                return True, 'sell_stoploss_p_36_2_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_24_1_1'\n\n\n        return False, None\n\n    def sell_duration(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (current_time - timedelta(minutes=1440) > trade.open_date_utc):\n            if current_profit >= 0.2:\n                if (last_candle['rsi_14'] > 81.5):\n                    return True, 'sell_profit_l_12_1'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] > 81.0):\n                    return True, 'sell_profit_l_11_1'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] > 80.5):\n                    return True, 'sell_profit_l_10_1'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] > 80.0):\n                    return True, 'sell_profit_l_9_1'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] > 79.5):\n                    return True, 'sell_profit_l_8_1'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] > 79.0):\n                    return True, 'sell_profit_l_7_1'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] > 78.5):\n                    return True, 'sell_profit_l_6_1'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] > 78.0):\n                    return True, 'sell_profit_l_5_1'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] > 79.0):\n                    return True, 'sell_profit_l_4_1'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] > 80.0):\n                    return True, 'sell_profit_l_3_1'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] > 80.5):\n                    return True, 'sell_profit_l_2_1'\n            elif 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] > 81.0):\n                    return True, 'sell_profit_l_1_1'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sells\n        sell, signal_name = self.sell_r(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Sell logic for pumped pairs\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, descending\n        sell, signal_name = self.sell_pump_dec(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, trailing\n        sell, signal_name = self.sell_pump_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, stoploss\n        sell, signal_name = self.sell_pump_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trade duration based sell logic\n        sell, signal_name = self.sell_duration(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EMAs\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # EWO\n        informative_1h['ewo'] = ewo(informative_1h, 50, 200)\n        informative_1h['ewo_ema'] = ewo_ema(informative_1h, 50, 200)\n\n        # S/R\n        res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        # informative_1h['res_level_high'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        # informative_1h['res_level_low'] = Series(np.where(res_series, informative_1h['low'], float('NaN'))).ffill()\n        informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        # informative_1h['sup_level_high'] = Series(np.where(sup_series, informative_1h['high'], float('NaN'))).ffill()\n        # informative_1h['sup_level_low'] = Series(np.where(sup_series, informative_1h['low'], float('NaN'))).ffill()\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n        informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)\n        informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n\n        # RSI\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # EMAs\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n        dataframe['ewo_ema'] = ewo_ema(dataframe, 50, 200)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,3)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,48)\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump_6h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params[\"safe_pump_6h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_12h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params[\"safe_pump_12h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_24h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params[\"safe_pump_24h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_36h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params[\"safe_pump_36h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_48h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params[\"safe_pump_48h_threshold\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(4).min()) / dataframe['open'].rolling(4).min()) > 0.038)\n                    item_buy_logic.append(dataframe['rsi_14'] < 33.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 30.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 50.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -99.0)\n\n                # Condition #2 - Semi swing. Local dip. Uptrend.\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.025))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))\n\n                # Condition #3 - Semi swing. Local dip. Strong uptrend.\n                elif index == 3:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_25'] * 0.952)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.0)\n\n                # Condition #4 - Semi swing. Local dip. Uptrend. Strict pump & dip protections.\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.03))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.8)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -35.0)\n\n                # Condition #5 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 5:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_26'] * 0.966)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 4.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 26.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n                    item_buy_logic.append(dataframe['mfi'] < 20.0)\n\n                # Condition #6 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.958)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.4)\n                    item_buy_logic.append(dataframe['cci'] < -190.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 4.0)\n                    item_buy_logic.append((dataframe['rsi_14_1h'] + dataframe['rsi_14']) < 74.0)\n\n                # Condition #7 - Semi swing. 1h uptrend.\n                elif index == 7:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(4))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(4) > dataframe['ema_200_1h'].shift(8))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.026))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))\n\n                # Condition #8 - Semi swing. Local dip. 1h minor dip.\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * 0.95))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -92.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.1)\n\n                # Condition #9 - Semi swing. Local deep. Uptrend, 1h uptrend.\n                elif index == 9:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.97))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['ewo_ema'] > 4.2)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -94.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 2.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.75)\n\n                # Condition #10 - Semi swing. Local dip.\n                elif index == 10:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.942)\n                    item_buy_logic.append(dataframe['rsi_14'] < 25.5)\n                    item_buy_logic.append(dataframe['crsi'] > 8.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -75.0)\n\n                # Condition #11 - Semi swing. Deep local dip. Mild uptrend.\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.926)\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.25)\n\n                # Condition #12 - Semi swing. Downtrend. Dip.\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.954))\n                    item_buy_logic.append(dataframe['ewo_ema'] < -8.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -94.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 3.0)\n\n                # Condition #13 - Semi swing. 1h uptrend. BTC not downtrend.\n                elif index == 13:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.025))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))\n\n                # Condition #14 - Semi swing. Mild uptrend. 1h uptrend. Local dip.\n                elif index == 14:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'] > 2.0)\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['ema_20'].shift(1) * 0.992))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['close'].shift(1)))\n                    item_buy_logic.append(dataframe['cmf'].shift(1) < -0.48)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 7.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.0)\n\n                # Condition #15 - Semi swing. Downtrend.Local dip.\n                elif index == 15:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < dataframe['ema_20'].shift(1) * 0.996)\n                    item_buy_logic.append(dataframe['ewo_ema'].shift(1) < -10.4)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -90.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 2.0)\n\n                # Condition #16 - Semi swing. Strong uptrend. 1h uptrend. Local dip. BTC not downtrend.\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_ema'].shift(1) > 6.6)\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_30'].shift(1) * 0.988))\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['bb20_2_low'].shift(1) * 0.982))\n                    item_buy_logic.append(dataframe['rsi_14'].shift(1) < 32.0)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -94.0)\n                    item_buy_logic.append(dataframe['ewo_ema_1h'] > 2.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        new_stop = 1\n\n        if (current_profit > 0.2):\n            new_stop = 0.05\n        elif (current_profit > 0.1):\n            new_stop = 0.03\n        elif (current_profit > 0.06):\n            new_stop = 0.02\n        elif (current_profit > 0.03):\n            new_stop = 0.01\n\n        return new_stop\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        return True\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.SMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.SMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\ndef ewo_ema(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data"
  },
  {
    "path": "strategies/NostalgiaForInfinityNextV7155/NostalgiaForInfinityNextV7155.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=37365811                                       ##\n##  Kucoin: https://www.kucoin.com/ucenter/signup?rcode=rJTLZ9K                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNextV7155(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.50\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe_1h = '1h'\n    info_timeframe_1d = '1d'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": False,\n        \"buy_condition_36_enable\": False,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        \"buy_condition_44_enable\": True,\n        \"buy_condition_45_enable\": True,\n        \"buy_condition_46_enable\": True,\n        \"buy_condition_47_enable\": True,\n        \"buy_condition_48_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    profit_target_params = {\n        #############\n        # Enable/Disable conditions\n        \"profit_target_1_enable\": False,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"70\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        3: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"80\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        8: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.016,\n            \"safe_dips_threshold_2\"     : 0.11,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.05\n        },\n        9: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        10: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"35\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.016,\n            \"safe_dips_threshold_2\"     : 0.11,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.022,\n            \"safe_dips_threshold_2\"     : 0.18,\n            \"safe_dips_threshold_12\"    : 0.34,\n            \"safe_dips_threshold_144\"   : 0.56,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.3\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.5\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"80\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.027,\n            \"safe_dips_threshold_2\"     : 0.26,\n            \"safe_dips_threshold_12\"    : 0.44,\n            \"safe_dips_threshold_144\"   : 0.84,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        18: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.026,\n            \"safe_dips_threshold_2\"     : 0.24,\n            \"safe_dips_threshold_12\"    : 0.42,\n            \"safe_dips_threshold_144\"   : 0.8,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        19: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.025,\n            \"safe_dips_threshold_2\"     : 0.23,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : 0.7,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"15\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.022,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.84,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        24: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.016,\n            \"safe_dips_threshold_2\"     : 0.11,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.22,\n            \"safe_dips_threshold_12\"    : 0.38,\n            \"safe_dips_threshold_144\"   : 0.66,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"pivot\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.016,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.11,\n            \"safe_dips_threshold_144\"   : 0.22,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.35\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.99,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.32\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"pivot\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.01\n        },\n        30: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.14,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : 0.5,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"80\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.99,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        37: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.5\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        40: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.2\n        },\n        41: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.015,\n            \"safe_dips_threshold_2\"     : 0.1,\n            \"safe_dips_threshold_12\"    : 0.24,\n            \"safe_dips_threshold_144\"   : 0.42,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        42: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.027,\n            \"safe_dips_threshold_2\"     : 0.26,\n            \"safe_dips_threshold_12\"    : 0.44,\n            \"safe_dips_threshold_144\"   : 0.84,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        43: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.22,\n            \"safe_dips_threshold_12\"    : 0.38,\n            \"safe_dips_threshold_144\"   : 0.66,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        44: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        45: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"15\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        46: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.25,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 2.0\n        },\n        47: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.025,\n            \"safe_dips_threshold_2\"     : 0.05,\n            \"safe_dips_threshold_12\"    : 0.25,\n            \"safe_dips_threshold_144\"   : 0.5,\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        48: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n\n        }\n    }\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = 2.2\n    buy_pump_threshold_10_24 = 0.42\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = 2.0\n    buy_pump_threshold_10_36 = 0.58\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = 2.0\n    buy_pump_threshold_10_48 = 0.8\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = 2.2\n    buy_pump_threshold_20_24 = 0.46\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = 2.0\n    buy_pump_threshold_20_36 = 0.6\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = 2.0\n    buy_pump_threshold_20_48 = 0.81\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = 2.2\n    buy_pump_threshold_30_24 = 0.5\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = 2.0\n    buy_pump_threshold_30_36 = 0.62\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = 2.0\n    buy_pump_threshold_30_48 = 0.82\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = 2.2\n    buy_pump_threshold_40_24 = 0.54\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = 2.0\n    buy_pump_threshold_40_36 = 0.63\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = 2.0\n    buy_pump_threshold_40_48 = 0.84\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = 1.75\n    buy_pump_threshold_50_24 = 0.6\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = 1.75\n    buy_pump_threshold_50_36 = 0.64\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = 1.75\n    buy_pump_threshold_50_48 = 0.85\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = 1.75\n    buy_pump_threshold_60_24 = 0.62\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = 1.75\n    buy_pump_threshold_60_36 = 0.66\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = 1.75\n    buy_pump_threshold_60_48 = 0.9\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = 1.75\n    buy_pump_threshold_70_24 = 0.63\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = 1.75\n    buy_pump_threshold_70_36 = 0.67\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = 1.75\n    buy_pump_threshold_70_48 = 0.95\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = 1.75\n    buy_pump_threshold_80_24 = 0.64\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = 1.75\n    buy_pump_threshold_80_36 = 0.68\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = 1.75\n    buy_pump_threshold_80_48 = 1.0\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = 1.75\n    buy_pump_threshold_90_24 = 0.65\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = 1.75\n    buy_pump_threshold_90_36 = 0.69\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = 1.75\n    buy_pump_threshold_90_48 = 1.1\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = 1.7\n    buy_pump_threshold_100_24 = 0.66\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = 1.7\n    buy_pump_threshold_100_36 = 0.7\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = 1.4\n    buy_pump_threshold_100_48 = 1.6\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = 1.7\n    buy_pump_threshold_110_24 = 0.7\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = 1.7\n    buy_pump_threshold_110_36 = 0.74\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = 1.4\n    buy_pump_threshold_110_48 = 1.8\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = 1.7\n    buy_pump_threshold_120_24 = 0.78\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = 1.7\n    buy_pump_threshold_120_36 = 0.78\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = 1.4\n    buy_pump_threshold_120_48 = 2.0\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = 0.4\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = 0.44\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = 0.50\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = 0.58\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = 0.66\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = 0.74\n\n    buy_1_min_inc = 0.022\n    buy_1_rsi_max = 32.0\n    buy_2_r_14_max = -75.0\n    buy_1_mfi_max = 46.0\n    buy_1_rsi_1h_min = 30.0\n    buy_1_rsi_1h_max = 84.0\n\n    buy_2_rsi_1h_diff = 39.0\n    buy_2_mfi = 49.0\n    buy_2_cti_max = -0.9\n    buy_2_r_480_min = -95.0\n    buy_2_r_480_max = -46.0\n    buy_2_cti_1h_max = 0.9\n    buy_2_volume = 2.0\n\n    buy_3_bb40_bbdelta_close = 0.057\n    buy_3_bb40_closedelta_close = 0.023\n    buy_3_bb40_tail_bbdelta = 0.418\n    buy_3_cti_max = -0.5\n    buy_3_cci_36_osc_min = -0.25\n    buy_3_crsi_1h_min = 20.0\n    buy_3_r_480_1h_min = -48.0\n    buy_3_cti_1h_max = 0.82\n\n    buy_4_bb20_close_bblowerband = 0.98\n    buy_4_bb20_volume = 10.0\n    buy_4_cti_max = -0.8\n\n    buy_5_ema_rel = 0.84\n    buy_5_ema_open_mult = 0.02\n    buy_5_bb_offset = 0.999\n    buy_5_cti_max = -0.5\n    buy_5_r_14_max = -94.0\n    buy_5_rsi_14_min = 25.0\n    buy_5_mfi_min = 18.0\n    buy_5_crsi_1h_min = 12.0\n    buy_5_volume = 1.6\n\n    buy_6_ema_open_mult = 0.019\n    buy_6_bb_offset = 0.984\n    buy_6_r_14_max = -85.0\n    buy_6_crsi_1h_min = 15.0\n    buy_6_cti_1h_min = 0.0\n\n    buy_7_ema_open_mult = 0.031\n    buy_7_ma_offset = 0.978\n    buy_7_cti_max = -0.9\n    buy_7_rsi_max = 45.0\n\n    buy_8_bb_offset = 0.986\n    buy_8_r_14_max = -98.0\n    buy_8_cti_1h_max = 0.95\n    buy_8_r_480_1h_max = -18.0\n    buy_8_volume = 1.8\n\n    buy_9_ma_offset = 0.968\n    buy_9_bb_offset = 0.982\n    buy_9_mfi_max = 50.0\n    buy_9_cti_max = -0.85\n    buy_9_r_14_max = -94.0\n    buy_9_rsi_1h_min = 20.0\n    buy_9_rsi_1h_max = 88.0\n    buy_9_crsi_1h_min = 21.0\n\n    buy_10_ma_offset_high = 0.94\n    buy_10_bb_offset = 0.984\n    buy_10_r_14_max = -88.0\n    buy_10_cti_1h_min = -0.5\n    buy_10_cti_1h_max = 0.94\n\n    buy_11_ma_offset = 0.956\n    buy_11_min_inc = 0.022\n    buy_11_rsi_max = 37.0\n    buy_11_mfi_max = 46.0\n    buy_11_cci_max = -120.0\n    buy_11_r_480_max = -32.0\n    buy_11_rsi_1h_min = 30.0\n    buy_11_rsi_1h_max = 84.0\n    buy_11_cti_1h_max = 0.91\n    buy_11_r_480_1h_max = -25.0\n    buy_11_crsi_1h_min = 26.0\n\n    buy_12_ma_offset = 0.927\n    buy_12_ewo_min = 2.0\n    buy_12_rsi_max = 32.0\n    buy_12_cti_max = -0.9\n\n    buy_13_ma_offset = 0.99\n    buy_13_cti_max = -0.92\n    buy_13_ewo_max = -6.0\n    buy_13_cti_1h_max = -0.88\n    buy_13_crsi_1h_min = 10.0\n\n    buy_14_ema_open_mult = 0.014\n    buy_14_bb_offset = 0.989\n    buy_14_ma_offset = 0.945\n    buy_14_cti_max = -0.85\n\n    buy_15_ema_open_mult = 0.0238\n    buy_15_ma_offset = 0.958\n    buy_15_rsi_min = 28.0\n    buy_15_cti_1h_min = -0.2\n\n    buy_16_ma_offset = 0.942\n    buy_16_ewo_min = 2.0\n    buy_16_rsi_max = 36.0\n    buy_16_cti_max = -0.9\n\n    buy_17_ma_offset = 0.999\n    buy_17_ewo_max = -7.0\n    buy_17_cti_max = -0.96\n    buy_17_crsi_1h_min = 12.0\n    buy_17_volume = 2.0\n\n    buy_18_bb_offset = 0.986\n    buy_18_rsi_max = 33.5\n    buy_18_cti_max = -0.85\n    buy_18_cti_1h_max = 0.91\n    buy_18_volume = 2.0\n\n    buy_19_rsi_1h_min = 30.0\n    buy_19_chop_max = 21.3\n\n    buy_20_rsi_14_max = 36.0\n    buy_20_rsi_14_1h_max = 16.0\n    buy_20_cti_max = -0.84\n    buy_20_volume = 2.0\n\n    buy_21_rsi_14_max = 14.0\n    buy_21_rsi_14_1h_max = 28.0\n    buy_21_cti_max = -0.902\n    buy_21_volume = 2.0\n\n    buy_22_volume = 2.0\n    buy_22_bb_offset = 0.984\n    buy_22_ma_offset = 0.98\n    buy_22_ewo_min = 5.6\n    buy_22_rsi_14_max = 36.0\n    buy_22_cti_max = -0.54\n    buy_22_r_480_max = -40.0\n    buy_22_cti_1h_min = -0.5\n\n    buy_23_bb_offset = 0.984\n    buy_23_ewo_min = 3.4\n    buy_23_rsi_14_max = 28.0\n    buy_23_cti_max = -0.74\n    buy_23_rsi_14_1h_max = 80.0\n    buy_23_r_480_1h_min = -95.0\n    buy_23_cti_1h_max = 0.92\n\n    buy_24_rsi_14_max = 50.0\n    buy_24_rsi_14_1h_min = 66.9\n\n    buy_25_ma_offset = 0.953\n    buy_25_rsi_4_max = 30.0\n    buy_25_cti_max = -0.78\n    buy_25_cci_max = -200.0\n\n    buy_26_zema_low_offset = 0.9405\n    buy_26_cti_max = -0.72\n    buy_26_cci_max = -166.0\n    buy_26_r_14_max = -98.0\n    buy_26_cti_1h_max = 0.95\n    buy_26_volume = 2.0\n\n    buy_27_wr_max = -95.0\n    buy_27_r_14 = -100.0\n    buy_27_wr_1h_max = -90.0\n    buy_27_rsi_max = 46.0\n    buy_27_volume = 2.0\n\n    buy_28_ma_offset = 0.928\n    buy_28_ewo_min = 2.0\n    buy_28_rsi_14_max = 33.4\n    buy_28_cti_max = -0.84\n    buy_28_r_14_max = -97.0\n    buy_28_cti_1h_max = 0.95\n\n    buy_29_ma_offset = 0.984\n    buy_29_ewo_max = -4.2\n    buy_29_cti_max = -0.96\n\n    buy_30_ma_offset = 0.962\n    buy_30_ewo_min = 6.4\n    buy_30_rsi_14_max = 34.0\n    buy_30_cti_max = -0.87\n    buy_30_r_14_max = -97.0\n\n    buy_31_ma_offset = 0.962\n    buy_31_ewo_max = -5.2\n    buy_31_r_14_max = -94.0\n    buy_31_cti_max = -0.9\n\n    buy_32_ma_offset = 0.942\n    buy_32_rsi_4_max = 46.0\n    buy_32_cti_max = -0.86\n    buy_32_rsi_14_min = 19.0\n    buy_32_crsi_1h_min = 10.0\n    buy_32_crsi_1h_max = 60.0\n\n    buy_33_ma_offset = 0.988\n    buy_33_ewo_min = 9.0\n    buy_33_rsi_max = 32.0\n    buy_33_cti_max = -0.88\n    buy_33_r_14_max = -98.0\n    buy_33_cti_1h_max = 0.92\n    buy_33_volume = 2.0\n\n    buy_34_ma_offset = 0.97\n    buy_34_ewo_max = -4.0\n    buy_34_cti_max = -0.95\n    buy_34_r_14_max = -99.9\n    buy_34_crsi_1h_min = 8.0\n    buy_34_volume = 2.0\n\n    buy_35_ma_offset = 0.984\n    buy_35_ewo_min = 7.8\n    buy_35_rsi_max = 32.0\n    buy_35_cti_max = -0.8\n    buy_35_r_14_max = -95.0\n\n    buy_36_ma_offset = 0.98\n    buy_36_ewo_max = -5.0\n    buy_36_cti_max = -0.82\n    buy_36_r_14_max = -97.0\n    buy_36_crsi_1h_min = 12.0\n\n    buy_37_ma_offset = 0.984\n    buy_37_ewo_min = 8.3\n    buy_37_ewo_max = 11.1\n    buy_37_rsi_14_min = 26.0\n    buy_37_rsi_14_max = 46.0\n    buy_37_crsi_1h_min = 12.0\n    buy_37_crsi_1h_max = 56.0\n    buy_37_cti_max = -0.85\n    buy_37_cti_1h_max = 0.92\n    buy_37_r_14_max = -97.0\n    buy_37_close_1h_max = 0.1\n\n    buy_38_ma_offset = 0.98\n    buy_38_ewo_max = -4.4\n    buy_38_cti_max = -0.95\n    buy_38_r_14_max = -97.0\n    buy_38_crsi_1h_min = 0.5\n\n    buy_39_cti_max = -0.1\n    buy_39_r_1h_max = -22.0\n    buy_39_cti_1h_min = -0.1\n    buy_39_cti_1h_max = 0.4\n\n    buy_40_cci_max = -150.0\n    buy_40_rsi_max = 30.0\n    buy_40_r_14_max = -99.9\n    buy_40_cti_max = -0.8\n\n    buy_41_ma_offset_high = 0.95\n    buy_41_cti_max = -0.95\n    buy_41_cci_max = -178.0\n    buy_41_ewo_1h_min = 0.5\n    buy_41_r_480_1h_max = -14.0\n    buy_41_crsi_1h_min = 14.0\n\n    buy_42_ema_open_mult = 0.018\n    buy_42_bb_offset = 0.992\n    buy_42_ewo_1h_min = 2.8\n    buy_42_cti_1h_min = -0.5\n    buy_42_cti_1h_max = 0.88\n    buy_42_r_480_1h_max = -12.0\n\n    buy_43_bb40_bbdelta_close = 0.045\n    buy_43_bb40_closedelta_close = 0.02\n    buy_43_bb40_tail_bbdelta = 0.5\n    buy_43_cti_max = -0.75\n    buy_43_r_480_min = -94.0\n    buy_43_cti_1h_min = -0.75\n    buy_43_cti_1h_max = 0.45\n    buy_43_r_480_1h_min = -80.0\n\n    buy_44_ma_offset = 0.982\n    buy_44_ewo_max = -18.0\n    buy_44_cti_max = -0.73\n    buy_44_crsi_1h_min = 8.0\n\n    buy_45_bb40_bbdelta_close = 0.039\n    buy_45_bb40_closedelta_close = 0.0231\n    buy_45_bb40_tail_bbdelta = 0.24\n    buy_45_ma_offset = 0.948\n    buy_45_ewo_min = 2.0\n    buy_45_ewo_1h_min = 2.0\n    buy_45_cti_1h_max = 0.76\n    buy_45_r_480_1h_max = -20.0\n\n    buy_46_ema_open_mult = 0.0332\n    buy_46_ewo_1h_min = 0.5\n    buy_46_cti_1h_min = -0.9\n    buy_46_cti_1h_max = 0.5\n\n    buy_47_ewo_min = 3.2\n    buy_47_ma_offset = 0.952\n    buy_47_rsi_14_max = 46.0\n    buy_47_cti_max = -0.93\n    buy_47_r_14_max = -97.0\n    buy_47_ewo_1h_min = 2.0\n    buy_47_cti_1h_min = -0.9\n    buy_47_cti_1h_max = 0.3\n\n    buy_48_ewo_min = 8.5\n    buy_48_ewo_1h_min = 14.0\n    buy_48_r_480_min = -25.0\n    buy_48_r_480_1h_min = -50.0\n    buy_48_r_480_1h_max = -10.0\n    buy_48_cti_1h_min = 0.5\n    buy_48_crsi_1h_min = 10.0\n\n    # Sell\n\n    sell_condition_1_enable = True\n    sell_condition_2_enable = True\n    sell_condition_3_enable = True\n    sell_condition_4_enable = True\n    sell_condition_5_enable = True\n    sell_condition_6_enable = True\n    sell_condition_7_enable = True\n    sell_condition_8_enable = True\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = 0.9\n    sell_pump_threshold_48_2 = 0.7\n    sell_pump_threshold_48_3 = 0.5\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = 0.72\n    sell_pump_threshold_36_2 = 4.0\n    sell_pump_threshold_36_3 = 1.0\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = 0.68\n    sell_pump_threshold_24_2 = 0.62\n    sell_pump_threshold_24_3 = 0.88\n\n    sell_rsi_bb_1 = 79.0\n\n    sell_rsi_bb_2 = 80.0\n\n    sell_rsi_main_3 = 83.0\n\n    sell_dual_rsi_rsi_4 = 73.4\n    sell_dual_rsi_rsi_1h_4 = 79.6\n\n    sell_ema_relative_5 = 0.024\n    sell_rsi_diff_5 = 4.4\n\n    sell_rsi_under_6 = 79.0\n\n    sell_rsi_1h_7 = 81.7\n\n    sell_bb_relative_8 = 1.1\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = 0.012\n    sell_custom_rsi_under_bull_0 = 34.0\n    sell_custom_profit_bull_1 = 0.02\n    sell_custom_rsi_under_bull_1 = 35.0\n    sell_custom_profit_bull_2 = 0.03\n    sell_custom_rsi_under_bull_2 = 36.0\n    sell_custom_profit_bull_3 = 0.04\n    sell_custom_rsi_under_bull_3 = 44.0\n    sell_custom_profit_bull_4 = 0.05\n    sell_custom_rsi_under_bull_4 = 45.0\n    sell_custom_profit_bull_5 = 0.06\n    sell_custom_rsi_under_bull_5 = 49.0\n    sell_custom_profit_bull_6 = 0.07\n    sell_custom_rsi_under_bull_6 = 50.0\n    sell_custom_profit_bull_7 = 0.08\n    sell_custom_rsi_under_bull_7 = 57.0\n    sell_custom_profit_bull_8 = 0.09\n    sell_custom_rsi_under_bull_8 = 50.0\n    sell_custom_profit_bull_9 = 0.1\n    sell_custom_rsi_under_bull_9 = 46.0\n    sell_custom_profit_bull_10 = 0.12\n    sell_custom_rsi_under_bull_10 = 42.0\n    sell_custom_profit_bull_11 = 0.20\n    sell_custom_rsi_under_bull_11 = 30.0\n\n    sell_custom_profit_bear_0 = 0.012\n    sell_custom_rsi_under_bear_0 = 34.0\n    sell_custom_profit_bear_1 = 0.02\n    sell_custom_rsi_under_bear_1 = 35.0\n    sell_custom_profit_bear_2 = 0.03\n    sell_custom_rsi_under_bear_2 = 37.0\n    sell_custom_profit_bear_3 = 0.04\n    sell_custom_rsi_under_bear_3 = 44.0\n    sell_custom_profit_bear_4 = 0.05\n    sell_custom_rsi_under_bear_4 = 48.0\n    sell_custom_profit_bear_5 = 0.06\n    sell_custom_rsi_under_bear_5 = 50.0\n    sell_custom_rsi_over_bear_5 = 78.0\n    sell_custom_profit_bear_6 = 0.07\n    sell_custom_rsi_under_bear_6 = 52.0\n    sell_custom_rsi_over_bear_6 = 78.0\n    sell_custom_profit_bear_7 = 0.08\n    sell_custom_rsi_under_bear_7 = 57.0\n    sell_custom_rsi_over_bear_7 = 77.0\n    sell_custom_profit_bear_8 = 0.09\n    sell_custom_rsi_under_bear_8 = 55.0\n    sell_custom_rsi_over_bear_8 = 75.5\n    sell_custom_profit_bear_9 = 0.1\n    sell_custom_rsi_under_bear_9 = 46.0\n    sell_custom_profit_bear_10 = 0.12\n    sell_custom_rsi_under_bear_10 = 42.0\n    sell_custom_profit_bear_11 = 0.20\n    sell_custom_rsi_under_bear_11 = 30.0\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = 0.01\n    sell_custom_under_rsi_under_bull_0 = 38.0\n    sell_custom_under_profit_bull_1 = 0.02\n    sell_custom_under_rsi_under_bull_1 = 46.0\n    sell_custom_under_profit_bull_2 = 0.03\n    sell_custom_under_rsi_under_bull_2 = 47.0\n    sell_custom_under_profit_bull_3 = 0.04\n    sell_custom_under_rsi_under_bull_3 = 48.0\n    sell_custom_under_profit_bull_4 = 0.05\n    sell_custom_under_rsi_under_bull_4 = 49.0\n    sell_custom_under_profit_bull_5 = 0.06\n    sell_custom_under_rsi_under_bull_5 = 50.0\n    sell_custom_under_profit_bull_6 = 0.07\n    sell_custom_under_rsi_under_bull_6 = 52.0\n    sell_custom_under_profit_bull_7 = 0.08\n    sell_custom_under_rsi_under_bull_7 = 57.0\n    sell_custom_under_profit_bull_8 = 0.09\n    sell_custom_under_rsi_under_bull_8 = 50.0\n    sell_custom_under_profit_bull_9 = 0.1\n    sell_custom_under_rsi_under_bull_9 = 46.0\n    sell_custom_under_profit_bull_10 = 0.12\n    sell_custom_under_rsi_under_bull_10 = 42.0\n    sell_custom_under_profit_bull_11 = 0.2\n    sell_custom_under_rsi_under_bull_11 = 30.0\n\n    sell_custom_under_profit_bear_0 = 0.01\n    sell_custom_under_rsi_under_bear_0 = 38.0\n    sell_custom_under_profit_bear_1 = 0.02\n    sell_custom_under_rsi_under_bear_1 = 56.0\n    sell_custom_under_profit_bear_2 = 0.03\n    sell_custom_under_rsi_under_bear_2 = 57.0\n    sell_custom_under_profit_bear_3 = 0.04\n    sell_custom_under_rsi_under_bear_3 = 57.0\n    sell_custom_under_profit_bear_4 = 0.05\n    sell_custom_under_rsi_under_bear_4 = 57.0\n    sell_custom_under_profit_bear_5 = 0.06\n    sell_custom_under_rsi_under_bear_5 = 57.0\n    sell_custom_under_rsi_over_bear_5 = 78.0\n    sell_custom_under_profit_bear_6 = 0.07\n    sell_custom_under_rsi_under_bear_6 = 57.0\n    sell_custom_under_rsi_over_bear_6 = 78.0\n    sell_custom_under_profit_bear_7 = 0.08\n    sell_custom_under_rsi_under_bear_7 = 57.0\n    sell_custom_under_rsi_over_bear_7 = 80.0\n    sell_custom_under_profit_bear_8 = 0.09\n    sell_custom_under_rsi_under_bear_8 = 50.0\n    sell_custom_under_rsi_over_bear_8 = 82.0\n    sell_custom_under_profit_bear_9 = 0.1\n    sell_custom_under_rsi_under_bear_9 = 46.0\n    sell_custom_under_profit_bear_10 = 0.12\n    sell_custom_under_rsi_under_bear_10 = 42.0\n    sell_custom_under_profit_bear_11 = 0.2\n    sell_custom_under_rsi_under_bear_11 = 30.0\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = 0.05\n    sell_custom_dec_profit_max_1 = 0.12\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = 0.07\n    sell_custom_dec_profit_max_2 = 0.16\n\n    # Trail 1\n    sell_trail_profit_min_1 = 0.03\n    sell_trail_profit_max_1 = 0.05\n    sell_trail_down_1 = 0.05\n    sell_trail_rsi_min_1 = 10.0\n    sell_trail_rsi_max_1 = 20.0\n\n    # Trail 2\n    sell_trail_profit_min_2 = 0.1\n    sell_trail_profit_max_2 = 0.4\n    sell_trail_down_2 = 0.03\n    sell_trail_rsi_min_2 = 20.0\n    sell_trail_rsi_max_2 = 50.0\n\n    # Trail 3\n    sell_trail_profit_min_3 = 0.06\n    sell_trail_profit_max_3 = 0.2\n    sell_trail_down_3 = 0.05\n\n    # Trail 4\n    sell_trail_profit_min_4 = 0.03\n    sell_trail_profit_max_4 = 0.06\n    sell_trail_down_4 = 0.02\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = 0.001\n    sell_custom_profit_under_profit_max_1 = 0.008\n    sell_custom_profit_under_rel_1 = 0.024\n    sell_custom_profit_under_rsi_diff_1 = 4.4\n\n    sell_custom_profit_under_profit_2 = 0.03\n    sell_custom_profit_under_rel_2 = 0.024\n    sell_custom_profit_under_rsi_diff_2 = 4.4\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = 0.002\n    sell_custom_stoploss_under_rsi_diff_1 = 10.0\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = -0.08\n    sell_custom_stoploss_long_profit_max_1 = -0.04\n    sell_custom_stoploss_long_recover_1 = 0.14\n    sell_custom_stoploss_long_rsi_diff_1 = 4.0\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = 0.06\n    sell_custom_stoploss_long_rsi_diff_2 = 40.0\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = 0.04\n    sell_custom_pump_under_profit_max_1 = 0.09\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = 0.05\n    sell_custom_pump_trail_profit_max_1 = 0.07\n    sell_custom_pump_trail_down_1 = 0.05\n    sell_custom_pump_trail_rsi_min_1 = 20.0\n    sell_custom_pump_trail_rsi_max_1 = 70.0\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = 0.01\n    sell_custom_stoploss_pump_min_1 = -0.02\n    sell_custom_stoploss_pump_max_1 = -0.01\n    sell_custom_stoploss_pump_ma_offset_1 = 0.94\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = 0.025\n    sell_custom_stoploss_pump_loss_2 = -0.05\n    sell_custom_stoploss_pump_ma_offset_2 = 0.92\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = 0.008\n    sell_custom_stoploss_pump_loss_3 = -0.12\n    sell_custom_stoploss_pump_ma_offset_3 = 0.88\n\n    # Recover\n    sell_custom_recover_profit_1 = 0.06\n    sell_custom_recover_min_loss_1 = 0.12\n\n    sell_custom_recover_profit_min_2 = 0.01\n    sell_custom_recover_profit_max_2 = 0.05\n    sell_custom_recover_min_loss_2 = 0.06\n    sell_custom_recover_rsi_2 = 46.0\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = 0.03\n    sell_custom_long_profit_max_1 = 0.04\n    sell_custom_long_duration_min_1 = 900\n\n    # Profit Target Signal\n    profit_target_1_enable = False\n    #############################################################\n\n    plot_config = {\n        'main_plot': {\n            'ema_12_1h': { 'color': 'rgba(200,200,100,0.4)' },\n            'ema_15_1h': { 'color': 'rgba(200,180,100,0.4)' },\n            'ema_20_1h': { 'color': 'rgba(200,160,100,0.4)' },\n            'ema_25_1h': { 'color': 'rgba(200,140,100,0.4)' },\n            'ema_26_1h': { 'color': 'rgba(200,120,100,0.4)' },\n            'ema_35_1h': { 'color': 'rgba(200,100,100,0.4)' },\n            'ema_50_1h': { 'color': 'rgba(200,80,100,0.4)' },\n            'ema_100_1h': { 'color': 'rgba(200,60,100,0.4)' },\n            'ema_200_1h': { 'color': 'rgba(200,40,100,0.4)' },\n            'sma_200_1h': { 'color': 'rgba(150,20,100,0.4)' },\n            'pm': { 'color': 'rgba(100,20,100,0.5)' }\n        },\n        'subplots': {\n            'buy tag': { 'buy_tag': {'color': 'green'} },\n            'RSI/BTC': {\n                'btc_not_downtrend_1h': { 'color': 'yellow' },\n                'btc_rsi_14_1h': { 'color': 'green' },\n                'rsi_14_1h': { 'color': '#f41cd1' },\n                'crsi': {'color': 'blue' }\n            },\n            'pump': {\n                'cti_1h': {'color': 'pink' },\n                'safe_pump_24_10_1h': {'color': '#481110' },\n                'safe_pump_24_20_1h': {'color': '#481120' },\n                'safe_pump_24_30_1h': {'color': '#481130' },\n                'safe_pump_24_40_1h': {'color': '#481140' },\n                'safe_pump_24_50_1h': {'color': '#481150' },\n                'safe_pump_24_60_1h': {'color': '#481160' },\n                'safe_pump_24_70_1h': {'color': '#481170' },\n                'safe_pump_24_80_1h': {'color': '#481180' },\n                'safe_pump_24_90_1h': {'color': '#481190' },\n                'safe_pump_24_100_1h': {'color': '#4811A0' },\n                'safe_pump_24_120_1h': {'color': '#4811C0' },\n                'safe_pump_36_10_1h': {'color': '#721110' },\n                'safe_pump_36_20_1h': {'color': '#721120' },\n                'safe_pump_36_30_1h': {'color': '#721130' },\n                'safe_pump_36_40_1h': {'color': '#721140' },\n                'safe_pump_36_50_1h': {'color': '#721150' },\n                'safe_pump_36_60_1h': {'color': '#721160' },\n                'safe_pump_36_70_1h': {'color': '#721170' },\n                'safe_pump_36_80_1h': {'color': '#721180' },\n                'safe_pump_36_90_1h': {'color': '#721190' },\n                'safe_pump_36_100_1h': {'color': '#7211A0' },\n                'safe_pump_36_120_1h': {'color': '#7211C0' },\n                'safe_pump_48_10_1h': {'color': '#961110' },\n                'safe_pump_48_20_1h': {'color': '#961120' },\n                'safe_pump_48_30_1h': {'color': '#961130' },\n                'safe_pump_48_40_1h': {'color': '#961140' },\n                'safe_pump_48_50_1h': {'color': '#961150' },\n                'safe_pump_48_60_1h': {'color': '#961160' },\n                'safe_pump_48_70_1h': {'color': '#961170' },\n                'safe_pump_48_80_1h': {'color': '#961180' },\n                'safe_pump_48_90_1h': {'color': '#961190' },\n                'safe_pump_48_100_1h': {'color': '#9611A0' },\n                'safe_pump_48_120_1h': {'color': '#9611C0' }\n            }\n        }\n    }\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        self.coin_metrics['tg_dataframe'].to_html('pct_df.html')\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 27.0):\n                        return True, 'signal_profit_o_bull_12_9'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 39.0):\n                        return True, 'signal_profit_o_bull_11_9'\n                elif 0.12 > current_profit >= 0.1:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 48.0):\n                        return True, 'signal_profit_o_bull_10_9'\n                elif 0.1 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_o_bull_9_9'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_8_4'\n                    elif (last_candle['rsi_14'] < 48.0):\n                        return True, 'signal_profit_o_bull_8_9'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_7_1'\n                    if last_candle['rsi_14'] > 83.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_7_4'\n                    elif (last_candle['rsi_14'] < 45.0):\n                        return True, 'signal_profit_o_bull_7_9'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6_1'\n                    if last_candle['rsi_14'] > 82.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_6_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_o_bull_6_5'\n                    elif (last_candle['rsi_14'] < 42.0):\n                        return True, 'signal_profit_o_bull_6_9'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5_1'\n                    if last_candle['rsi_14'] > 80.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_5_4'\n                    elif (last_candle['cti'] > 0.952):\n                        return True, 'signal_profit_o_bull_5_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5_6'\n                    elif (last_candle['rsi_14'] < 41.0):\n                        return True, 'signal_profit_o_bull_5_9'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_4_4'\n                    elif (last_candle['cti'] > 0.954):\n                        return True, 'signal_profit_o_bull_4_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_4_6'\n                    elif (last_candle['rsi_14'] < 40.0):\n                        return True, 'signal_profit_o_bull_4_9'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_3_4'\n                    elif (last_candle['cti'] > 0.956):\n                        return True, 'signal_profit_o_bull_3_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3_6'\n                    elif (last_candle['rsi_14'] < 35.0):\n                        return True, 'signal_profit_o_bull_3_9'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_2_4'\n                    elif (last_candle['cti'] > 0.958):\n                        return True, 'signal_profit_o_bull_2_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2_6'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bull_2_7'\n                    elif last_candle['rsi_14'] < 40.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_o_bull_2_8'\n                    elif (last_candle['rsi_14'] < 34.0):\n                        return True, 'signal_profit_o_bull_2_9'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bull_1_4'\n                    elif (last_candle['cti'] > 0.96):\n                        return True, 'signal_profit_o_bull_1_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1_6'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bull_1_7'\n                    elif last_candle['rsi_14'] < 39.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_o_bull_1_8'\n                    elif (last_candle['rsi_14'] < 32.0):\n                        return True, 'signal_profit_o_bull_1_9'\n            else:\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 28.0):\n                        return True, 'signal_profit_o_bear_12_9'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 40.0):\n                        return True, 'signal_profit_o_bear_11_9'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_o_bear_10_9'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 55.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] > 75.5):\n                        return True, 'signal_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 50.0):\n                        return True, 'signal_profit_o_bear_9_9'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > 77.0):\n                        return True, 'signal_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 59.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_8_4'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_o_bear_8_9'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_7_4'\n                    elif (last_candle['rsi_14'] < 46.0):\n                        return True, 'signal_profit_o_bear_7_9'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_6_4'\n                    elif (last_candle['cti'] > 0.94):\n                        return True, 'signal_profit_o_bear_6_5'\n                    elif (last_candle['rsi_14'] < 43.0):\n                        return True, 'signal_profit_o_bear_6_9'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_5_4'\n                    elif (last_candle['cti'] > 0.942):\n                        return True, 'signal_profit_o_bear_5_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_5_6'\n                    elif (last_candle['rsi_14'] < 42.0):\n                        return True, 'signal_profit_o_bear_5_9'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_4_4'\n                    elif (last_candle['cti'] > 0.944):\n                        return True, 'signal_profit_o_bear_4_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_4_6'\n                    elif (last_candle['rsi_14'] < 41.0):\n                        return True, 'signal_profit_o_bear_4_9'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_3_4'\n                    elif (last_candle['cti'] > 0.946):\n                        return True, 'signal_profit_o_bear_3_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3_6'\n                    elif (last_candle['rsi_14'] < 36.0):\n                        return True, 'signal_profit_o_bear_3_9'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_2_4'\n                    elif (last_candle['cti'] > 0.948):\n                        return True, 'signal_profit_o_bear_2_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2_6'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bear_2_7'\n                    elif (last_candle['rsi_14'] < 35.0):\n                        return True, 'signal_profit_o_bear_2_9'\n                elif 0.02 > current_profit >= 0.012:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_o_bear_1_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_o_bear_1_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1_6'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_o_bear_1_7'\n                    elif (last_candle['rsi_14'] < 33.0):\n                        return True, 'signal_profit_o_bear_1_9'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 28.0):\n                        return True, 'signal_profit_u_bull_12_9'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 43.0):\n                        return True, 'signal_profit_u_bull_11_9'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_u_bull_10_9'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 50.0):\n                        return True, 'signal_profit_u_bull_9_9'\n                elif 0.09 > current_profit >= 0.08:\n                    if last_candle['rsi_14'] < 57.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_8_4'\n                    elif (last_candle['rsi_14'] < 49.0):\n                        return True, 'signal_profit_u_bull_8_9'\n                elif 0.08 > current_profit >= 0.07:\n                    if last_candle['rsi_14'] < 52.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_7_1'\n                    if last_candle['rsi_14'] > 83.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_7_4'\n                    elif (last_candle['rsi_14'] < 46.0):\n                        return True, 'signal_profit_u_bull_7_9'\n                elif 0.07 > current_profit >= 0.06:\n                    if last_candle['rsi_14'] < 50.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_6_1'\n                    if last_candle['rsi_14'] > 82.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_6_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_u_bull_6_5'\n                    elif (last_candle['rsi_14'] < 43.0):\n                        return True, 'signal_profit_u_bull_6_9'\n                elif 0.06 > current_profit >= 0.05:\n                    if last_candle['rsi_14'] < 48.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_5_1'\n                    if last_candle['rsi_14'] > 80.0 and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_5_4'\n                    elif (last_candle['cti'] > 0.952):\n                        return True, 'signal_profit_u_bull_5_5'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_5_6'\n                    elif (last_candle['rsi_14'] < 42.0):\n                        return True, 'signal_profit_u_bull_5_9'\n                elif 0.05 > current_profit >= 0.04:\n                    if last_candle['rsi_14'] < 47.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_4_4'\n                    elif (last_candle['cti'] > 0.954):\n                        return True, 'signal_profit_u_bull_4_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_4_6'\n                    elif (last_candle['rsi_14'] < 41.0):\n                        return True, 'signal_profit_u_bull_4_9'\n                elif 0.04 > current_profit >= 0.03:\n                    if last_candle['rsi_14'] < 46.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_3_4'\n                    elif (last_candle['cti'] > 0.956):\n                        return True, 'signal_profit_u_bull_3_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_3_6'\n                    elif (last_candle['rsi_14'] < 36.0):\n                        return True, 'signal_profit_u_bull_3_9'\n                elif 0.03 > current_profit >= 0.02:\n                    if last_candle['rsi_14'] < 45.0 and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_2_4'\n                    elif (last_candle['cti'] > 0.958):\n                        return True, 'signal_profit_u_bull_2_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_2_6'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bull_2_7'\n                    elif last_candle['rsi_14'] < 41.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_u_bull_2_8'\n                    elif (last_candle['rsi_14'] < 35.0):\n                        return True, 'signal_profit_u_bull_2_9'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'signal_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bull_1_4'\n                    elif (last_candle['cti'] > 0.96):\n                        return True, 'signal_profit_u_bull_1_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_1_6'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bull_1_7'\n                    elif last_candle['rsi_14'] < 40.0 and (last_candle['cmf'] < -0.25):\n                        return True, 'signal_profit_u_bull_1_8'\n                    elif (last_candle['rsi_14'] < 33.0):\n                        return True, 'signal_profit_u_bull_1_9'\n            else:\n                if current_profit >= 0.20:\n                    if last_candle['rsi_14'] < 30.0:\n                        return True, 'signal_profit_u_bear_12_1'\n                elif 0.20 > current_profit >= 0.12:\n                    if last_candle['rsi_14'] < 42.0:\n                        return True, 'signal_profit_u_bear_11_1'\n                elif 0.12 > current_profit >= 0.10:\n                    if last_candle['rsi_14'] < 46.0:\n                        return True, 'signal_profit_u_bear_10_1'\n                elif 0.10 > current_profit >= 0.09:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'signal_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] > 82.0):\n                        return True, 'signal_profit_u_bear_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if last_candle['rsi_14'] < 57.0:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > 80.0):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if last_candle['rsi_14'] < 56.0:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if last_candle['rsi_14'] < 54.0:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > 78.0):\n                        return True, 'signal_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_u_bear_6_3'\n                    elif (last_candle['cti'] > 0.94):\n                        return True, 'signal_profit_u_bear_6_5'\n                elif 0.06 > current_profit >= 0.05:\n                    if last_candle['rsi_14'] < 52.0:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_5_4'\n                    elif (last_candle['cti'] > 0.942):\n                        return True, 'signal_profit_u_bear_5_5'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if last_candle['rsi_14'] < 50.0:\n                        return True, 'signal_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 57.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_4_4'\n                    elif (last_candle['cti'] > 0.944):\n                        return True, 'signal_profit_u_bear_4_5'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if last_candle['rsi_14'] < 48.0:\n                        return True, 'signal_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_3_4'\n                    elif (last_candle['cti'] > 0.946):\n                        return True, 'signal_profit_u_bear_3_5'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if last_candle['rsi_14'] < 55.0: #46\n                        return True, 'signal_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 55.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_2_4'\n                    elif (last_candle['cti'] > 0.948):\n                        return True, 'signal_profit_u_bear_2_5'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_2_6'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bear_2_7'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.05):\n                        return True, 'signal_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0.0):\n                        return True, 'signal_profit_u_bear_1_4'\n                    elif (last_candle['cti'] > 0.95):\n                        return True, 'signal_profit_u_bear_1_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_1_6'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.05) and (last_candle['cti_1h'] > 0.85):\n                        return True, 'signal_profit_u_bear_1_7'\n                    elif (last_candle['rsi_14'] < 34.0):\n                        return True, 'signal_profit_u_bear_1_9'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_48_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bull_48_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_48_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_48_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.12):\n                        return True, 'signal_profit_p_bear_48_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_48_1_4'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_36_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bull_36_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_36_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_36_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'signal_profit_p_bear_36_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_36_1_4'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if (last_candle['moderi_96']):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_6_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_5_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_4_3'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_3_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_3_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_2_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_2_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bull_24_1_1'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bull_24_1_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bull_24_1_4'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 30.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 57.5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_6_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_6_3'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_6_4'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_5_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_5_3'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_5_4'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_4_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_4_3'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_4_4'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_3_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_3_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_3_4'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_2_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_2_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_2_4'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_p_bear_24_1_1'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'signal_profit_p_bear_24_1_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_14'] == 0):\n                        return True, 'signal_profit_p_bear_24_1_4'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1 > current_profit >= self.sell_custom_dec_profit_min_1) and (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2 > current_profit >= self.sell_custom_dec_profit_min_2) and (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1 > current_profit >= self.sell_trail_profit_min_1) and (self.sell_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_trail_rsi_max_1) and (max_profit > (current_profit + self.sell_trail_down_1)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2 > current_profit >= self.sell_trail_profit_min_2) and (self.sell_trail_rsi_min_2 < last_candle['rsi_14'] < self.sell_trail_rsi_max_2) and (max_profit > (current_profit + self.sell_trail_down_2)) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3 > current_profit >= self.sell_trail_profit_min_3) and (max_profit > (current_profit + self.sell_trail_down_3)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4 > current_profit >= self.sell_trail_profit_min_4) and (max_profit > (current_profit + self.sell_trail_down_4)) and (last_candle['sma_200_dec_24']) and (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1 < current_profit < self.sell_custom_long_profit_max_1) and (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1 > current_profit >= self.sell_custom_profit_under_profit_min_1) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit >= self.sell_custom_profit_under_profit_2) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Under & near EMA200, local uptrend move\n        if (\n                (current_profit < -0.05)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.004)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 10.0))\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'signal_stoploss_u_e_1'\n\n        # Under EMA200, local strong uptrend move\n        if (\n                (current_profit < -0.08)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < 0.0)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 24.0))\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            return True, 'signal_stoploss_u_e_2'\n\n        # Under EMA200, pair negative, low max rate\n        if (\n                (current_profit < -0.08)\n                and (max_profit < 0.04)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (current_time - timedelta(minutes=1440) > trade.open_date_utc)\n        ):\n            return True, 'signal_stoploss_u_e_doom'\n\n        # Under EMA200, pair and BTC negative, low max rate\n        if (\n                (-0.05 > current_profit > -0.09)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (max_profit < 0.005)\n                and (max_loss < 0.09)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -50.0)\n        ):\n            return True, 'signal_stoploss_u_e_b_1'\n\n        # Under EMA200, pair and BTC negative, CTI, Elder Ray Index negative, normal max rate\n        elif (\n                (-0.1 > current_profit > -0.2)\n                and (last_candle['btc_not_downtrend_1h'] == False)\n                and (last_candle['ema_vwma_osc_32'] < 0.0)\n                and (last_candle['ema_vwma_osc_64'] < 0.0)\n                and (last_candle['ema_vwma_osc_96'] < 0.0)\n                and (max_profit < 0.05)\n                and (max_loss < 0.2)\n                and (last_candle['sma_200_dec_24'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['cmf'] < -0.45)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['ema_25'] < last_candle['ema_50'])\n                and (last_candle['cti'] < -0.8)\n                and (last_candle['r_480'] < -97.0)\n        ):\n            return True, 'signal_stoploss_u_e_b_2'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (0.03 > current_profit >= 0.005) and (last_candle['sell_pump_48_1_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (0.06 > current_profit >= 0.04) and (last_candle['sell_pump_48_2_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (0.09 > current_profit >= 0.06) and (last_candle['sell_pump_48_3_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (0.04 > current_profit >= 0.02) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1 > current_profit >= self.sell_custom_pump_under_profit_min_1) and (last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (self.sell_custom_pump_trail_profit_max_1 > current_profit >= self.sell_custom_pump_trail_profit_min_1) and (self.sell_custom_pump_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_custom_pump_trail_rsi_max_1) and (max_profit > (current_profit + self.sell_custom_pump_trail_down_1)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1) and (current_profit >= self.sell_custom_recover_profit_1):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2) and (self.sell_custom_recover_profit_max_2 > current_profit >= self.sell_custom_recover_profit_min_2) and (last_candle['rsi_14'] < self.sell_custom_recover_rsi_2) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.4:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.5:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.7:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -4.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.2) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.3) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -4.8) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -3.2) and (last_candle['rsi_14'] > 81.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 81.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -5.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_r_5(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti_1h'] > 0.92):\n                return True, 'signal_profit_w_5_12'\n\n        return False, None\n\n    def sell_r_6(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_14'] > -0.2) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_14'] > -0.3) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_14'] > -0.6) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_14'] > -1.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_14'] > -0.75) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_14'] > -0.5) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_14'] > -0.1) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.8) and (last_candle['cci'] > 200.0):\n                return True, 'signal_profit_w_6_12'\n\n        return False, None\n\n    def mark_profit_target(self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:\n        # if self.profit_target_1_enable:\n        #     if (current_profit > 0) and (last_candle['zlema_4_lowKF'] > last_candle['lowKF']) and (previous_candle_1['zlema_4_lowKF'] < previous_candle_1['lowKF']) and (last_candle['cci'] > -100) and (last_candle['hrsi'] > 70):\n        #         return pair, \"mark_profit_target_01\"\n        return None, None\n\n    def sell_profit_target(self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_sell_reason, previous_time_profit_reached) -> tuple:\n        # if self.profit_target_1_enable and previous_sell_reason == \"mark_profit_target_01\":\n        #     if (current_profit > 0) and (current_rate < (previous_rate - 0.005)):\n        #         return True, 'sell_profit_target_01'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (0.04 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return True, 'signal_profit_q_pmax_bull'\n        if (0.045 > current_profit > 0.005) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_coh'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.0 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 78.0):\n            return True, 'signal_profit_ichi_u'\n\n        elif (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_profit_ichi_r_0'\n        elif (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_profit_ichi_r_1'\n        elif (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_profit_ichi_r_2'\n        elif (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_profit_ichi_r_3'\n        elif (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_profit_ichi_r_4'\n\n        elif (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_profit_ichi_slow'\n\n        elif (0.07 < current_profit < 0.1) and (max_profit-current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_profit_ichi_t'\n\n        return False, None\n\n    def sell_long_mode(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 78.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_1_2_1'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_2_2_1'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 82.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_3_2_1'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 80.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_4_2_1'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_long_6_1'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 82.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_7_2_1'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.05):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_8_2_1'\n\n        elif (0.02 < current_profit <= 0.06) and (max_profit - current_profit > 0.04) and (last_candle['cmf'] < 0.0) and (last_candle['sma_200_dec_24']):\n            return True, 'sell_long_t_1'\n        elif (0.06 < current_profit <= 0.12) and (max_profit - current_profit > 0.06) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_2'\n        elif (0.12 < current_profit <= 0.24) and (max_profit - current_profit > 0.08) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_3'\n        elif (0.24 < current_profit <= 0.5) and (max_profit - current_profit > 0.09) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_4'\n        elif (0.5 < current_profit <= 0.9) and (max_profit - current_profit > 0.1) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_5'\n\n        elif (0.03 < current_profit <= 0.06) and (current_time - timedelta(minutes=720) > trade.open_date_utc) and (last_candle['r_480'] > -20.0):\n            return True, 'sell_long_l_1'\n\n        return self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n\n    def sell_pivot(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['close'] > (last_candle['res3_1d'] * 2.2)):\n            if (0.02 > current_profit >= 0.012):\n                if (last_candle['r_14'] >= -0.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_480'] > -3.0):\n                    return True, 'signal_profit_pv_1_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_14'] > -0.4) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480'] > -5.0):\n                    return True, 'signal_profit_pv_1_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_14'] > -0.8) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480'] > -10.0):\n                    return True, 'signal_profit_pv_1_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480'] > -15.0):\n                    return True, 'signal_profit_pv_1_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_14'] > -1.2) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] > -20.0):\n                    return True, 'signal_profit_pv_1_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_14'] > -1.6) and (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] > -25.0):\n                    return True, 'signal_profit_pv_1_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['r_480'] > -30.0):\n                    return True, 'signal_profit_pv_1_7_1'\n\n        elif (last_candle['close'] > (last_candle['res3_1d'] * 1.3)):\n            if (0.02 > current_profit >= 0.012):\n                if (last_candle['rsi_14'] > 80.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_1_1'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['r_14'] > -1.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_1_2'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] > 78.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_2_1'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['r_14'] > -3.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_2_2'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] > 76.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_3_1'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['r_14'] > -5.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_3_2'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] > 72.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_4_1'\n                elif (last_candle['rsi_14'] > 71.0) and (last_candle['r_14'] > -7.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_4_2'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] > 68.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_5_1'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -9.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_5_2'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] > 60.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_6_1'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_14'] > -9.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_6_2'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] > 58.0) and (last_candle['cti_1h'] > 0.84) and (last_candle['cmf'] < 0.0) and (last_candle['cci'] > 200.0):\n                    return True, 'signal_profit_pv_2_7_1'\n                elif (last_candle['rsi_14'] > 57.0) and (last_candle['r_14'] > -9.0) and (last_candle['cti'] > 0.9):\n                    return True, 'signal_profit_pv_2_7_2'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Long mode\n        if all(c in ['45', '46', '47'] for c in buy_tags):\n            sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n            # Skip remaining sell logic for long mode\n            return None\n\n        # Quick sell mode\n        if all(c in ['empty', '32', '33', '34', '35', '36', '37', '38', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 5, plus  RSI and CTI 1h\n        sell, signal_name = self.sell_r_5(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sell 6, plus  RSI, CTI, CCI\n        sell, signal_name = self.sell_r_6(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pivot points based sells\n        sell, signal_name = self.sell_pivot(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Profit Target Signal\n        # Check if pair exist on target_profit_cache\n        if self.target_profit_cache is not None and pair in self.target_profit_cache.data:\n            previous_rate = self.target_profit_cache.data[pair]['rate']\n            previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']\n            previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])\n\n            sell, signal_name = self.sell_profit_target(pair, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1, previous_rate, previous_sell_reason, previous_time_profit_reached)\n            if sell and signal_name is not None:\n                return f\"{signal_name} ( {buy_tag})\"\n\n        pair, mark_signal = self.mark_profit_target(pair, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)\n        if pair:\n            self._set_profit_target(pair, mark_signal, current_rate, current_time)\n\n        # Sell signal 1\n        if self.sell_condition_1_enable and (last_candle['rsi_14'] > self.sell_rsi_bb_1) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_1_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_1_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_1_2_2 ( {buy_tag})\"\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable) and (last_candle['rsi_14'] > self.sell_rsi_bb_2) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_2_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_2_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_2_2_2 ( {buy_tag})\"\n\n        # Sell signal 3\n        elif (self.sell_condition_3_enable) and (last_candle['rsi_14'] > self.sell_rsi_main_3):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_3_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_3_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_3_2_2 ( {buy_tag})\"\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4) and (last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_4_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_4_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_4_2_2 ( {buy_tag})\"\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable and (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6):\n            if (current_profit > 0.01):\n                return f\"sell_signal_6_1 ( {buy_tag})\"\n            elif (max_loss > 0.5):\n                return f\"sell_signal_6_2 ( {buy_tag})\"\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_7_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_7_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_7_2_2 ( {buy_tag})\"\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return f\"sell_signal_8_1_1 ( {buy_tag})\"\n            else:\n                if (current_profit > 0.01):\n                    return f\"sell_signal_8_2_1 ( {buy_tag})\"\n                elif (max_loss > 0.5):\n                    return f\"sell_signal_8_2_2 ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = HeikinAshi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EWO\n        informative_1h['ewo_sma'] = ewo_sma(informative_1h, 50, 200)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h['chikou_span_greater'] = (informative_1h['chikou_span'] > informative_1h['senkou_a']).shift(30).fillna(False)\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # MOMDIV\n        mom = momdiv(informative_1h)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24, self.buy_pump_pull_threshold_10_24)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36, self.buy_pump_pull_threshold_10_36)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48, self.buy_pump_pull_threshold_10_48)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24, self.buy_pump_pull_threshold_20_24)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36, self.buy_pump_pull_threshold_20_36)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48, self.buy_pump_pull_threshold_20_48)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24, self.buy_pump_pull_threshold_30_24)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36, self.buy_pump_pull_threshold_30_36)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48, self.buy_pump_pull_threshold_30_48)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24, self.buy_pump_pull_threshold_40_24)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36, self.buy_pump_pull_threshold_40_36)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48, self.buy_pump_pull_threshold_40_48)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24, self.buy_pump_pull_threshold_50_24)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36, self.buy_pump_pull_threshold_50_36)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48, self.buy_pump_pull_threshold_50_48)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24, self.buy_pump_pull_threshold_60_24)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36, self.buy_pump_pull_threshold_60_36)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48, self.buy_pump_pull_threshold_60_48)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24, self.buy_pump_pull_threshold_70_24)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36, self.buy_pump_pull_threshold_70_36)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48, self.buy_pump_pull_threshold_70_48)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24, self.buy_pump_pull_threshold_80_24)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36, self.buy_pump_pull_threshold_80_36)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48, self.buy_pump_pull_threshold_80_48)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24, self.buy_pump_pull_threshold_90_24)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36, self.buy_pump_pull_threshold_90_36)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48, self.buy_pump_pull_threshold_90_48)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24, self.buy_pump_pull_threshold_100_24)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36, self.buy_pump_pull_threshold_100_36)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48, self.buy_pump_pull_threshold_100_48)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24, self.buy_pump_pull_threshold_110_24)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36, self.buy_pump_pull_threshold_110_36)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48, self.buy_pump_pull_threshold_110_48)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24, self.buy_pump_pull_threshold_120_24)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36, self.buy_pump_pull_threshold_120_36)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48, self.buy_pump_pull_threshold_120_48)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo_sma'] = ewo_sma(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # CCI Oscillator\n        cci_36 = ta.CCI(dataframe, timeperiod=36)\n        cci_36_max = cci_36.rolling(self.startup_candle_count).max()\n        cci_36_min = cci_36.rolling(self.startup_candle_count).min()\n        dataframe['cci_36_osc'] = (cci_36 / cci_36_max).where(cci_36 > 0, -cci_36 / cci_36_min)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period']}_{global_buy_protection_params['safe_pump_type']}_1h\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(12).min()) / dataframe['open'].rolling(12).min()) > self.buy_1_min_inc)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_1_rsi_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_2_r_14_max)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_1_mfi_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_1_rsi_1h_min)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_1_rsi_1h_max)\n\n                # Condition #2\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14_1h'] - self.buy_2_rsi_1h_diff)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_2_mfi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_2_cti_max)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_2_r_480_min)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_2_r_480_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_2_cti_1h_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_2_volume))\n\n                # Condition #3\n                elif index == 3:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_3_bb40_bbdelta_close))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_3_bb40_closedelta_close))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_3_bb40_tail_bbdelta))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cci_36_osc'] > self.buy_3_cci_36_osc_min)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_3_crsi_1h_min)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_3_r_480_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_3_cti_1h_max)\n\n                # Condition #4\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < self.buy_4_bb20_close_bblowerband * dataframe['bb20_2_low'])\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_4_bb20_volume))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_4_cti_max)\n\n                # Condition #5\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_5_ema_rel))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_5_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_5_bb_offset))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_5_cti_max)\n                    item_buy_logic.append(dataframe['rsi_14'] > self.buy_5_rsi_14_min)\n                    item_buy_logic.append(dataframe['mfi'] > self.buy_5_mfi_min)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_5_r_14_max)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < self.buy_5_r_14_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_5_crsi_1h_min)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_5_volume))\n\n                # Condition #6\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_6_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_6_bb_offset))\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_6_r_14_max)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_6_cti_1h_min)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_6_crsi_1h_min)\n\n                # Condition #7\n                elif index == 7:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_7_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_7_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_7_cti_max)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_7_rsi_max)\n\n                # Condition #8\n                elif index == 8:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_20'] > dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['ema_15'] > dataframe['ema_100'])\n                    item_buy_logic.append(dataframe['ema_200'] > dataframe['sma_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_8_bb_offset))\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_8_r_14_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_8_cti_1h_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_8_r_480_1h_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_8_volume))\n\n                # Condition #9\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_9_ma_offset)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_9_bb_offset)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_9_mfi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_9_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_9_r_14_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_9_rsi_1h_min)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_9_rsi_1h_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_9_crsi_1h_min)\n\n                # Condition #10\n                elif index == 10:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_10_ma_offset_high)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_10_bb_offset)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_10_r_14_max)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_10_cti_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_10_cti_1h_max)\n\n                # Condition #11\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(6).min()) / dataframe['open'].rolling(6).min()) > self.buy_11_min_inc)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_11_ma_offset)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_11_rsi_max)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_11_mfi_max)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_11_cci_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_11_rsi_1h_min)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_11_rsi_1h_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_11_cti_1h_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_11_r_480_1h_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_11_crsi_1h_min)\n\n                # Condition #12\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_12_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_12_ewo_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_12_rsi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_12_cti_max)\n\n                # Condition #13\n                elif index == 13:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_13_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_13_cti_max)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_13_ewo_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_13_cti_1h_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_13_crsi_1h_min)\n\n                # Condition #14\n                elif index == 14:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_14_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_14_bb_offset))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_14_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_14_cti_max)\n\n                # Condition #15\n                elif index == 15:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_15_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_15_rsi_min)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_15_ma_offset)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_15_cti_1h_min)\n\n                # Condition #16\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_16_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_16_ewo_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_16_rsi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_16_cti_max)\n\n                # Condition #17\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_17_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_17_ewo_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_17_cti_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_17_crsi_1h_min)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_17_volume))\n\n                # Condition #18\n                elif index == 18:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n                    item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_18_bb_offset))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_18_rsi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_18_cti_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_18_cti_1h_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_18_volume))\n\n                # Condition #19\n                elif index == 19:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['moderi_32'] == True)\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['moderi_96'] == True)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['chop'] < self.buy_19_chop_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_19_rsi_1h_min)\n\n                # Condition #20\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_20_rsi_14_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_20_rsi_14_1h_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_20_cti_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_20_volume))\n\n                # Condition #21\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_21_rsi_14_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_21_rsi_14_1h_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_21_cti_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_21_volume))\n\n                # Condition #22\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_22_volume) > dataframe['volume'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_22_ma_offset)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_22_bb_offset))\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_22_ewo_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_22_rsi_14_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_22_cti_max)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_22_r_480_max)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_22_cti_1h_min)\n\n                # Condition #23\n                elif index == 23:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_23_bb_offset))\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_23_ewo_min)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_23_cti_max)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_23_rsi_14_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_23_rsi_14_1h_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_23_r_480_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.92)\n\n                # Condition #24\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_24_rsi_14_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_24_rsi_14_1h_min)\n\n                # Condition #25\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4_max)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * self.buy_25_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_25_cti_max)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_25_cci_max)\n\n                # Condition #26\n                elif index == 26:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_26_cti_max)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_26_cci_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_26_r_14_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_26_cti_1h_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume))\n\n                # Condition #27\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_27_wr_max)\n                    item_buy_logic.append(dataframe['r_14'] == self.buy_27_r_14)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_27_wr_1h_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < self.buy_27_rsi_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume))\n\n                # Condition #28\n                elif index == 28:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_28_ewo_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_28_rsi_14_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_28_cti_max)\n                    item_buy_logic.append(dataframe['cti'].shift(1) < self.buy_28_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_28_r_14_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_28_cti_1h_max)\n\n                # Condition #29\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_29_ewo_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_29_cti_max)\n\n                # Condition #30\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_30_ewo_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_30_rsi_14_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_30_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_30_r_14_max)\n\n                # Condition #31\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_31_ewo_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_31_r_14_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_31_cti_max)\n\n                # Condition #32 - Quick mode buy\n                elif index == 32:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi_4_max)\n                    item_buy_logic.append(dataframe['rsi_14'] > self.buy_32_rsi_14_min)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * self.buy_32_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_32_cti_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_32_crsi_1h_min)\n                    item_buy_logic.append(dataframe['crsi_1h'] < self.buy_32_crsi_1h_max)\n\n                # Condition #33 - Quick mode buy\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset))\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_33_ewo_min)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_33_cti_max)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_33_rsi_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_33_r_14_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_33_cti_1h_max)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume))\n\n                # Condition #34 - Quick mode buy\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_34_ewo_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_34_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_34_r_14_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_34_crsi_1h_min)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume))\n\n                # Condition #35 - PMAX0 buy\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_35_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_35_ewo_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_35_rsi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_35_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_35_r_14_max)\n\n                # Condition #36 - PMAX1 buy\n                elif index == 36:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_36_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_36_ewo_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_36_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_36_r_14_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_36_crsi_1h_min)\n\n\n                # Condition #37 - Quick mode buy\n                elif index == 37:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_37_ma_offset)\n                    item_buy_logic.append(((dataframe['close_1h'].shift(12) - dataframe['close_1h']) / dataframe['close_1h']) < self.buy_37_close_1h_max)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_37_ewo_min)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_37_ewo_max)\n                    item_buy_logic.append(dataframe['rsi_14'] > self.buy_37_rsi_14_min)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_37_rsi_14_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_37_crsi_1h_min)\n                    item_buy_logic.append(dataframe['crsi_1h'] < self.buy_37_crsi_1h_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_37_cti_max)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_37_cti_1h_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_37_r_14_max)\n\n                # Condition #38 - PMAX3 buy\n                elif index == 38:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_38_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_38_ewo_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_38_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_38_r_14_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_38_crsi_1h_min)\n\n                # Condition #39 - Ichimoku\n                elif index == 39:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['cloud_top_1h'])\n                    item_buy_logic.append(dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h'])\n                    item_buy_logic.append(dataframe['chikou_span_greater_1h'])\n                    item_buy_logic.append(dataframe['ssl_up_1h'] > dataframe['ssl_down_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['ssl_up_1h'])\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > dataframe['rsi_14_1h'].shift(12))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_39_cti_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_39_r_1h_max)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_39_cti_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_39_cti_1h_max)\n                    # Start of trend\n                    item_buy_logic.append(\n                        (dataframe['leading_senkou_span_a_1h'].shift(12) < dataframe['leading_senkou_span_b_1h'].shift(12))\n                    )\n\n                # Condition #40\n                elif index == 40:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['momdiv_buy_1h'] == True)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_40_cci_max)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_40_rsi_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_40_r_14_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_40_cti_max)\n\n                # Condition #41\n                elif index == 41:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_41_ma_offset_high)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_41_cti_max)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_41_cci_max)\n                    item_buy_logic.append(dataframe['ewo_sma_1h'] > self.buy_41_ewo_1h_min)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_41_r_480_1h_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_41_crsi_1h_min)\n\n                # Condition #42\n                elif index == 42:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_42_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_42_bb_offset))\n                    item_buy_logic.append(dataframe['ewo_sma_1h'] > self.buy_42_ewo_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_42_cti_1h_min)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_42_r_480_1h_max)\n\n                # Condition #43\n                elif index == 43:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_43_bb40_bbdelta_close))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_43_bb40_closedelta_close))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_43_bb40_tail_bbdelta))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_43_cti_max)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_43_r_480_min)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_43_cti_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_43_cti_1h_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_43_r_480_1h_min)\n\n                # Condition #44\n                elif index == 44:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * self.buy_44_ma_offset))\n                    item_buy_logic.append(dataframe['ewo_sma'] < self.buy_44_ewo_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_44_cti_max)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_44_crsi_1h_min)\n\n                # Condition #45 - Long mode\n                elif index == 45:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_45_bb40_bbdelta_close))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_45_bb40_closedelta_close))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_45_bb40_tail_bbdelta))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_45_ma_offset)\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_45_ewo_min)\n                    item_buy_logic.append(dataframe['ewo_sma_1h'] > self.buy_45_ewo_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_45_cti_1h_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_45_r_480_1h_max)\n\n                # Condition #46 - Long mode\n                elif index == 46:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_46_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['ewo_sma_1h'] > self.buy_46_ewo_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_46_cti_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_46_cti_1h_max)\n\n                # Condition #47 - Long mode\n                elif index == 47:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_47_ewo_min)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_30'] * self.buy_47_ma_offset))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_47_rsi_14_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_47_cti_max)\n                    item_buy_logic.append(dataframe['r_14'] < self.buy_47_r_14_max)\n                    item_buy_logic.append(dataframe['ewo_sma_1h'] > self.buy_47_ewo_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_47_cti_1h_min)\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_47_cti_1h_max)\n\n                # Condition #48 - Uptrend mode\n                elif index == 48:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['moderi_32'])\n                    item_buy_logic.append(dataframe['moderi_64'])\n                    item_buy_logic.append(dataframe['moderi_96'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_sma'] > self.buy_48_ewo_min)\n                    item_buy_logic.append(dataframe['ewo_sma_1h'] > self.buy_48_ewo_1h_min)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_48_r_480_min)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_48_r_480_1h_min)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_48_r_480_1h_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] > dataframe['r_480_1h'].shift(12))\n                    item_buy_logic.append(dataframe['cti_1h'] > self.buy_48_cti_1h_min)\n                    item_buy_logic.append(dataframe['crsi_1h'] > self.buy_48_crsi_1h_min)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(12).min() < -0.5)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(12).max() < 0.0)\n                    item_buy_logic.append(dataframe['cti'].shift(1) < 0.0)\n                    item_buy_logic.append(dataframe['cti'] > 0.0)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n\n        self._remove_profit_target(pair)\n        return True\n\n    def _set_profit_target(self, pair: str, sell_reason: str, rate: float, current_time: \"datetime\"):\n        self.target_profit_cache.data[pair] = {\n            \"rate\": rate,\n            \"sell_reason\": sell_reason,\n            \"time_profit_reached\": current_time.isoformat()\n        }\n        self.target_profit_cache.save()\n\n    def _remove_profit_target(self, pair: str):\n        if self.target_profit_cache is not None:\n            self.target_profit_cache.data.pop(pair, None)\n            self.target_profit_cache.save()\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\ndef ewo_sma(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.SMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.SMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef HeikinAshi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data"
  },
  {
    "path": "strategies/NostalgiaForInfinityNext_ChangeToTower_V5_2/NostalgiaForInfinityNext_ChangeToTower_V5_2.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNext_ChangeToTower_V5_2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"80\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"70\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        3: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        4: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        5: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"30\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        9: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"40\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        18: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        19: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"90\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        24: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"60\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        30: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        40: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        }\n    }\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_2 = DecimalParameter(0.16, 0.3, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_3 = DecimalParameter(0.3, 0.5, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_4 = DecimalParameter(0.6, 1.0, default=0.86, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_2 = DecimalParameter(0.16, 0.34, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_3 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_4 = DecimalParameter(0.6, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_1 = DecimalParameter(-0.99, -0.5, default=-0.92, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=38.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_2 = DecimalParameter(0.6, 6.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.045, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_3 = DecimalParameter(-0.99, -0.5, default=-0.5, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_cti_4 = DecimalParameter(-0.99, -0.5, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.915, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_5 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_5 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.976, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.030, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_7 = DecimalParameter(-0.99, -0.5, default=-0.89, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_cti_8 = DecimalParameter(-0.99, -0.5, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(20.0, 50.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_8 = DecimalParameter(0.98, 1.0, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_8 = DecimalParameter(40.0, 66.0, default=64.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_8 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.968, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.94, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.972, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(30.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.946, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.038, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.921, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_12 = DecimalParameter(-0.99, -0.5, default=-0.7, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_13 = DecimalParameter(-0.99, -0.5, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-9.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.945, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_14 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.953, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_16 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-9.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_17 = DecimalParameter(-0.99, -0.5, default=-0.96, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_17 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(20.0, 36.0, default=33.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_18 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_18 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_max_19 = DecimalParameter(20.0, 60.0, default=21.3, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=16.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_20 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_20 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=14.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_21 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=5.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=6.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=32.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.932, space='buy', optimize=False, load=True)\n    buy_26_cti = DecimalParameter(-0.99, -0.4, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n    buy_26_volume = DecimalParameter(0.6, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(90, 99, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n    buy_27_cti = DecimalParameter(-0.99, -0.4, default=-0.93, space='buy', decimals=2, optimize=False, load=True)\n    buy_27_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_28_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_28_ewo = DecimalParameter(2.0, 14.0, default=7.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_rsi = DecimalParameter(24.0, 44.0, default=32.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_29_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_29_ewo = DecimalParameter(-14.0, -2.0, default=-4.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_29_cti = DecimalParameter(-0.99, -0.4, default=-0.95, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_30_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_30_ewo = DecimalParameter(2.0, 14.0, default=7.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_rsi = DecimalParameter(24.0, 48.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_31_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_31_ewo = DecimalParameter(-22.0, -8.0, default=-19.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_31_wr = DecimalParameter(-99.9, -95.0, default=-98.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_32_ma_offset = DecimalParameter(0.90, 0.99, default=0.934, space='buy', optimize=False, load=True)\n    buy_32_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_32_rsi = DecimalParameter(24.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_32_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_33_ma_offset = DecimalParameter(0.90, 0.99, default=0.988, space='buy', optimize=False, load=True)\n    buy_33_rsi = DecimalParameter(24.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_33_ewo = DecimalParameter(2.0, 14.0, default=6.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_34_ma_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=False, load=True)\n    buy_34_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_34_ewo = DecimalParameter(-24.0, -5.0, default=-6.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_34_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_34_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_bull_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_2 = DecimalParameter(30.0, 50.0, default=36.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_3 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_4 = DecimalParameter(35.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_5 = DecimalParameter(35.0, 50.0, default=49.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_6 = DecimalParameter(38.0, 55.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_8 = DecimalParameter(40.0, 50.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_9 = DecimalParameter(40.0, 60.0, default=46.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_11 = DecimalParameter(28.0, 40.0, default=30.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_profit_bear_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_bear_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_3 = DecimalParameter(30.0, 50.0, default=44.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_4 = DecimalParameter(35.0, 50.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_5 = DecimalParameter(35.0, 50.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_5 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_6 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_7 = DecimalParameter(70.0, 85.0, default=80.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_8 = DecimalParameter(40.0, 50.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_8 = DecimalParameter(70.0, 85.0, default=82.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_11 = DecimalParameter(28.0, 40.0, default=30.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_1 = DecimalParameter(36.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_2 = DecimalParameter(46.0, 66.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_3 = DecimalParameter(50.0, 68.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_4 = DecimalParameter(50.0, 68.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_6 = DecimalParameter(44.0, 60.0, default=48.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_7 = DecimalParameter(46.0, 60.0, default=44.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_8 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_9 = DecimalParameter(40.0, 60.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_10 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_11 = DecimalParameter(24.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_under_profit_bear_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_1 = DecimalParameter(36.0, 60.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_3 = DecimalParameter(50.0, 68.0, default=61.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_4 = DecimalParameter(50.0, 68.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_5 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_6 = DecimalParameter(44.0, 60.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_6 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_7 = DecimalParameter(46.0, 60.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_7 = DecimalParameter(70.0, 85.0, default=80.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_8 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_8 = DecimalParameter(70.0, 85.0, default=82.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_9 = DecimalParameter(40.0, 60.0, default=36.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_10 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_11 = DecimalParameter(24.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = DecimalParameter(0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_profit_max_1 = DecimalParameter(0.0, 0.05, default=0.02, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = None\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = {}\n\n        # Update values from config file, if it exists\n        hold_trades_config_file = NostalgiaForInfinityNext_ChangeToTower_V5_2.get_hold_trades_config_file()\n        if not hold_trades_config_file:\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            trade_ids = None\n            hold_trades_config = None\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                trade_ids = hold_trades_config.get(\"trade_ids\")\n\n            if not trade_ids:\n                return\n\n            open_trades = {\n                trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n            }\n\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    try:\n                        trade_id = int(trade_id)\n                    except ValueError:\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            hold_trades_config_file\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_profit_bull_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_11.value:\n                        return True, 'signal_profit_o_bull_11'\n                elif self.sell_custom_profit_bull_11.value > current_profit >= self.sell_custom_profit_bull_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_10.value:\n                        return True, 'signal_profit_o_bull_10'\n                elif self.sell_custom_profit_bull_10.value > current_profit >= self.sell_custom_profit_bull_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_9.value:\n                        return True, 'signal_profit_o_bull_9'\n                elif self.sell_custom_profit_bull_9.value > current_profit >= self.sell_custom_profit_bull_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_8.value:\n                        return True, 'signal_profit_o_bull_8'\n                elif self.sell_custom_profit_bull_8.value > current_profit >= self.sell_custom_profit_bull_7.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_7.value):\n                        return True, 'signal_profit_o_bull_7'\n                elif self.sell_custom_profit_bull_7.value > current_profit >= self.sell_custom_profit_bull_6.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_6.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6'\n                elif self.sell_custom_profit_bull_6.value > current_profit >= self.sell_custom_profit_bull_5.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_5.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5'\n                elif self.sell_custom_profit_bull_5.value > current_profit >= self.sell_custom_profit_bull_4.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_4.value) and (last_candle['cmf'] < 0.0) :\n                        return True, 'signal_profit_o_bull_4'\n                elif self.sell_custom_profit_bull_4.value > current_profit >= self.sell_custom_profit_bull_3.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_3.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3'\n                elif self.sell_custom_profit_bull_3.value > current_profit >= self.sell_custom_profit_bull_2.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_2.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2'\n                elif self.sell_custom_profit_bull_2.value > current_profit >= self.sell_custom_profit_bull_1.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_1.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1'\n                elif self.sell_custom_profit_bull_1.value > current_profit >= self.sell_custom_profit_bull_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_0'\n            else:\n                if current_profit >= self.sell_custom_profit_bear_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_11.value:\n                        return True, 'signal_profit_o_bear_11'\n                elif self.sell_custom_profit_bear_11.value > current_profit >= self.sell_custom_profit_bear_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_10.value:\n                        return True, 'signal_profit_o_bear_10'\n                elif self.sell_custom_profit_bear_10.value > current_profit >= self.sell_custom_profit_bear_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_9.value:\n                        return True, 'signal_profit_o_bear_9'\n                elif self.sell_custom_profit_bear_9.value > current_profit >= self.sell_custom_profit_bear_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_8.value:\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_8.value):\n                        return True, 'signal_profit_o_bear_8_2'\n                elif self.sell_custom_profit_bear_8.value > current_profit >= self.sell_custom_profit_bear_7.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_7.value):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_7.value):\n                        return True, 'signal_profit_o_bear_7_2'\n                elif self.sell_custom_profit_bear_7.value > current_profit >= self.sell_custom_profit_bear_6.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_6.value):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_6.value):\n                        return True, 'signal_profit_o_bear_6_2'\n                elif self.sell_custom_profit_bear_6.value > current_profit >= self.sell_custom_profit_bear_5.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_5.value):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_5.value):\n                        return True, 'signal_profit_o_bear_5_2'\n                elif self.sell_custom_profit_bear_5.value > current_profit >= self.sell_custom_profit_bear_4.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_4.value):\n                        return True, 'signal_profit_o_bear_4'\n                elif self.sell_custom_profit_bear_4.value > current_profit >= self.sell_custom_profit_bear_3.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_3.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3'\n                elif self.sell_custom_profit_bear_3.value > current_profit >= self.sell_custom_profit_bear_2.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_2.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2'\n                elif self.sell_custom_profit_bear_2.value > current_profit >= self.sell_custom_profit_bear_1.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_1.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1'\n                elif self.sell_custom_profit_bear_1.value > current_profit >= self.sell_custom_profit_bear_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_0'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_under_profit_bull_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_11.value:\n                        return True, 'signal_profit_u_bull_11'\n                elif self.sell_custom_under_profit_bull_11.value > current_profit >= self.sell_custom_under_profit_bull_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_10.value:\n                        return True, 'signal_profit_u_bull_10'\n                elif self.sell_custom_under_profit_bull_10.value > current_profit >= self.sell_custom_under_profit_bull_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_9.value:\n                        return True, 'signal_profit_u_bull_9'\n                elif self.sell_custom_under_profit_bull_9.value > current_profit >= self.sell_custom_under_profit_bull_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_8.value:\n                        return True, 'signal_profit_u_bull_8'\n                elif self.sell_custom_under_profit_bull_8.value > current_profit >= self.sell_custom_under_profit_bull_7.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_7.value:\n                        return True, 'signal_profit_u_bull_7'\n                elif self.sell_custom_under_profit_bull_7.value > current_profit >= self.sell_custom_under_profit_bull_6.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_6.value:\n                        return True, 'signal_profit_u_bull_6'\n                elif self.sell_custom_under_profit_bull_6.value > current_profit >= self.sell_custom_under_profit_bull_5.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_5.value:\n                        return True, 'signal_profit_u_bull_5'\n                elif self.sell_custom_under_profit_bull_5.value > current_profit >= self.sell_custom_under_profit_bull_4.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_4.value:\n                        return True, 'signal_profit_u_bull_4'\n                elif self.sell_custom_under_profit_bull_4.value > current_profit >= self.sell_custom_under_profit_bull_3.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_3.value:\n                        return True, 'signal_profit_u_bull_3'\n                elif self.sell_custom_under_profit_bull_3.value > current_profit >= self.sell_custom_under_profit_bull_2.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_2.value:\n                        return True, 'signal_profit_u_bull_2'\n                elif self.sell_custom_under_profit_bull_2.value > current_profit >= self.sell_custom_under_profit_bull_1.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_1.value:\n                        return True, 'signal_profit_u_bull_1'\n                elif self.sell_custom_under_profit_bull_1.value > current_profit >= self.sell_custom_under_profit_bull_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_0'\n            else:\n                if current_profit >= self.sell_custom_under_profit_bear_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_11.value:\n                        return True, 'signal_profit_u_bear_11'\n                elif self.sell_custom_under_profit_bear_11.value > current_profit >= self.sell_custom_under_profit_bear_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_10.value:\n                        return True, 'signal_profit_u_bear_10'\n                elif self.sell_custom_under_profit_bear_10.value > current_profit >= self.sell_custom_under_profit_bear_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_9.value:\n                        return True, 'signal_profit_u_bear_9'\n                elif self.sell_custom_under_profit_bear_9.value > current_profit >= self.sell_custom_under_profit_bear_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_8.value:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_8.value):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif self.sell_custom_under_profit_bear_8.value > current_profit >= self.sell_custom_under_profit_bear_7.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_7.value:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_7.value):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif self.sell_custom_under_profit_bear_7.value > current_profit >= self.sell_custom_under_profit_bear_6.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_6.value:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_6.value):\n                        return True, 'signal_profit_u_bear_6_2'\n                elif self.sell_custom_under_profit_bear_6.value > current_profit >= self.sell_custom_under_profit_bear_5.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_5.value:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_5.value):\n                        return True, 'signal_profit_u_bear_5_2'\n                elif self.sell_custom_under_profit_bear_5.value > current_profit >= self.sell_custom_under_profit_bear_4.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_4.value:\n                        return True, 'signal_profit_u_bear_4'\n                elif self.sell_custom_under_profit_bear_4.value > current_profit >= self.sell_custom_under_profit_bear_3.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_3.value:\n                        return True, 'signal_profit_u_bear_3'\n                elif self.sell_custom_under_profit_bear_3.value > current_profit >= self.sell_custom_under_profit_bear_2.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_2.value:\n                        return True, 'signal_profit_u_bear_2'\n                elif self.sell_custom_under_profit_bear_2.value > current_profit >= self.sell_custom_under_profit_bear_1.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_1.value:\n                        return True, 'signal_profit_u_bear_1'\n                elif self.sell_custom_under_profit_bear_1.value > current_profit >= self.sell_custom_under_profit_bear_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit >= self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit >= self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit >= self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit >= self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit >= self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit >= self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit >= self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit >= self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit >= self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit >= self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit >= self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit >= self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit >= self.sell_custom_dec_profit_min_1.value) and (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit >= self.sell_custom_dec_profit_min_2.value) and (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit >= self.sell_trail_profit_min_1.value) and (self.sell_trail_rsi_min_1.value < last_candle['rsi_14'] < self.sell_trail_rsi_max_1.value) and (max_profit > (current_profit + self.sell_trail_down_1.value)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit >= self.sell_trail_profit_min_2.value) and (self.sell_trail_rsi_min_2.value < last_candle['rsi_14'] < self.sell_trail_rsi_max_2.value) and (max_profit > (current_profit + self.sell_trail_down_2.value)) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit >= self.sell_trail_profit_min_3.value) and (max_profit > (current_profit + self.sell_trail_down_3.value)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit >= self.sell_trail_profit_min_4.value) and (max_profit > (current_profit + self.sell_trail_down_4.value)) and (last_candle['sma_200_dec_24']) and (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) and (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1.value > current_profit >= self.sell_custom_profit_under_profit_min_1.value) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit >= self.sell_custom_profit_under_profit_2.value) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, previous_candle_1) -> tuple:\n        if (-0.12 <= current_profit < -0.08):\n            if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                return True, 'signal_stoploss_atr_1'\n        elif (-0.16 <= current_profit < -0.12):\n            if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                return True, 'signal_stoploss_atr_2'\n        elif (-0.2 <= current_profit < -0.16):\n            if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                return True, 'signal_stoploss_atr_3'\n        elif (current_profit < -0.2):\n            if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                return True, 'signal_stoploss_atr_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit >= self.sell_custom_pump_dec_profit_min_1.value) and (last_candle['sell_pump_48_1_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit >= self.sell_custom_pump_dec_profit_min_2.value) and (last_candle['sell_pump_48_2_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit >= self.sell_custom_pump_dec_profit_min_3.value) and (last_candle['sell_pump_48_3_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit >= self.sell_custom_pump_dec_profit_min_4.value) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit >= self.sell_custom_pump_under_profit_min_1.value) and (last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (self.sell_custom_pump_trail_profit_max_1.value > current_profit >= self.sell_custom_pump_trail_profit_min_1.value) and (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi_14'] < self.sell_custom_pump_trail_rsi_max_1.value) and (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) and (current_profit >= self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) and (self.sell_custom_recover_profit_max_2.value > current_profit >= self.sell_custom_recover_profit_min_2.value) and (last_candle['rsi_14'] < self.sell_custom_recover_rsi_2.value) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.1:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.2:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.4:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -0.8:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -1.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -1.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -1.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -2.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -2.2) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -2.3) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -2.4) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -2.8) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.4) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.2) and (last_candle['rsi_14'] > 81.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 81.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 79.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.9):\n            return True, 'signal_profit_q_2'\n\n        if (last_candle['close'] < last_candle['atr_high_thresh_q']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_q']):\n            if (current_profit > 0.0):\n                return True, 'signal_profit_q_atr'\n            elif (current_profit < -0.05):\n                return True, 'signal_stoploss_q_atr'\n\n        if (current_profit > 0.0):\n            if (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n                return True, 'signal_profit_q_pmax_bull'\n            if (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.014):\n                return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['zlema_4'] > last_candle['zlema_1']) and (previous_candle_1['zlema_4'] < previous_candle_1['zlema_1']) and (last_candle['cci'] > 200) and (last_candle['hrsi'] > 80) and (last_candle['moderi_32'] == True) and (current_profit > 0):\n            return True, 'signal_profit_zlema_up'\n\n        if (last_candle['zlema_4_std'] > last_candle['zlema_1_std']) and (previous_candle_1['zlema_4_std'] < previous_candle_1['zlema_1_std']) and (last_candle['cci'] > -100) and (last_candle['hrsi'] > 80) and (last_candle['moderi_32'] == False) and (current_profit > 0):\n            return True, 'signal_profit_zlema_dn'\n\n#        if (current_time - timedelta(minutes=600) > trade.open_date_utc) and (last_candle['rsi_14'] > 70):\n#            return True, 'make_space'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (-0.03 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 75):\n            return True, 'signal_ichi_underwater'\n        if (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_ichi_recover_0'\n        if (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_ichi_recover_1'\n        if (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_ichi_recover_2'\n        if (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_ichi_recover_3'\n        if (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_ichi_recover_4'\n        if (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_ichi_slow_trade'\n        if (0.07 < current_profit < 0.1) and (max_profit-current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_ichi_trailing'\n        if (current_profit < -0.1):\n            return True, 'signal_ichi_stoploss'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        else:\n            trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n            if not buy_signal.empty:\n                buy_signal_candle = buy_signal.iloc[-1]\n                buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if all(c in ['32', '33', '34', '35', '36', '37', '38', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, previous_candle_1)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Sell signal 1\n        if self.sell_condition_1_enable.value and (last_candle['rsi_14'] > self.sell_rsi_bb_1.value) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_1_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable.value) and (last_candle['rsi_14'] > self.sell_rsi_bb_2.value) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_2_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable.value and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4.value) and (last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_4_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable.value and (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6.value):\n            if (current_profit > 0.0):\n                    return 'sell_signal_6_1' + ' ( ' + buy_tag + ')'\n            elif (max_loss > 0.25):\n                return 'sell_signal_6_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable.value and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7.value) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_7_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable.value and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_8_2_2' + ' ( ' + buy_tag + ')'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # EFI - Elders Force Index\n        informative_1h['efi'] = pta.efi(informative_1h[\"close\"], informative_1h[\"volume\"], length=13)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        #HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        #HRSI\n        dataframe['hull'] = (2 * dataframe['hlc3'] - ta.WMA(dataframe['hlc3'], 2))\n        dataframe['hrsi'] = ta.RSI(dataframe['hull'], 2)\n\n        dataframe['hull_sell'] = (2 * dataframe['low'] - ta.WMA(dataframe['low'], 2))\n        dataframe['hrsi_sell'] = ta.RSI(dataframe['hull_sell'], 2)\n\n        #Kalman Filter HLC3\n        dataframe['hlc3KF'] = KalmanFilter(dataframe, source='hlc3')\n\n        #Kalman Filter LOW\n        dataframe['lowKF'] = KalmanFilter(dataframe, source='low')\n\n        #ZLEMA BUY\n        dataframe['zlema_1'] = dataframe['hlc3KF']\n        dataframe['zlema_1_std'] =  dataframe['hlc3']\n        dataframe['ema_data'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(2))\n        dataframe['ema_data_2'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(1))\n        dataframe['zlema_4'] = ta.EMA(dataframe['ema_data'], timeperiod = 4)\n        dataframe['zlema_2'] = ta.EMA(dataframe['ema_data_2'], timeperiod = 2)\n        dataframe['zlema_4_std'] = pta.zlma(dataframe['hlc3'], length = 4)\n\n        #ZLEMA SELL\n        dataframe['zlema_1_sell'] =  dataframe['lowKF']\n        dataframe['zlema_1_std_sell'] =  dataframe['low']\n        dataframe['ema_data_sell'] = dataframe['lowKF']  + (dataframe['lowKF']  - dataframe['lowKF'].shift(2))\n        dataframe['zlema_4_sell'] = ta.EMA(dataframe['ema_data_sell'], timeperiod = 4)\n        dataframe['zlema_4_std_sell'] = pta.zlma(dataframe['low'], length = 4)\n\n        #CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 5.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 5.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n        dataframe['atr_high_thresh_q'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1.value, self.buy_dip_threshold_120_2.value, self.buy_dip_threshold_120_3.value, self.buy_dip_threshold_120_4.value)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1.value, self.buy_dip_threshold_130_2.value, self.buy_dip_threshold_130_3.value, self.buy_dip_threshold_130_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params['buy_condition_' + str(index) + '_enable']:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type']}\"])\n                if global_buy_protection_params[\"safe_pump\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period']}_{global_buy_protection_params['safe_pump_type']}_1h\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if not self.config['runmode'] in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_1.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_1.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_1.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_1.value)\n\n                # Condition #2\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14_1h'] - self.buy_rsi_1h_diff_2.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2.value))\n\n                # Condition #3\n                elif index == 3:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_3.value)\n\n                # Condition #4\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_4.value)\n\n                # Condition #5\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_5.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5.value))\n\n                # Condition #6\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n\n                # Condition #7\n                elif index == 7:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_7.value)\n\n                # Condition #8\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_8.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8.value))\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_8.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8.value))\n\n                # Condition #9\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_9.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_9.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n\n                # Condition #10\n                elif index == 10:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_10.value)\n\n                # Condition #11\n                elif index == 11:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_11.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_11.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_11.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n\n                # Condition #12\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_12.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_12.value)\n\n                # Condition #13\n                elif index == 13:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_13.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n\n                # Condition #14\n                elif index == 14:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_14.value)\n\n                # Condition #15\n                elif index == 15:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_15.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n\n                # Condition #16\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_16.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_16.value)\n\n                # Condition #17\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_17.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17.value))\n\n                # Condition #18\n                elif index == 18:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n                    item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_18.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_18.value)\n\n                # Condition #19\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_19.value)\n                    item_buy_logic.append(dataframe['chop'] < self.buy_chop_max_19.value)\n                    item_buy_logic.append(dataframe['moderi_32'] == True)\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['moderi_96'] == True)\n\n                # Condition #20\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_20.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_20.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_20.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20.value))\n\n                # Condition #21\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_21.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_21.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21.value))\n\n                # Condition #22\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_22.value)\n\n                # Condition #23\n                elif index == 23:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_23.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_23.value)\n\n                # Condition #24\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_24_rsi_max.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_24_rsi_1h_min.value)\n\n                # Condition #25\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4.value)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n                    item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n                    item_buy_logic.append(\n                        (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                        (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                    )\n                    item_buy_logic.append(dataframe['cti'] < self.buy_25_cti.value)\n\n                # Condition #26\n                elif index == 26:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_26_cti.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume.value))\n\n                # Condition #27\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < self.buy_27_rsi_max.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_27_cti.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume.value))\n\n                # Condition #28\n                elif index == 28:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_28_rsi.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_28_cti.value)\n\n                # Condition #29\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_29_cti.value)\n\n                # Condition #30\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_30_rsi.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_30_cti.value)\n\n                # Condition #31\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset.value )\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo.value)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr.value)\n\n                # Condition #32 - Quick mode buy\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_32'])\n                    item_buy_logic.append(dataframe['moderi_64'])\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_32_cti.value)\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi.value)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset.value))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n\n                # Condition #33 - Quick mode buy\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_33_cti.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_33_rsi.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume.value))\n\n                # Condition #34 - Quick mode buy\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['cti'] < self.buy_34_cti.value)\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume.value))\n\n                # Condition #35 - PMAX0 buy\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.984)\n                    item_buy_logic.append(dataframe['ewo'] > 9.6)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n\n                # Condition #36 - PMAX1 buy\n                elif index == 36:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -8.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n\n                # Condition #37 - PMAX2 buy\n                elif index == 37:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] > 9.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 56.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.7)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #38 - PMAX3 buy\n                elif index == 38:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.7)\n                    item_buy_logic.append(dataframe['ewo'] < -2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.86)\n\n                # Condition #39 - Ichimoku\n                elif index == 39:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['cloud_top_1h'])\n                    item_buy_logic.append(dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h'])\n                    item_buy_logic.append(dataframe['chikou_span_1h'] > dataframe['senkou_a_1h'])\n                    item_buy_logic.append(dataframe['efi_1h'] > 0)\n                    item_buy_logic.append(dataframe['ssl_up_1h'] > dataframe['ssl_down_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['ssl_up_1h'])\n                    item_buy_logic.append(dataframe['cti'] < -0.73)\n                    # Start of trend\n                    item_buy_logic.append(\n                        (dataframe['leading_senkou_span_a_1h'].shift(12) < dataframe['leading_senkou_span_b_1h'].shift(12)) |\n                        (dataframe['efi_1h'] < 0) |\n                        (dataframe['ssl_up_1h'].shift(12) < dataframe['ssl_down_1h'].shift(12))\n                    )\n\n                # Condition #40 - ZLEMA X buy\n                elif index == 40:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['zlema_2'], dataframe['zlema_4']))\n                    item_buy_logic.append(dataframe['hrsi'] < 30)\n                    item_buy_logic.append(dataframe['cci'] < -200)\n                    item_buy_logic.append(dataframe['rsi_14'] < 30)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += str(index) + ' '\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            if not self.hold_trade_ids:\n                # We have no pairs we want to hold until profit, sell\n                return True\n\n            if trade.id not in self.hold_trade_ids:\n                # This pair is not on the list to hold until profit, sell\n                return True\n\n            trade_profit_ratio = self.hold_trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return True\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return True\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return False\n        else:\n            return True\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\n#Kalman Filter\ndef KalmanFilter(dtloc, source = 'close'):\n\n    dtKF = dtloc.copy().fillna(0)\n    dtKF['TRANGE'] = ta.TRANGE(dtloc).fillna(0)\n\n\n    def calc_dtKF(dfr, init=0):\n        global calc_dtKF_value_1\n        global calc_dtKF_value_2\n        global calc_dtKF_value_3\n        global calc_dtKF_source\n        if init == 1:\n            calc_dtKF_value_1 = 0.0\n            calc_dtKF_value_2 = 0.0\n            calc_dtKF_value_3 = 0.0\n            calc_dtKF_source = 0.0\n            return\n        calc_dtKF_value_1 = 0.2 * (dfr[source] - calc_dtKF_source) + 0.8 * calc_dtKF_value_1\n        calc_dtKF_value_2 = 0.1 * dfr['TRANGE'] + 0.8 * calc_dtKF_value_2\n        if calc_dtKF_value_2 != 0:\n            vlambda = abs(calc_dtKF_value_1/calc_dtKF_value_2)\n        else:\n            vlambda = 0\n        valpha =  (-1*math.pow(vlambda,2) + math.sqrt(math.pow(vlambda,4) + 16 * math.pow(vlambda,2)))/8\n        calc_dtKF_value_3 = valpha * dfr[source] + (1 - valpha) * calc_dtKF_value_3\n        calc_dtKF_source = dfr[source]\n\n        return calc_dtKF_value_3\n    calc_dtKF(None, init=1)\n    dtKF['KF'] = dtKF.apply(calc_dtKF, axis = 1)\n    return dtKF['KF']\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityNext_ChangeToTower_V5_3/NostalgiaForInfinityNext_ChangeToTower_V5_3.py",
    "content": "import logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNext_ChangeToTower_V5_3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"80\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"70\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        3: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        4: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        5: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"30\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        9: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"40\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        18: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        19: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"90\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        24: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"60\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        30: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        40: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        }\n    }\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_2 = DecimalParameter(0.16, 0.3, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_3 = DecimalParameter(0.3, 0.5, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_4 = DecimalParameter(0.6, 1.0, default=0.86, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_2 = DecimalParameter(0.16, 0.34, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_3 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_4 = DecimalParameter(0.6, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_1 = DecimalParameter(-0.99, -0.5, default=-0.92, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=38.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_2 = DecimalParameter(0.6, 6.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.045, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_3 = DecimalParameter(-0.99, -0.5, default=-0.5, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_cti_4 = DecimalParameter(-0.99, -0.5, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.915, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_5 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_5 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.976, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.030, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_7 = DecimalParameter(-0.99, -0.5, default=-0.89, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_cti_8 = DecimalParameter(-0.99, -0.5, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(20.0, 50.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_8 = DecimalParameter(0.98, 1.0, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_8 = DecimalParameter(40.0, 66.0, default=64.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_8 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.968, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.94, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.972, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(30.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.946, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.038, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.921, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_12 = DecimalParameter(-0.99, -0.5, default=-0.7, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_13 = DecimalParameter(-0.99, -0.5, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-9.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.945, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_14 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.953, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_16 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-9.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_17 = DecimalParameter(-0.99, -0.5, default=-0.96, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_17 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(20.0, 36.0, default=33.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_18 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_18 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_max_19 = DecimalParameter(20.0, 60.0, default=21.3, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=16.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_20 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_20 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=14.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_21 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=5.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=6.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=32.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.932, space='buy', optimize=False, load=True)\n    buy_26_cti = DecimalParameter(-0.99, -0.4, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n    buy_26_volume = DecimalParameter(0.6, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(90, 99, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n    buy_27_cti = DecimalParameter(-0.99, -0.4, default=-0.93, space='buy', decimals=2, optimize=False, load=True)\n    buy_27_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_28_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_28_ewo = DecimalParameter(2.0, 14.0, default=7.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_rsi = DecimalParameter(24.0, 44.0, default=32.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_29_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_29_ewo = DecimalParameter(-14.0, -2.0, default=-4.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_29_cti = DecimalParameter(-0.99, -0.4, default=-0.95, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_30_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_30_ewo = DecimalParameter(2.0, 14.0, default=7.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_rsi = DecimalParameter(24.0, 48.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_31_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_31_ewo = DecimalParameter(-22.0, -8.0, default=-19.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_31_wr = DecimalParameter(-99.9, -95.0, default=-98.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_32_ma_offset = DecimalParameter(0.90, 0.99, default=0.934, space='buy', optimize=False, load=True)\n    buy_32_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_32_rsi = DecimalParameter(24.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_32_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_33_ma_offset = DecimalParameter(0.90, 0.99, default=0.988, space='buy', optimize=False, load=True)\n    buy_33_rsi = DecimalParameter(24.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_33_ewo = DecimalParameter(2.0, 14.0, default=6.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_34_ma_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=False, load=True)\n    buy_34_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_34_ewo = DecimalParameter(-24.0, -5.0, default=-6.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_34_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_34_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_bull_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_2 = DecimalParameter(30.0, 50.0, default=36.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_3 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_4 = DecimalParameter(35.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_5 = DecimalParameter(35.0, 50.0, default=49.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_6 = DecimalParameter(38.0, 55.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_8 = DecimalParameter(40.0, 50.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_9 = DecimalParameter(40.0, 60.0, default=46.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_11 = DecimalParameter(28.0, 40.0, default=30.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_profit_bear_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_bear_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_3 = DecimalParameter(30.0, 50.0, default=44.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_4 = DecimalParameter(35.0, 50.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_5 = DecimalParameter(35.0, 50.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_5 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_6 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_7 = DecimalParameter(70.0, 85.0, default=80.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_8 = DecimalParameter(40.0, 50.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_8 = DecimalParameter(70.0, 85.0, default=82.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_11 = DecimalParameter(28.0, 40.0, default=30.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_1 = DecimalParameter(36.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_2 = DecimalParameter(46.0, 66.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_3 = DecimalParameter(50.0, 68.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_4 = DecimalParameter(50.0, 68.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_6 = DecimalParameter(44.0, 60.0, default=48.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_7 = DecimalParameter(46.0, 60.0, default=44.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_8 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_9 = DecimalParameter(40.0, 60.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_10 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_11 = DecimalParameter(24.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_under_profit_bear_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_1 = DecimalParameter(36.0, 60.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_3 = DecimalParameter(50.0, 68.0, default=61.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_4 = DecimalParameter(50.0, 68.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_5 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_6 = DecimalParameter(44.0, 60.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_6 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_7 = DecimalParameter(46.0, 60.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_7 = DecimalParameter(70.0, 85.0, default=80.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_8 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_8 = DecimalParameter(70.0, 85.0, default=82.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_9 = DecimalParameter(40.0, 60.0, default=36.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_10 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_11 = DecimalParameter(24.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = DecimalParameter(0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_profit_max_1 = DecimalParameter(0.0, 0.05, default=0.02, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = None\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = {}\n\n        # Update values from config file, if it exists\n        hold_trades_config_file = NostalgiaForInfinityNext_ChangeToTower_V5_3.get_hold_trades_config_file()\n        if not hold_trades_config_file:\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            trade_ids = None\n            hold_trades_config = None\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                trade_ids = hold_trades_config.get(\"trade_ids\")\n\n            if not trade_ids:\n                return\n\n            open_trades = {\n                trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n            }\n\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    try:\n                        trade_id = int(trade_id)\n                    except ValueError:\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            hold_trades_config_file\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_profit_bull_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_11.value:\n                        return True, 'signal_profit_o_bull_11'\n                elif self.sell_custom_profit_bull_11.value > current_profit >= self.sell_custom_profit_bull_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_10.value:\n                        return True, 'signal_profit_o_bull_10'\n                elif self.sell_custom_profit_bull_10.value > current_profit >= self.sell_custom_profit_bull_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_9.value:\n                        return True, 'signal_profit_o_bull_9'\n                elif self.sell_custom_profit_bull_9.value > current_profit >= self.sell_custom_profit_bull_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_8.value:\n                        return True, 'signal_profit_o_bull_8'\n                elif self.sell_custom_profit_bull_8.value > current_profit >= self.sell_custom_profit_bull_7.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_7.value):\n                        return True, 'signal_profit_o_bull_7'\n                elif self.sell_custom_profit_bull_7.value > current_profit >= self.sell_custom_profit_bull_6.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_6.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6'\n                elif self.sell_custom_profit_bull_6.value > current_profit >= self.sell_custom_profit_bull_5.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_5.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5'\n                elif self.sell_custom_profit_bull_5.value > current_profit >= self.sell_custom_profit_bull_4.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_4.value) and (last_candle['cmf'] < 0.0) :\n                        return True, 'signal_profit_o_bull_4'\n                elif self.sell_custom_profit_bull_4.value > current_profit >= self.sell_custom_profit_bull_3.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_3.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3'\n                elif self.sell_custom_profit_bull_3.value > current_profit >= self.sell_custom_profit_bull_2.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_2.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2'\n                elif self.sell_custom_profit_bull_2.value > current_profit >= self.sell_custom_profit_bull_1.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_1.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1'\n                elif self.sell_custom_profit_bull_1.value > current_profit >= self.sell_custom_profit_bull_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_0'\n            else:\n                if current_profit >= self.sell_custom_profit_bear_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_11.value:\n                        return True, 'signal_profit_o_bear_11'\n                elif self.sell_custom_profit_bear_11.value > current_profit >= self.sell_custom_profit_bear_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_10.value:\n                        return True, 'signal_profit_o_bear_10'\n                elif self.sell_custom_profit_bear_10.value > current_profit >= self.sell_custom_profit_bear_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_9.value:\n                        return True, 'signal_profit_o_bear_9'\n                elif self.sell_custom_profit_bear_9.value > current_profit >= self.sell_custom_profit_bear_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_8.value:\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_8.value):\n                        return True, 'signal_profit_o_bear_8_2'\n                elif self.sell_custom_profit_bear_8.value > current_profit >= self.sell_custom_profit_bear_7.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_7.value):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_7.value):\n                        return True, 'signal_profit_o_bear_7_2'\n                elif self.sell_custom_profit_bear_7.value > current_profit >= self.sell_custom_profit_bear_6.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_6.value):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_6.value):\n                        return True, 'signal_profit_o_bear_6_2'\n                elif self.sell_custom_profit_bear_6.value > current_profit >= self.sell_custom_profit_bear_5.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_5.value):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_5.value):\n                        return True, 'signal_profit_o_bear_5_2'\n                elif self.sell_custom_profit_bear_5.value > current_profit >= self.sell_custom_profit_bear_4.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_4.value):\n                        return True, 'signal_profit_o_bear_4'\n                elif self.sell_custom_profit_bear_4.value > current_profit >= self.sell_custom_profit_bear_3.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_3.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3'\n                elif self.sell_custom_profit_bear_3.value > current_profit >= self.sell_custom_profit_bear_2.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_2.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2'\n                elif self.sell_custom_profit_bear_2.value > current_profit >= self.sell_custom_profit_bear_1.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_1.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1'\n                elif self.sell_custom_profit_bear_1.value > current_profit >= self.sell_custom_profit_bear_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_0'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_under_profit_bull_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_11.value:\n                        return True, 'signal_profit_u_bull_11'\n                elif self.sell_custom_under_profit_bull_11.value > current_profit >= self.sell_custom_under_profit_bull_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_10.value:\n                        return True, 'signal_profit_u_bull_10'\n                elif self.sell_custom_under_profit_bull_10.value > current_profit >= self.sell_custom_under_profit_bull_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_9.value:\n                        return True, 'signal_profit_u_bull_9'\n                elif self.sell_custom_under_profit_bull_9.value > current_profit >= self.sell_custom_under_profit_bull_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_8.value:\n                        return True, 'signal_profit_u_bull_8'\n                elif self.sell_custom_under_profit_bull_8.value > current_profit >= self.sell_custom_under_profit_bull_7.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_7.value:\n                        return True, 'signal_profit_u_bull_7'\n                elif self.sell_custom_under_profit_bull_7.value > current_profit >= self.sell_custom_under_profit_bull_6.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_6.value:\n                        return True, 'signal_profit_u_bull_6'\n                elif self.sell_custom_under_profit_bull_6.value > current_profit >= self.sell_custom_under_profit_bull_5.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_5.value:\n                        return True, 'signal_profit_u_bull_5'\n                elif self.sell_custom_under_profit_bull_5.value > current_profit >= self.sell_custom_under_profit_bull_4.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_4.value:\n                        return True, 'signal_profit_u_bull_4'\n                elif self.sell_custom_under_profit_bull_4.value > current_profit >= self.sell_custom_under_profit_bull_3.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_3.value:\n                        return True, 'signal_profit_u_bull_3'\n                elif self.sell_custom_under_profit_bull_3.value > current_profit >= self.sell_custom_under_profit_bull_2.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_2.value:\n                        return True, 'signal_profit_u_bull_2'\n                elif self.sell_custom_under_profit_bull_2.value > current_profit >= self.sell_custom_under_profit_bull_1.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_1.value:\n                        return True, 'signal_profit_u_bull_1'\n                elif self.sell_custom_under_profit_bull_1.value > current_profit >= self.sell_custom_under_profit_bull_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_0'\n            else:\n                if current_profit >= self.sell_custom_under_profit_bear_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_11.value:\n                        return True, 'signal_profit_u_bear_11'\n                elif self.sell_custom_under_profit_bear_11.value > current_profit >= self.sell_custom_under_profit_bear_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_10.value:\n                        return True, 'signal_profit_u_bear_10'\n                elif self.sell_custom_under_profit_bear_10.value > current_profit >= self.sell_custom_under_profit_bear_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_9.value:\n                        return True, 'signal_profit_u_bear_9'\n                elif self.sell_custom_under_profit_bear_9.value > current_profit >= self.sell_custom_under_profit_bear_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_8.value:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_8.value):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif self.sell_custom_under_profit_bear_8.value > current_profit >= self.sell_custom_under_profit_bear_7.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_7.value:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_7.value):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif self.sell_custom_under_profit_bear_7.value > current_profit >= self.sell_custom_under_profit_bear_6.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_6.value:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_6.value):\n                        return True, 'signal_profit_u_bear_6_2'\n                elif self.sell_custom_under_profit_bear_6.value > current_profit >= self.sell_custom_under_profit_bear_5.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_5.value:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_5.value):\n                        return True, 'signal_profit_u_bear_5_2'\n                elif self.sell_custom_under_profit_bear_5.value > current_profit >= self.sell_custom_under_profit_bear_4.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_4.value:\n                        return True, 'signal_profit_u_bear_4'\n                elif self.sell_custom_under_profit_bear_4.value > current_profit >= self.sell_custom_under_profit_bear_3.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_3.value:\n                        return True, 'signal_profit_u_bear_3'\n                elif self.sell_custom_under_profit_bear_3.value > current_profit >= self.sell_custom_under_profit_bear_2.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_2.value:\n                        return True, 'signal_profit_u_bear_2'\n                elif self.sell_custom_under_profit_bear_2.value > current_profit >= self.sell_custom_under_profit_bear_1.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_1.value:\n                        return True, 'signal_profit_u_bear_1'\n                elif self.sell_custom_under_profit_bear_1.value > current_profit >= self.sell_custom_under_profit_bear_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit >= self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit >= self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit >= self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit >= self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit >= self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit >= self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit >= self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit >= self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit >= self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit >= self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit >= self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit >= self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit >= self.sell_custom_dec_profit_min_1.value) and (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit >= self.sell_custom_dec_profit_min_2.value) and (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit >= self.sell_trail_profit_min_1.value) and (self.sell_trail_rsi_min_1.value < last_candle['rsi_14'] < self.sell_trail_rsi_max_1.value) and (max_profit > (current_profit + self.sell_trail_down_1.value)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit >= self.sell_trail_profit_min_2.value) and (self.sell_trail_rsi_min_2.value < last_candle['rsi_14'] < self.sell_trail_rsi_max_2.value) and (max_profit > (current_profit + self.sell_trail_down_2.value)) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit >= self.sell_trail_profit_min_3.value) and (max_profit > (current_profit + self.sell_trail_down_3.value)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit >= self.sell_trail_profit_min_4.value) and (max_profit > (current_profit + self.sell_trail_down_4.value)) and (last_candle['sma_200_dec_24']) and (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) and (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1.value > current_profit >= self.sell_custom_profit_under_profit_min_1.value) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit >= self.sell_custom_profit_under_profit_2.value) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, previous_candle_1) -> tuple:\n        if (-0.12 <= current_profit < -0.08):\n            if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                return True, 'signal_stoploss_atr_1'\n        elif (-0.16 <= current_profit < -0.12):\n            if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                return True, 'signal_stoploss_atr_2'\n        elif (-0.2 <= current_profit < -0.16):\n            if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                return True, 'signal_stoploss_atr_3'\n        elif (current_profit < -0.2):\n            if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                return True, 'signal_stoploss_atr_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit >= self.sell_custom_pump_dec_profit_min_1.value) and (last_candle['sell_pump_48_1_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit >= self.sell_custom_pump_dec_profit_min_2.value) and (last_candle['sell_pump_48_2_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit >= self.sell_custom_pump_dec_profit_min_3.value) and (last_candle['sell_pump_48_3_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit >= self.sell_custom_pump_dec_profit_min_4.value) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit >= self.sell_custom_pump_under_profit_min_1.value) and (last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (self.sell_custom_pump_trail_profit_max_1.value > current_profit >= self.sell_custom_pump_trail_profit_min_1.value) and (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi_14'] < self.sell_custom_pump_trail_rsi_max_1.value) and (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) and (current_profit >= self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) and (self.sell_custom_recover_profit_max_2.value > current_profit >= self.sell_custom_recover_profit_min_2.value) and (last_candle['rsi_14'] < self.sell_custom_recover_rsi_2.value) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.1:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.2:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.4:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -0.8:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -1.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -1.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -1.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -2.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -2.2) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -2.3) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -2.4) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -2.8) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.4) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.2) and (last_candle['rsi_14'] > 81.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 81.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 79.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.9):\n            return True, 'signal_profit_q_2'\n\n        if (last_candle['close'] < last_candle['atr_high_thresh_q']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_q']):\n            if (current_profit > 0.0):\n                return True, 'signal_profit_q_atr'\n            elif (current_profit < -0.05):\n                return True, 'signal_stoploss_q_atr'\n\n        if (current_profit > 0.0):\n            if (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n                return True, 'signal_profit_q_pmax_bull'\n            if (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.014):\n                return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['zlema_4'] > last_candle['zlema_1']) and (previous_candle_1['zlema_4'] < previous_candle_1['zlema_1']) and (last_candle['cci'] > 200) and (last_candle['hrsi'] > 80) and (last_candle['moderi_32'] == True) and (current_profit > 0):\n            return True, 'signal_profit_zlema_up'\n\n        if (last_candle['zlema_4_std'] > last_candle['zlema_1_std']) and (previous_candle_1['zlema_4_std'] < previous_candle_1['zlema_1_std']) and (last_candle['cci'] > -100) and (last_candle['hrsi'] > 80) and (last_candle['moderi_32'] == False) and (current_profit > 0):\n            return True, 'signal_profit_zlema_dn'\n\n#        if ((max_profit - current_profit) > 0.01) and (current_profit > 0.00):\n#            return True, 'quick_trailing'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (-0.03 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 75):\n            return True, 'signal_ichi_underwater'\n        if (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_ichi_recover_0'\n        if (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_ichi_recover_1'\n        if (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_ichi_recover_2'\n        if (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_ichi_recover_3'\n        if (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_ichi_recover_4'\n        if (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_ichi_slow_trade'\n        if (0.07 < current_profit < 0.1) and (max_profit-current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_ichi_trailing'\n        if (current_profit < -0.1):\n            return True, 'signal_ichi_stoploss'\n        if (last_candle['zlema_4'] > last_candle['zlema_1']) and (previous_candle_1['zlema_4'] < previous_candle_1['zlema_1']) and (last_candle['cci'] > 100) and (last_candle['hrsi'] > 85) and (current_profit > 0):\n            return True, 'signal_ichi_zlema'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        else:\n            trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n            if not buy_signal.empty:\n                buy_signal_candle = buy_signal.iloc[-1]\n                buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if all(c in ['32', '33', '34', '35', '36', '37', '38', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, previous_candle_1)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Sell signal 1\n        if self.sell_condition_1_enable.value and (last_candle['rsi_14'] > self.sell_rsi_bb_1.value) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_1_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable.value) and (last_candle['rsi_14'] > self.sell_rsi_bb_2.value) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_2_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable.value and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4.value) and (last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_4_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable.value and (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6.value):\n            if (current_profit > 0.0):\n                    return 'sell_signal_6_1' + ' ( ' + buy_tag + ')'\n            elif (max_loss > 0.25):\n                return 'sell_signal_6_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable.value and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7.value) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_7_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable.value and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_8_2_2' + ' ( ' + buy_tag + ')'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # EFI - Elders Force Index\n        informative_1h['efi'] = pta.efi(informative_1h[\"close\"], informative_1h[\"volume\"], length=13)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        #HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        #HRSI\n        dataframe['hull'] = (2 * dataframe['hlc3'] - ta.WMA(dataframe['hlc3'], 2))\n        dataframe['hrsi'] = ta.RSI(dataframe['hull'], 2)\n\n        dataframe['hull_sell'] = (2 * dataframe['low'] - ta.WMA(dataframe['low'], 2))\n        dataframe['hrsi_sell'] = ta.RSI(dataframe['hull_sell'], 2)\n\n        #Kalman Filter HLC3\n        dataframe['hlc3KF'] = KalmanFilter(dataframe, source='hlc3')\n\n        #Kalman Filter LOW\n        dataframe['lowKF'] = KalmanFilter(dataframe, source='low')\n\n        #ZLEMA BUY\n        dataframe['zlema_1'] = dataframe['hlc3KF']\n        dataframe['zlema_1_std'] =  dataframe['hlc3']\n        dataframe['ema_data'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(2))\n        dataframe['ema_data_2'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(1))\n        dataframe['zlema_4'] = ta.EMA(dataframe['ema_data'], timeperiod = 4)\n        dataframe['zlema_2'] = ta.EMA(dataframe['ema_data_2'], timeperiod = 2)\n        dataframe['zlema_4_std'] = pta.zlma(dataframe['hlc3'], length = 4)\n\n        #ZLEMA SELL\n        dataframe['zlema_1_sell'] =  dataframe['lowKF']\n        dataframe['zlema_1_std_sell'] =  dataframe['low']\n        dataframe['ema_data_sell'] = dataframe['lowKF']  + (dataframe['lowKF']  - dataframe['lowKF'].shift(2))\n        dataframe['zlema_4_sell'] = ta.EMA(dataframe['ema_data_sell'], timeperiod = 4)\n        dataframe['zlema_4_std_sell'] = pta.zlma(dataframe['low'], length = 4)\n\n        #CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 5.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 5.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n        dataframe['atr_high_thresh_q'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1.value, self.buy_dip_threshold_120_2.value, self.buy_dip_threshold_120_3.value, self.buy_dip_threshold_120_4.value)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1.value, self.buy_dip_threshold_130_2.value, self.buy_dip_threshold_130_3.value, self.buy_dip_threshold_130_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params['buy_condition_' + str(index) + '_enable']:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type']}\"])\n                if global_buy_protection_params[\"safe_pump\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period']}_{global_buy_protection_params['safe_pump_type']}_1h\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if not self.config['runmode'] in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_1.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_1.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_1.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_1.value)\n\n                # Condition #2\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14_1h'] - self.buy_rsi_1h_diff_2.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2.value))\n\n                # Condition #3\n                elif index == 3:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_3.value)\n\n                # Condition #4\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_4.value)\n\n                # Condition #5\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_5.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5.value))\n\n                # Condition #6\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n\n                # Condition #7\n                elif index == 7:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_7.value)\n\n                # Condition #8\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_8.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8.value))\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_8.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8.value))\n\n                # Condition #9\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_9.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_9.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n\n                # Condition #10\n                elif index == 10:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_10.value)\n\n                # Condition #11\n                elif index == 11:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_11.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_11.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_11.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n\n                # Condition #12\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_12.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_12.value)\n\n                # Condition #13\n                elif index == 13:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_13.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n\n                # Condition #14\n                elif index == 14:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_14.value)\n\n                # Condition #15\n                elif index == 15:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_15.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n\n                # Condition #16\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_16.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_16.value)\n\n                # Condition #17\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_17.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17.value))\n\n                # Condition #18\n                elif index == 18:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n                    item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_18.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_18.value)\n\n                # Condition #19\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_19.value)\n                    item_buy_logic.append(dataframe['chop'] < self.buy_chop_max_19.value)\n                    item_buy_logic.append(dataframe['moderi_32'] == True)\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['moderi_96'] == True)\n\n                # Condition #20\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_20.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_20.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_20.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20.value))\n\n                # Condition #21\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_21.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_21.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21.value))\n\n                # Condition #22\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_22.value)\n\n                # Condition #23\n                elif index == 23:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_23.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_23.value)\n\n                # Condition #24\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_24_rsi_max.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_24_rsi_1h_min.value)\n\n                # Condition #25\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4.value)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n                    item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n                    item_buy_logic.append(\n                        (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                        (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                    )\n                    item_buy_logic.append(dataframe['cti'] < self.buy_25_cti.value)\n\n                # Condition #26\n                elif index == 26:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_26_cti.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume.value))\n\n                # Condition #27\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < self.buy_27_rsi_max.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_27_cti.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume.value))\n\n                # Condition #28\n                elif index == 28:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_28_rsi.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_28_cti.value)\n\n                # Condition #29\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_29_cti.value)\n\n                # Condition #30\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_30_rsi.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_30_cti.value)\n\n                # Condition #31\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset.value )\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo.value)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr.value)\n\n                # Condition #32 - Quick mode buy\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_32'])\n                    item_buy_logic.append(dataframe['moderi_64'])\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_32_cti.value)\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi.value)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset.value))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n\n                # Condition #33 - Quick mode buy\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_33_cti.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_33_rsi.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume.value))\n\n                # Condition #34 - Quick mode buy\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['cti'] < self.buy_34_cti.value)\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume.value))\n\n                # Condition #35 - PMAX0 buy\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.984)\n                    item_buy_logic.append(dataframe['ewo'] > 9.6)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n\n                # Condition #36 - PMAX1 buy\n                elif index == 36:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -8.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n\n                # Condition #37 - PMAX2 buy\n                elif index == 37:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] > 9.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 56.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.7)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #38 - PMAX3 buy\n                elif index == 38:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.7)\n                    item_buy_logic.append(dataframe['ewo'] < -2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.86)\n\n                # Condition #39 - Ichimoku\n                elif index == 39:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['cloud_top_1h'])\n                    item_buy_logic.append(dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h'])\n                    item_buy_logic.append(dataframe['chikou_span_1h'] > dataframe['senkou_a_1h'])\n                    item_buy_logic.append(dataframe['efi_1h'] > 0)\n                    item_buy_logic.append(dataframe['ssl_up_1h'] > dataframe['ssl_down_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['ssl_up_1h'])\n                    item_buy_logic.append(dataframe['cti'] < -0.73)\n                    # Start of trend\n                    item_buy_logic.append(\n                        (dataframe['leading_senkou_span_a_1h'].shift(12) < dataframe['leading_senkou_span_b_1h'].shift(12)) |\n                        (dataframe['efi_1h'] < 0) |\n                        (dataframe['ssl_up_1h'].shift(12) < dataframe['ssl_down_1h'].shift(12))\n                    )\n\n                # Condition #40 - ZLEMA X buy\n                elif index == 40:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['zlema_2'], dataframe['zlema_4']))\n                    item_buy_logic.append(dataframe['hrsi'] < 30)\n                    item_buy_logic.append(dataframe['cci'] < -200)\n                    item_buy_logic.append(dataframe['rsi_14'] < 30)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += str(index) + ' '\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            if not self.hold_trade_ids:\n                # We have no pairs we want to hold until profit, sell\n                return True\n\n            if trade.id not in self.hold_trade_ids:\n                # This pair is not on the list to hold until profit, sell\n                return True\n\n            trade_profit_ratio = self.hold_trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return True\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return True\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return False\n        else:\n            return True\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\n#Kalman Filter\ndef KalmanFilter(dtloc, source = 'close'):\n\n    dtKF = dtloc.copy().fillna(0)\n    dtKF['TRANGE'] = ta.TRANGE(dtloc).fillna(0)\n\n\n    def calc_dtKF(dfr, init=0):\n        global calc_dtKF_value_1\n        global calc_dtKF_value_2\n        global calc_dtKF_value_3\n        global calc_dtKF_source\n        if init == 1:\n            calc_dtKF_value_1 = 0.0\n            calc_dtKF_value_2 = 0.0\n            calc_dtKF_value_3 = 0.0\n            calc_dtKF_source = 0.0\n            return\n        calc_dtKF_value_1 = 0.2 * (dfr[source] - calc_dtKF_source) + 0.8 * calc_dtKF_value_1\n        calc_dtKF_value_2 = 0.1 * dfr['TRANGE'] + 0.8 * calc_dtKF_value_2\n        if calc_dtKF_value_2 != 0:\n            vlambda = abs(calc_dtKF_value_1/calc_dtKF_value_2)\n        else:\n            vlambda = 0\n        valpha =  (-1*math.pow(vlambda,2) + math.sqrt(math.pow(vlambda,4) + 16 * math.pow(vlambda,2)))/8\n        calc_dtKF_value_3 = valpha * dfr[source] + (1 - valpha) * calc_dtKF_value_3\n        calc_dtKF_source = dfr[source]\n\n        return calc_dtKF_value_3\n    calc_dtKF(None, init=1)\n    dtKF['KF'] = dtKF.apply(calc_dtKF, axis = 1)\n    return dtKF['KF']\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityNext_ChangeToTower_V6/NostalgiaForInfinityNext_ChangeToTower_V6.py",
    "content": "# -*- coding: utf-8 -*-\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport pandas_ta as pta\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNext_ChangeToTower_V6(IStrategy):\n    INTERFACE_VERSION = 2\n\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"80\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"70\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        3: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        4: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        5: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"30\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        9: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"40\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        18: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        19: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"90\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        24: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"60\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        30: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        40: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        }\n    }\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_2 = DecimalParameter(0.16, 0.3, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_3 = DecimalParameter(0.3, 0.5, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_120_4 = DecimalParameter(0.6, 1.0, default=0.86, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = DecimalParameter(0.001, 0.05, default=0.028, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_2 = DecimalParameter(0.16, 0.34, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_3 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_130_4 = DecimalParameter(0.6, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = DecimalParameter(0.3, 0.8, default=0.4, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = DecimalParameter(0.3, 0.8, default=0.44, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = DecimalParameter(0.3, 0.8, default=0.50, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = DecimalParameter(0.3, 0.8, default=0.58, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = DecimalParameter(0.3, 0.8, default=0.66, space='buy', decimals=2, optimize=False, load=True)\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = DecimalParameter(0.3, 0.8, default=0.74, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_1 = DecimalParameter(-0.99, -0.5, default=-0.92, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=38.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_2 = DecimalParameter(0.6, 6.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.045, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_3 = DecimalParameter(-0.99, -0.5, default=-0.5, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_cti_4 = DecimalParameter(-0.99, -0.5, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.915, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_5 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_5 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.976, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.030, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_7 = DecimalParameter(-0.99, -0.5, default=-0.89, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_cti_8 = DecimalParameter(-0.99, -0.5, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(20.0, 50.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_8 = DecimalParameter(0.98, 1.0, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_8 = DecimalParameter(40.0, 66.0, default=64.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_volume_8 = DecimalParameter(0.6, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.968, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.94, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.972, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(30.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.946, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.038, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.921, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_12 = DecimalParameter(-0.99, -0.5, default=-0.7, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_13 = DecimalParameter(-0.99, -0.5, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-9.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.945, space='buy', decimals=3, optimize=False, load=True)\n    buy_cti_14 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.974, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.953, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_16 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-9.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_17 = DecimalParameter(-0.99, -0.5, default=-0.96, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_17 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(20.0, 36.0, default=33.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_volume_18 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_18 = DecimalParameter(-0.99, -0.5, default=-0.86, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_max_19 = DecimalParameter(20.0, 60.0, default=21.3, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=16.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_20 = DecimalParameter(-0.99, -0.5, default=-0.84, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_20 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=14.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_cti_21 = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_volume_21 = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=5.8, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=6.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=32.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_25_ma_offset = DecimalParameter(0.90, 0.99, default=0.922, space='buy', optimize=False, load=True)\n    buy_25_rsi_4 = DecimalParameter(26.0, 40.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_25_cti = DecimalParameter(-0.99, -0.4, default=-0.76, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.932, space='buy', optimize=False, load=True)\n    buy_26_cti = DecimalParameter(-0.99, -0.4, default=-0.82, space='buy', decimals=2, optimize=False, load=True)\n    buy_26_volume = DecimalParameter(0.6, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_27_wr_max = DecimalParameter(90, 99, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_wr_1h_max = DecimalParameter(90, 99, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_27_rsi_max = DecimalParameter(40, 70, default=50, space='buy', decimals=0, optimize=False, load=True)\n    buy_27_cti = DecimalParameter(-0.99, -0.4, default=-0.93, space='buy', decimals=2, optimize=False, load=True)\n    buy_27_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_28_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_28_ewo = DecimalParameter(2.0, 14.0, default=7.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_rsi = DecimalParameter(24.0, 44.0, default=32.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_28_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_29_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_29_ewo = DecimalParameter(-14.0, -2.0, default=-4.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_29_cti = DecimalParameter(-0.99, -0.4, default=-0.95, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_30_ma_offset = DecimalParameter(0.90, 0.99, default=0.97, space='buy', optimize=False, load=True)\n    buy_30_ewo = DecimalParameter(2.0, 14.0, default=7.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_rsi = DecimalParameter(24.0, 48.0, default=40.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_30_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_31_ma_offset = DecimalParameter(0.90, 0.99, default=0.94, space='buy', optimize=False, load=True)\n    buy_31_ewo = DecimalParameter(-22.0, -8.0, default=-19.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_31_wr = DecimalParameter(-99.9, -95.0, default=-98.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_32_ma_offset = DecimalParameter(0.90, 0.99, default=0.934, space='buy', optimize=False, load=True)\n    buy_32_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_32_rsi = DecimalParameter(24.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_32_cti = DecimalParameter(-0.99, -0.4, default=-0.8, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_33_ma_offset = DecimalParameter(0.90, 0.99, default=0.988, space='buy', optimize=False, load=True)\n    buy_33_rsi = DecimalParameter(24.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_cti = DecimalParameter(-0.99, -0.4, default=-0.9, space='buy', decimals=2, optimize=False, load=True)\n    buy_33_ewo = DecimalParameter(2.0, 14.0, default=6.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_33_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_34_ma_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=False, load=True)\n    buy_34_dip = DecimalParameter(0.001, 0.02, default=0.005, space='buy', decimals=3, optimize=False, load=True)\n    buy_34_ewo = DecimalParameter(-24.0, -5.0, default=-6.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_34_cti = DecimalParameter(-0.99, -0.4, default=-0.88, space='buy', decimals=2, optimize=False, load=True)\n    buy_34_volume = DecimalParameter(0.6, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_bull_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_2 = DecimalParameter(30.0, 50.0, default=36.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_3 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_4 = DecimalParameter(35.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_5 = DecimalParameter(35.0, 50.0, default=49.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_6 = DecimalParameter(38.0, 55.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_8 = DecimalParameter(40.0, 50.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_9 = DecimalParameter(40.0, 60.0, default=46.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bull_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bull_11 = DecimalParameter(28.0, 40.0, default=30.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_profit_bear_0 = DecimalParameter(0.01, 0.1, default=0.012, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_bear_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_3 = DecimalParameter(30.0, 50.0, default=44.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_4 = DecimalParameter(35.0, 50.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_5 = DecimalParameter(35.0, 50.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_5 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_6 = DecimalParameter(38.0, 55.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_6 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_7 = DecimalParameter(70.0, 85.0, default=80.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_8 = DecimalParameter(40.0, 50.0, default=52.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_over_bear_8 = DecimalParameter(70.0, 85.0, default=82.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_bear_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_under_bear_11 = DecimalParameter(28.0, 40.0, default=30.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_1 = DecimalParameter(36.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_2 = DecimalParameter(46.0, 66.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_3 = DecimalParameter(50.0, 68.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_4 = DecimalParameter(50.0, 68.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_6 = DecimalParameter(44.0, 60.0, default=48.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_7 = DecimalParameter(46.0, 60.0, default=44.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_8 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_9 = DecimalParameter(40.0, 60.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_10 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bull_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bull_11 = DecimalParameter(24.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_under_profit_bear_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_0 = DecimalParameter(28.0, 40.0, default=38.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_1 = DecimalParameter(36.0, 60.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_3 = DecimalParameter(50.0, 68.0, default=61.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_4 = DecimalParameter(50.0, 68.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_5 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_6 = DecimalParameter(44.0, 60.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_6 = DecimalParameter(70.0, 85.0, default=78.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_7 = DecimalParameter(46.0, 60.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_7 = DecimalParameter(70.0, 85.0, default=80.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_8 = DecimalParameter(40.0, 58.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_rsi_over_bear_8 = DecimalParameter(70.0, 85.0, default=82.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_under_profit_bear_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_9 = DecimalParameter(40.0, 60.0, default=36.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_10 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_bear_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_under_bear_11 = DecimalParameter(24.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=30.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.03, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=10.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 4\n    sell_trail_profit_min_4 = DecimalParameter(0.01, 0.12, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_4 = DecimalParameter(0.01, 0.06, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = DecimalParameter(0.0, 0.01, default=0.0, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_profit_max_1 = DecimalParameter(0.0, 0.05, default=0.02, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_profit_under_profit_2 = DecimalParameter(0.0, 0.05, default=0.03, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rel_2 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_2 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.002, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.14, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    hold_trade_ids = None\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trade_ids is not None:\n            # Already loaded\n            return\n\n        # Default Values\n        self.hold_trade_ids = {}\n\n        # Update values from config file, if it exists\n        hold_trades_config_file = NostalgiaForInfinityNext_ChangeToTower_V6.get_hold_trades_config_file()\n        if not hold_trades_config_file:\n            return\n\n        with hold_trades_config_file.open('r') as f:\n            trade_ids = None\n            hold_trades_config = None\n            try:\n                hold_trades_config = json_load(f)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", hold_trades_config_file, exc)\n            else:\n                trade_ids = hold_trades_config.get(\"trade_ids\")\n\n            if not trade_ids:\n                return\n\n            open_trades = {\n                trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n            }\n\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    try:\n                        trade_id = int(trade_id)\n                    except ValueError:\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            hold_trades_config_file\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = hold_trades_config.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            hold_trades_config_file\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, hold_trades_config_file\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        self.hold_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            hold_trades_config_file\n                        )\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_profit_bull_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_11.value:\n                        return True, 'signal_profit_o_bull_11'\n                elif self.sell_custom_profit_bull_11.value > current_profit >= self.sell_custom_profit_bull_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_10.value:\n                        return True, 'signal_profit_o_bull_10'\n                elif self.sell_custom_profit_bull_10.value > current_profit >= self.sell_custom_profit_bull_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_9.value:\n                        return True, 'signal_profit_o_bull_9'\n                elif self.sell_custom_profit_bull_9.value > current_profit >= self.sell_custom_profit_bull_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_8.value:\n                        return True, 'signal_profit_o_bull_8'\n                elif self.sell_custom_profit_bull_8.value > current_profit >= self.sell_custom_profit_bull_7.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_7.value):\n                        return True, 'signal_profit_o_bull_7'\n                elif self.sell_custom_profit_bull_7.value > current_profit >= self.sell_custom_profit_bull_6.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_6.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6'\n                elif self.sell_custom_profit_bull_6.value > current_profit >= self.sell_custom_profit_bull_5.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_5.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5'\n                elif self.sell_custom_profit_bull_5.value > current_profit >= self.sell_custom_profit_bull_4.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_4.value) and (last_candle['cmf'] < 0.0) :\n                        return True, 'signal_profit_o_bull_4'\n                elif self.sell_custom_profit_bull_4.value > current_profit >= self.sell_custom_profit_bull_3.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_3.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3'\n                elif self.sell_custom_profit_bull_3.value > current_profit >= self.sell_custom_profit_bull_2.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_2.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2'\n                elif self.sell_custom_profit_bull_2.value > current_profit >= self.sell_custom_profit_bull_1.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_1.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1'\n                elif self.sell_custom_profit_bull_1.value > current_profit >= self.sell_custom_profit_bull_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_0'\n            else:\n                if current_profit >= self.sell_custom_profit_bear_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_11.value:\n                        return True, 'signal_profit_o_bear_11'\n                elif self.sell_custom_profit_bear_11.value > current_profit >= self.sell_custom_profit_bear_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_10.value:\n                        return True, 'signal_profit_o_bear_10'\n                elif self.sell_custom_profit_bear_10.value > current_profit >= self.sell_custom_profit_bear_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_9.value:\n                        return True, 'signal_profit_o_bear_9'\n                elif self.sell_custom_profit_bear_9.value > current_profit >= self.sell_custom_profit_bear_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_8.value:\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_8.value):\n                        return True, 'signal_profit_o_bear_8_2'\n                elif self.sell_custom_profit_bear_8.value > current_profit >= self.sell_custom_profit_bear_7.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_7.value):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_7.value):\n                        return True, 'signal_profit_o_bear_7_2'\n                elif self.sell_custom_profit_bear_7.value > current_profit >= self.sell_custom_profit_bear_6.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_6.value):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_6.value):\n                        return True, 'signal_profit_o_bear_6_2'\n                elif self.sell_custom_profit_bear_6.value > current_profit >= self.sell_custom_profit_bear_5.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_5.value):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_5.value):\n                        return True, 'signal_profit_o_bear_5_2'\n                elif self.sell_custom_profit_bear_5.value > current_profit >= self.sell_custom_profit_bear_4.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_4.value):\n                        return True, 'signal_profit_o_bear_4'\n                elif self.sell_custom_profit_bear_4.value > current_profit >= self.sell_custom_profit_bear_3.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_3.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3'\n                elif self.sell_custom_profit_bear_3.value > current_profit >= self.sell_custom_profit_bear_2.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_2.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2'\n                elif self.sell_custom_profit_bear_2.value > current_profit >= self.sell_custom_profit_bear_1.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_1.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1'\n                elif self.sell_custom_profit_bear_1.value > current_profit >= self.sell_custom_profit_bear_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_0'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_under_profit_bull_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_11.value:\n                        return True, 'signal_profit_u_bull_11'\n                elif self.sell_custom_under_profit_bull_11.value > current_profit >= self.sell_custom_under_profit_bull_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_10.value:\n                        return True, 'signal_profit_u_bull_10'\n                elif self.sell_custom_under_profit_bull_10.value > current_profit >= self.sell_custom_under_profit_bull_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_9.value:\n                        return True, 'signal_profit_u_bull_9'\n                elif self.sell_custom_under_profit_bull_9.value > current_profit >= self.sell_custom_under_profit_bull_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_8.value:\n                        return True, 'signal_profit_u_bull_8'\n                elif self.sell_custom_under_profit_bull_8.value > current_profit >= self.sell_custom_under_profit_bull_7.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_7.value:\n                        return True, 'signal_profit_u_bull_7'\n                elif self.sell_custom_under_profit_bull_7.value > current_profit >= self.sell_custom_under_profit_bull_6.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_6.value:\n                        return True, 'signal_profit_u_bull_6'\n                elif self.sell_custom_under_profit_bull_6.value > current_profit >= self.sell_custom_under_profit_bull_5.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_5.value:\n                        return True, 'signal_profit_u_bull_5'\n                elif self.sell_custom_under_profit_bull_5.value > current_profit >= self.sell_custom_under_profit_bull_4.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_4.value:\n                        return True, 'signal_profit_u_bull_4'\n                elif self.sell_custom_under_profit_bull_4.value > current_profit >= self.sell_custom_under_profit_bull_3.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_3.value:\n                        return True, 'signal_profit_u_bull_3'\n                elif self.sell_custom_under_profit_bull_3.value > current_profit >= self.sell_custom_under_profit_bull_2.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_2.value:\n                        return True, 'signal_profit_u_bull_2'\n                elif self.sell_custom_under_profit_bull_2.value > current_profit >= self.sell_custom_under_profit_bull_1.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_1.value:\n                        return True, 'signal_profit_u_bull_1'\n                elif self.sell_custom_under_profit_bull_1.value > current_profit >= self.sell_custom_under_profit_bull_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_0'\n            else:\n                if current_profit >= self.sell_custom_under_profit_bear_11.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_11.value:\n                        return True, 'signal_profit_u_bear_11'\n                elif self.sell_custom_under_profit_bear_11.value > current_profit >= self.sell_custom_under_profit_bear_10.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_10.value:\n                        return True, 'signal_profit_u_bear_10'\n                elif self.sell_custom_under_profit_bear_10.value > current_profit >= self.sell_custom_under_profit_bear_9.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_9.value:\n                        return True, 'signal_profit_u_bear_9'\n                elif self.sell_custom_under_profit_bear_9.value > current_profit >= self.sell_custom_under_profit_bear_8.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_8.value:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_8.value):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif self.sell_custom_under_profit_bear_8.value > current_profit >= self.sell_custom_under_profit_bear_7.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_7.value:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_7.value):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif self.sell_custom_under_profit_bear_7.value > current_profit >= self.sell_custom_under_profit_bear_6.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_6.value:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_6.value):\n                        return True, 'signal_profit_u_bear_6_2'\n                elif self.sell_custom_under_profit_bear_6.value > current_profit >= self.sell_custom_under_profit_bear_5.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_5.value:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_5.value):\n                        return True, 'signal_profit_u_bear_5_2'\n                elif self.sell_custom_under_profit_bear_5.value > current_profit >= self.sell_custom_under_profit_bear_4.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_4.value:\n                        return True, 'signal_profit_u_bear_4'\n                elif self.sell_custom_under_profit_bear_4.value > current_profit >= self.sell_custom_under_profit_bear_3.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_3.value:\n                        return True, 'signal_profit_u_bear_3'\n                elif self.sell_custom_under_profit_bear_3.value > current_profit >= self.sell_custom_under_profit_bear_2.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_2.value:\n                        return True, 'signal_profit_u_bear_2'\n                elif self.sell_custom_under_profit_bear_2.value > current_profit >= self.sell_custom_under_profit_bear_1.value:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_1.value:\n                        return True, 'signal_profit_u_bear_1'\n                elif self.sell_custom_under_profit_bear_1.value > current_profit >= self.sell_custom_under_profit_bear_0.value:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_0.value) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_1_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_5.value:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5.value > current_profit >= self.sell_custom_pump_profit_1_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_4.value:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4.value > current_profit >= self.sell_custom_pump_profit_1_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_3.value:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3.value > current_profit >= self.sell_custom_pump_profit_1_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_2.value:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2.value > current_profit >= self.sell_custom_pump_profit_1_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_1.value:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_2_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_5.value:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5.value > current_profit >= self.sell_custom_pump_profit_2_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_4.value:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4.value > current_profit >= self.sell_custom_pump_profit_2_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_3.value:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3.value > current_profit >= self.sell_custom_pump_profit_2_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_2.value:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2.value > current_profit >= self.sell_custom_pump_profit_2_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_1.value:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_3_5.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_5.value:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5.value > current_profit >= self.sell_custom_pump_profit_3_4.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_4.value:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4.value > current_profit >= self.sell_custom_pump_profit_3_3.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_3.value:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3.value > current_profit >= self.sell_custom_pump_profit_3_2.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_2.value:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2.value > current_profit >= self.sell_custom_pump_profit_3_1.value:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_1.value:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1.value > current_profit >= self.sell_custom_dec_profit_min_1.value) and (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2.value > current_profit >= self.sell_custom_dec_profit_min_2.value) and (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1.value > current_profit >= self.sell_trail_profit_min_1.value) and (self.sell_trail_rsi_min_1.value < last_candle['rsi_14'] < self.sell_trail_rsi_max_1.value) and (max_profit > (current_profit + self.sell_trail_down_1.value)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2.value > current_profit >= self.sell_trail_profit_min_2.value) and (self.sell_trail_rsi_min_2.value < last_candle['rsi_14'] < self.sell_trail_rsi_max_2.value) and (max_profit > (current_profit + self.sell_trail_down_2.value)) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3.value > current_profit >= self.sell_trail_profit_min_3.value) and (max_profit > (current_profit + self.sell_trail_down_3.value)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4.value > current_profit >= self.sell_trail_profit_min_4.value) and (max_profit > (current_profit + self.sell_trail_down_4.value)) and (last_candle['sma_200_dec_24']) and (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) and (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1.value > current_profit >= self.sell_custom_profit_under_profit_min_1.value) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit >= self.sell_custom_profit_under_profit_2.value) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2.value) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2.value):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, previous_candle_1) -> tuple:\n        if (-0.12 <= current_profit < -0.08):\n            if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                return True, 'signal_stoploss_atr_1'\n        elif (-0.16 <= current_profit < -0.12):\n            if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                return True, 'signal_stoploss_atr_2'\n        elif (-0.2 <= current_profit < -0.16):\n            if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                return True, 'signal_stoploss_atr_3'\n        elif (current_profit < -0.2):\n            if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                return True, 'signal_stoploss_atr_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1.value > current_profit >= self.sell_custom_pump_dec_profit_min_1.value) and (last_candle['sell_pump_48_1_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit >= self.sell_custom_pump_dec_profit_min_2.value) and (last_candle['sell_pump_48_2_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit >= self.sell_custom_pump_dec_profit_min_3.value) and (last_candle['sell_pump_48_3_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit >= self.sell_custom_pump_dec_profit_min_4.value) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1.value > current_profit >= self.sell_custom_pump_under_profit_min_1.value) and (last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (self.sell_custom_pump_trail_profit_max_1.value > current_profit >= self.sell_custom_pump_trail_profit_min_1.value) and (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi_14'] < self.sell_custom_pump_trail_rsi_max_1.value) and (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1.value) and (current_profit >= self.sell_custom_recover_profit_1.value):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2.value) and (self.sell_custom_recover_profit_max_2.value > current_profit >= self.sell_custom_recover_profit_min_2.value) and (last_candle['rsi_14'] < self.sell_custom_recover_rsi_2.value) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.1:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.2:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.4:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -0.8:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -1.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -1.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -1.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -1.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -2.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -2.2) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -2.3) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -2.4) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -2.8) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.4) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.2) and (last_candle['rsi_14'] > 81.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 81.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -1.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 79.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.9):\n            return True, 'signal_profit_q_2'\n\n        if (last_candle['close'] < last_candle['atr_high_thresh_q']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_q']):\n            if (current_profit > 0.0):\n                return True, 'signal_profit_q_atr'\n            elif (current_profit < -0.05):\n                return True, 'signal_stoploss_q_atr'\n\n        if (current_profit > 0.0):\n            if (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n                return True, 'signal_profit_q_pmax_bull'\n            if (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.014):\n                return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['zlema_4'] > last_candle['zlema_1']) and (previous_candle_1['zlema_4'] < previous_candle_1['zlema_1']) and (last_candle['cci'] > -100) and (last_candle['hrsi'] > 70) and (current_profit > 0):\n            return True, 'signal_profit_zlema'\n\n#        if ((max_profit - current_profit) > 0.01) and (current_profit > 0.00):\n#            return True, 'quick_trailing'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (-0.03 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 75):\n            return True, 'signal_ichi_underwater'\n        if (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_ichi_recover_0'\n        if (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_ichi_recover_1'\n        if (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_ichi_recover_2'\n        if (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_ichi_recover_3'\n        if (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_ichi_recover_4'\n        if (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_ichi_slow_trade'\n        if (0.07 < current_profit < 0.1) and (max_profit-current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_ichi_trailing'\n        if (current_profit < -0.1):\n            return True, 'signal_ichi_stoploss'\n        if (last_candle['zlema_4'] > last_candle['zlema_1']) and (previous_candle_1['zlema_4'] < previous_candle_1['zlema_1']) and (last_candle['cci'] > 100) and (last_candle['hrsi'] > 85) and (current_profit > 0):\n            return True, 'signal_ichi_zlema'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        else:\n            trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n            if not buy_signal.empty:\n                buy_signal_candle = buy_signal.iloc[-1]\n                buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if all(c in ['32', '33', '34', '35', '36', '37', '38', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, previous_candle_1)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Sell signal 1\n        if self.sell_condition_1_enable.value and (last_candle['rsi_14'] > self.sell_rsi_bb_1.value) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_1_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable.value) and (last_candle['rsi_14'] > self.sell_rsi_bb_2.value) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_2_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable.value and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4.value) and (last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4.value):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_4_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable.value and (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6.value):\n            if (current_profit > 0.0):\n                    return 'sell_signal_6_1' + ' ( ' + buy_tag + ')'\n            elif (max_loss > 0.25):\n                return 'sell_signal_6_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable.value and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7.value) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_7_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable.value and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8.value):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_8_2_2' + ' ( ' + buy_tag + ')'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # EFI - Elders Force Index\n        informative_1h['efi'] = pta.efi(informative_1h[\"close\"], informative_1h[\"volume\"], length=13)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5.value) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        #TD Sequential\n        informative_1h['exceed_high'] = False\n        informative_1h['exceed_low'] = False\n\n        # count consecutive closes “lower” than the close 4 bars prior.\n        informative_1h['seq_buy'] = informative_1h['close'] < informative_1h['close'].shift(4)\n        informative_1h['seq_buy'] = informative_1h['seq_buy'] * (informative_1h['seq_buy'].groupby(\n            (informative_1h['seq_buy'] != informative_1h['seq_buy'].shift()).cumsum()).cumcount() + 1)\n\n        # count consecutive closes “higher” than the close 4 bars prior.\n        informative_1h['seq_sell'] = informative_1h['close'] > informative_1h['close'].shift(4)\n        informative_1h['seq_sell'] = informative_1h['seq_sell'] * (informative_1h['seq_sell'].groupby(\n            (informative_1h['seq_sell'] != informative_1h['seq_sell'].shift()).cumsum()).cumcount() + 1)\n\n        for index, row in informative_1h.iterrows():\n            # check if the low of bars 6 and 7 in the count are exceeded by the low of bars 8 or 9.\n            seq_b = row['seq_buy']\n            if seq_b == 8:\n                informative_1h.loc[index, 'exceed_low'] = (row['low'] < informative_1h.loc[index - 2, 'low']) | \\\n                                    (row['low'] < informative_1h.loc[index - 1, 'low'])\n            if seq_b > 8:\n                informative_1h.loc[index, 'exceed_low'] = (row['low'] < informative_1h.loc[index - 3 - (seq_b - 9), 'low']) | \\\n                                    (row['low'] < informative_1h.loc[index - 2 - (seq_b - 9), 'low'])\n                if seq_b == 9:\n                    informative_1h.loc[index, 'exceed_low'] = row['exceed_low'] | informative_1h.loc[index-1, 'exceed_low']\n\n            # check if the high of bars 6 and 7 in the count are exceeded by the high of bars 8 or 9.\n            seq_s = row['seq_sell']\n            if seq_s == 8:\n                informative_1h.loc[index, 'exceed_high'] = (row['high'] > informative_1h.loc[index - 2, 'high']) | \\\n                                    (row['high'] > informative_1h.loc[index - 1, 'high'])\n            if seq_s > 8:\n                informative_1h.loc[index, 'exceed_high'] = (row['high'] > informative_1h.loc[index - 3 - (seq_s - 9), 'high']) | \\\n                                    (row['high'] > informative_1h.loc[index - 2 - (seq_s - 9), 'high'])\n                if seq_s == 9:\n                    informative_1h.loc[index, 'exceed_high'] = row['exceed_high'] | informative_1h.loc[index-1, 'exceed_high']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        #HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        #HRSI\n        dataframe['hull'] = (2 * dataframe['hlc3'] - ta.WMA(dataframe['hlc3'], 2))\n        dataframe['hrsi'] = ta.RSI(dataframe['hull'], 2)\n\n        dataframe['hull_sell'] = (2 * dataframe['low'] - ta.WMA(dataframe['low'], 2))\n        dataframe['hrsi_sell'] = ta.RSI(dataframe['hull_sell'], 2)\n\n        #Kalman Filter HLC3\n        dataframe['hlc3KF'] = KalmanFilter(dataframe, source='hlc3')\n\n        #Kalman Filter LOW\n        dataframe['lowKF'] = KalmanFilter(dataframe, source='low')\n\n        #ZLEMA BUY\n        dataframe['zlema_1'] = dataframe['hlc3KF']\n        dataframe['zlema_1_std'] =  dataframe['hlc3']\n        dataframe['ema_data'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(2))\n        dataframe['ema_data_2'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(1))\n        dataframe['zlema_4'] = ta.EMA(dataframe['ema_data'], timeperiod = 4)\n        dataframe['zlema_2'] = ta.EMA(dataframe['ema_data_2'], timeperiod = 2)\n        dataframe['zlema_4_std'] = pta.zlma(dataframe['hlc3'], length = 4)\n\n        #ZLEMA SELL\n        dataframe['zlema_1_sell'] =  dataframe['lowKF']\n        dataframe['zlema_1_std_sell'] =  dataframe['low']\n        dataframe['ema_data_sell'] = dataframe['lowKF']  + (dataframe['lowKF']  - dataframe['lowKF'].shift(2))\n        dataframe['zlema_4_sell'] = ta.EMA(dataframe['ema_data_sell'], timeperiod = 4)\n        dataframe['zlema_4_std_sell'] = pta.zlma(dataframe['low'], length = 4)\n\n        #CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 5.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 5.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n        dataframe['atr_high_thresh_q'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1.value, self.buy_dip_threshold_120_2.value, self.buy_dip_threshold_120_3.value, self.buy_dip_threshold_120_4.value)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1.value, self.buy_dip_threshold_130_2.value, self.buy_dip_threshold_130_3.value, self.buy_dip_threshold_130_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params['buy_condition_' + str(index) + '_enable']:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type']}\"])\n                if global_buy_protection_params[\"safe_pump\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period']}_{global_buy_protection_params['safe_pump_type']}_1h\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if not self.config['runmode'] in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_1.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_1.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_1.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_1.value)\n\n                # Condition #2\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14_1h'] - self.buy_rsi_1h_diff_2.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2.value))\n\n                # Condition #3\n                elif index == 3:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_3.value)\n\n                # Condition #4\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_4.value)\n\n                # Condition #5\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_5.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5.value))\n\n                # Condition #6\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n\n                # Condition #7\n                elif index == 7:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_7.value)\n\n                # Condition #8\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_8.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8.value))\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_8.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8.value))\n\n                # Condition #9\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_9.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_9.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n\n                # Condition #10\n                elif index == 10:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_10.value)\n\n                # Condition #11\n                elif index == 11:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_11.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_11.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_11.value)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n\n                # Condition #12\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_12.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_12.value)\n\n                # Condition #13\n                elif index == 13:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_13.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n\n                # Condition #14\n                elif index == 14:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_14.value)\n\n                # Condition #15\n                elif index == 15:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_15.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n\n                # Condition #16\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_16.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_16.value)\n\n                # Condition #17\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_17.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17.value))\n\n                # Condition #18\n                elif index == 18:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n                    item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_18.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_18.value)\n\n                # Condition #19\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_19.value)\n                    item_buy_logic.append(dataframe['chop'] < self.buy_chop_max_19.value)\n                    item_buy_logic.append(dataframe['moderi_32'] == True)\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['moderi_96'] == True)\n\n                # Condition #20\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_20.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_20.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_20.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20.value))\n\n                # Condition #21\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_21.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_21.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_21.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21.value))\n\n                # Condition #22\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_22.value)\n\n                # Condition #23\n                elif index == 23:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_23.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_23.value)\n\n                # Condition #24\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_24_rsi_max.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_24_rsi_1h_min.value)\n\n                # Condition #25\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4.value)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n                    item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset.value))\n                    item_buy_logic.append(\n                        (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                        (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                    )\n                    item_buy_logic.append(dataframe['cti'] < self.buy_25_cti.value)\n\n                # Condition #26\n                elif index == 26:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset.value))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_26_cti.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume.value))\n\n                # Condition #27\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max.value)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max.value)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < self.buy_27_rsi_max.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_27_cti.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume.value))\n\n                # Condition #28\n                elif index == 28:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_28_rsi.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_28_cti.value)\n\n                # Condition #29\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_29_cti.value)\n\n                # Condition #30\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_30_rsi.value)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_30_cti.value)\n\n                # Condition #31\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset.value )\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo.value)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr.value)\n\n                # Condition #32 - Quick mode buy\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_32'])\n                    item_buy_logic.append(dataframe['moderi_64'])\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_32_cti.value)\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi.value)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset.value))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n\n                # Condition #33 - Quick mode buy\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_33_cti.value)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset.value))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo.value)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_33_rsi.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume.value))\n\n                # Condition #34 - Quick mode buy\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['cti'] < self.buy_34_cti.value)\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip.value)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset.value)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo.value)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume.value))\n\n                # Condition #35 - PMAX0 buy\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.984)\n                    item_buy_logic.append(dataframe['ewo'] > 9.6)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n\n                # Condition #36 - PMAX1 buy\n                elif index == 36:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -8.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n\n                # Condition #37 - PMAX2 buy\n                elif index == 37:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] > 9.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 56.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.7)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #38 - PMAX3 buy\n                elif index == 38:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.7)\n                    item_buy_logic.append(dataframe['ewo'] < -2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.86)\n\n                # Condition #39 - Ichimoku\n                elif index == 39:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['cloud_top_1h'])\n                    item_buy_logic.append(dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h'])\n                    item_buy_logic.append(dataframe['chikou_span_1h'] > dataframe['senkou_a_1h'])\n                    item_buy_logic.append(dataframe['efi_1h'] > 0)\n                    item_buy_logic.append(dataframe['ssl_up_1h'] > dataframe['ssl_down_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['ssl_up_1h'])\n                    item_buy_logic.append(dataframe['cti'] < -0.73)\n                    # Start of trend\n                    item_buy_logic.append(\n                        (dataframe['leading_senkou_span_a_1h'].shift(12) < dataframe['leading_senkou_span_b_1h'].shift(12)) |\n                        (dataframe['efi_1h'] < 0) |\n                        (dataframe['ssl_up_1h'].shift(12) < dataframe['ssl_down_1h'].shift(12))\n                    )\n\n                # Condition #40 - ZLEMA X buy\n                elif index == 40:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['zlema_2'], dataframe['zlema_4']))\n                    item_buy_logic.append(dataframe['hrsi'] < 30)\n                    item_buy_logic.append(dataframe['cci'] < -200)\n                    item_buy_logic.append(dataframe['rsi_14'] < 30)\n                    item_buy_logic.append(dataframe['exceed_low_1h'])\n                    item_buy_logic.append(dataframe['seq_buy_1h'] > 8)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += str(index) + ' '\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            if not self.hold_trade_ids:\n                # We have no pairs we want to hold until profit, sell\n                return True\n\n            if trade.id not in self.hold_trade_ids:\n                # This pair is not on the list to hold until profit, sell\n                return True\n\n            trade_profit_ratio = self.hold_trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return True\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return True\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return False\n        else:\n            return True\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\n#Kalman Filter\ndef KalmanFilter(dtloc, source = 'close'):\n\n    dtKF = dtloc.copy().fillna(0)\n    dtKF['TRANGE'] = ta.TRANGE(dtloc).fillna(0)\n\n\n    def calc_dtKF(dfr, init=0):\n        global calc_dtKF_value_1\n        global calc_dtKF_value_2\n        global calc_dtKF_value_3\n        global calc_dtKF_source\n        if init == 1:\n            calc_dtKF_value_1 = 0.0\n            calc_dtKF_value_2 = 0.0\n            calc_dtKF_value_3 = 0.0\n            calc_dtKF_source = 0.0\n            return\n        calc_dtKF_value_1 = 0.2 * (dfr[source] - calc_dtKF_source) + 0.8 * calc_dtKF_value_1\n        calc_dtKF_value_2 = 0.1 * dfr['TRANGE'] + 0.8 * calc_dtKF_value_2\n        if calc_dtKF_value_2 != 0:\n            vlambda = abs(calc_dtKF_value_1/calc_dtKF_value_2)\n        else:\n            vlambda = 0\n        valpha =  (-1*math.pow(vlambda,2) + math.sqrt(math.pow(vlambda,4) + 16 * math.pow(vlambda,2)))/8\n        calc_dtKF_value_3 = valpha * dfr[source] + (1 - valpha) * calc_dtKF_value_3\n        calc_dtKF_source = dfr[source]\n\n        return calc_dtKF_value_3\n    calc_dtKF(None, init=1)\n    dtKF['KF'] = dtKF.apply(calc_dtKF, axis = 1)\n    return dtKF['KF']\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityNext_maximizer/NostalgiaForInfinityNext_maximizer.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load, file_dump_json\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.strategy import DecimalParameter, IntParameter, CategoricalParameter\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\nimport pandas_ta as pta\nimport os\nimport json\nfrom typing import Dict\n\nlog = logging.getLogger(__name__)\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityNext_maximizer(IStrategy):\n    INTERFACE_VERSION = 2\n\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n    # Initialize custom_info\n    custom_info = {}\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    profit_target_params = {\n        #############\n        # Enable/Disable conditions\n        \"profit_target_1_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"80\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"70\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        3: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        4: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        5: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"30\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        9: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"40\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        18: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        19: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"90\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        24: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        30: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"15\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        40: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"25\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        41: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        42: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        43: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True\n        }\n    }\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = 0.015\n    buy_dip_threshold_10_2 = 0.1\n    buy_dip_threshold_10_3 = 0.24\n    buy_dip_threshold_10_4 = 0.42\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = 0.016\n    buy_dip_threshold_20_2 = 0.11\n    buy_dip_threshold_20_3 = 0.26\n    buy_dip_threshold_20_4 = 0.44\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = 0.018\n    buy_dip_threshold_30_2 = 0.12\n    buy_dip_threshold_30_3 = 0.28\n    buy_dip_threshold_30_4 = 0.46\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = 0.019\n    buy_dip_threshold_40_2 = 0.13\n    buy_dip_threshold_40_3 = 0.3\n    buy_dip_threshold_40_4 = 0.48\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = 0.02\n    buy_dip_threshold_50_2 = 0.14\n    buy_dip_threshold_50_3 = 0.32\n    buy_dip_threshold_50_4 = 0.5\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = 0.022\n    buy_dip_threshold_60_2 = 0.18\n    buy_dip_threshold_60_3 = 0.34\n    buy_dip_threshold_60_4 = 0.56\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = 0.023\n    buy_dip_threshold_70_2 = 0.2\n    buy_dip_threshold_70_3 = 0.36\n    buy_dip_threshold_70_4 = 0.6\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = 0.024\n    buy_dip_threshold_80_2 = 0.22\n    buy_dip_threshold_80_3 = 0.38\n    buy_dip_threshold_80_4 = 0.66\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = 0.025\n    buy_dip_threshold_90_2 = 0.23\n    buy_dip_threshold_90_3 = 0.4\n    buy_dip_threshold_90_4 = 0.7\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = 0.026\n    buy_dip_threshold_100_2 = 0.24\n    buy_dip_threshold_100_3 = 0.42\n    buy_dip_threshold_100_4 = 0.8\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = 0.027\n    buy_dip_threshold_110_2 = 0.26\n    buy_dip_threshold_110_3 = 0.44\n    buy_dip_threshold_110_4 = 0.84\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = 0.028\n    buy_dip_threshold_120_2 = 0.28\n    buy_dip_threshold_120_3 = 0.46\n    buy_dip_threshold_120_4 = 0.86\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = 0.028\n    buy_dip_threshold_130_2 = 0.3\n    buy_dip_threshold_130_3 = 0.48\n    buy_dip_threshold_130_4 = 0.9\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = 2.2\n    buy_pump_threshold_10_24 = 0.42\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = 2.0\n    buy_pump_threshold_10_36 = 0.58\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = 2.0\n    buy_pump_threshold_10_48 = 0.8\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = 2.2\n    buy_pump_threshold_20_24 = 0.46\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = 2.0\n    buy_pump_threshold_20_36 = 0.6\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = 2.0\n    buy_pump_threshold_20_48 = 0.81\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = 2.2\n    buy_pump_threshold_30_24 = 0.5\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = 2.0\n    buy_pump_threshold_30_36 = 0.62\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = 2.0\n    buy_pump_threshold_30_48 = 0.82\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = 2.2\n    buy_pump_threshold_40_24 = 0.54\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = 2.0\n    buy_pump_threshold_40_36 = 0.63\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = 2.0\n    buy_pump_threshold_40_48 = 0.84\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = 1.75\n    buy_pump_threshold_50_24 = 0.6\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = 1.75\n    buy_pump_threshold_50_36 = 0.64\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = 1.75\n    buy_pump_threshold_50_48 = 0.85\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = 1.75\n    buy_pump_threshold_60_24 = 0.62\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = 1.75\n    buy_pump_threshold_60_36 = 0.66\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = 1.75\n    buy_pump_threshold_60_48 = 0.9\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = 1.75\n    buy_pump_threshold_70_24 = 0.63\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = 1.75\n    buy_pump_threshold_70_36 = 0.67\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = 1.75\n    buy_pump_threshold_70_48 = 0.95\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = 1.75\n    buy_pump_threshold_80_24 = 0.64\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = 1.75\n    buy_pump_threshold_80_36 = 0.68\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = 1.75\n    buy_pump_threshold_80_48 = 1.0\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = 1.75\n    buy_pump_threshold_90_24 = 0.65\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = 1.75\n    buy_pump_threshold_90_36 = 0.69\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = 1.75\n    buy_pump_threshold_90_48 = 1.1\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = 1.7\n    buy_pump_threshold_100_24 = 0.66\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = 1.7\n    buy_pump_threshold_100_36 = 0.7\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = 1.4\n    buy_pump_threshold_100_48 = 1.6\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = 1.7\n    buy_pump_threshold_110_24 = 0.7\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = 1.7\n    buy_pump_threshold_110_36 = 0.74\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = 1.4\n    buy_pump_threshold_110_48 = 1.8\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = 1.7\n    buy_pump_threshold_120_24 = 0.78\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = 1.7\n    buy_pump_threshold_120_36 = 0.78\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = 1.4\n    buy_pump_threshold_120_48 = 2.0\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = 0.4\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = 0.44\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = 0.50\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = 0.58\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = 0.66\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = 0.74\n\n    buy_min_inc_1 = 0.022\n    buy_rsi_1h_min_1 = 20.0\n    buy_rsi_1h_max_1 = 84.0\n    buy_rsi_1 = 36.0\n    buy_mfi_1 = 50.0\n    buy_cti_1 = -0.92\n\n    buy_rsi_1h_min_2 = 32.0\n    buy_rsi_1h_max_2 = 84.0\n    buy_rsi_1h_diff_2 = 38.8\n    buy_mfi_2 = 49.0\n    buy_bb_offset_2 = 0.983\n    buy_volume_2 = 1.6\n\n    buy_bb40_bbdelta_close_3 = 0.045\n    buy_bb40_closedelta_close_3 = 0.023\n    buy_bb40_tail_bbdelta_3 = 0.418\n    buy_ema_rel_3 = 0.986\n    buy_cti_3 = -0.5\n\n    buy_bb20_close_bblowerband_4 = 0.979\n    buy_bb20_volume_4 = 10.0\n    buy_cti_4 = -0.8\n\n    buy_ema_open_mult_5 = 0.018\n    buy_bb_offset_5 = 0.996\n    buy_ema_rel_5 = 0.915\n    buy_cti_5 = -0.84\n    buy_volume_5 = 1.8\n\n    buy_ema_open_mult_6 = 0.021\n    buy_bb_offset_6 = 0.976\n\n    buy_ema_open_mult_7 = 0.030\n    buy_cti_7 = -0.89\n\n    buy_cti_8 = -0.88\n    buy_rsi_8 = 40.0\n    buy_bb_offset_8 = 0.99\n    buy_rsi_1h_8 = 64.0\n    buy_volume_8 = 1.8\n\n    buy_ma_offset_9 = 0.968\n    buy_bb_offset_9 = 0.942\n    buy_rsi_1h_min_9 = 20.0\n    buy_rsi_1h_max_9 = 88.0\n    buy_mfi_9 = 50.0\n\n    buy_ma_offset_10 = 0.98\n    buy_bb_offset_10 = 0.972\n    buy_rsi_1h_10 = 50.0\n\n    buy_ma_offset_11 = 0.946\n    buy_min_inc_11 = 0.038\n    buy_rsi_1h_min_11 = 46.0\n    buy_rsi_1h_max_11 = 84.0\n    buy_rsi_11 = 38.0\n    buy_mfi_11 = 36.0\n\n    buy_ma_offset_12 = 0.921\n    buy_rsi_12 = 28.0\n    buy_ewo_12 = 1.8\n    buy_cti_12 = -0.7\n\n    buy_ma_offset_13 = 0.99\n    buy_cti_13 = -0.82\n    buy_ewo_13 = -9.0\n\n    buy_ema_open_mult_14 = 0.014\n    buy_bb_offset_14 = 0.988\n    buy_ma_offset_14 = 0.945\n    buy_cti_14 = -0.86\n\n    buy_ema_open_mult_15 = 0.024\n    buy_ma_offset_15 = 0.958\n    buy_rsi_15 = 28.0\n    buy_ema_rel_15 = 0.974\n\n    buy_ma_offset_16 = 0.953\n    buy_rsi_16 = 31.0\n    buy_ewo_16 = 2.8\n    buy_cti_16 = -0.84\n\n    buy_ma_offset_17 = 0.99\n    buy_ewo_17 = -9.4\n    buy_cti_17 = -0.96\n    buy_volume_17 = 2.0\n\n    buy_rsi_18 = 33.0\n    buy_bb_offset_18 = 0.986\n    buy_volume_18 = 2.0\n    buy_cti_18 = -0.86\n\n    buy_rsi_1h_min_19 = 30.0\n    buy_chop_max_19 = 21.3\n\n    buy_rsi_20 = 36.0\n    buy_rsi_1h_20 = 16.0\n    buy_cti_20 = -0.84\n    buy_volume_20 = 2.0\n\n    buy_rsi_21 = 14.0\n    buy_rsi_1h_21 = 28.0\n    buy_cti_21 = -0.902\n    buy_volume_21 = 2.0\n\n    buy_volume_22 = 2.0\n    buy_bb_offset_22 = 0.984\n    buy_ma_offset_22 = 0.942\n    buy_ewo_22 = 5.8\n    buy_rsi_22 = 36.0\n\n    buy_bb_offset_23 = 0.985\n    buy_ewo_23 = 6.2\n    buy_rsi_23 = 32.4\n    buy_rsi_1h_23 = 70.0\n\n    buy_24_rsi_max = 50.0\n    buy_24_rsi_1h_min = 66.9\n\n    buy_25_ma_offset = 0.922\n    buy_25_rsi_4 = 38.0\n    buy_25_cti = -0.76\n\n    buy_26_zema_low_offset = 0.9\n    buy_26_cti = -0.9\n    buy_26_r = -80.0\n    buy_26_r_1h = -80.0\n    buy_26_volume = 2.0\n\n    buy_27_wr_max = 90.0\n    buy_27_wr_1h_max = 90.0\n    buy_27_rsi_max = 50\n    buy_27_cti = -0.93\n    buy_27_volume = 2.0\n\n    buy_28_ma_offset = 0.97\n    buy_28_ewo = 7.2\n    buy_28_rsi = 32.5\n    buy_28_cti = -0.9\n\n    buy_29_ma_offset = 0.94\n    buy_29_ewo = -4.0\n    buy_29_cti = -0.95\n\n    buy_30_ma_offset = 0.97\n    buy_30_ewo = 7.4\n    buy_30_rsi = 40.0\n    buy_30_cti = -0.88\n\n    buy_31_ma_offset = 0.94\n    buy_31_ewo = -19.0\n    buy_31_wr = -98.4\n\n    buy_32_ma_offset = 0.934\n    buy_32_dip = 0.005\n    buy_32_rsi = 46.0\n    buy_32_cti = -0.8\n\n    buy_33_ma_offset = 0.988\n    buy_33_rsi = 32.0\n    buy_33_cti = -0.88\n    buy_33_ewo = 6.4\n    buy_33_volume = 2.0\n\n    buy_34_ma_offset = 0.93\n    buy_34_dip = 0.005\n    buy_34_ewo = -6.0\n    buy_34_cti = -0.88\n    buy_34_volume = 2.0\n\n    buy_35_ma_offset = 0.984\n    buy_35_ewo = 9.6\n    buy_35_rsi = 32.0\n    buy_35_cti = -0.5\n\n    buy_36_ma_offset = 0.98\n    buy_36_ewo = -8.8\n    buy_36_cti = -0.8\n\n    buy_37_ma_offset = 0.98\n    buy_37_ewo = 9.8\n    buy_37_rsi = 56.0\n    buy_37_cti = -0.7\n\n    buy_38_ma_offset = 0.98\n    buy_38_ewo = -5.2\n    buy_38_cti = -0.96\n\n    buy_39_cti = -0.77\n    buy_39_r = -60.0\n    buy_39_r_1h = -38.0\n\n    buy_40_hrsi = 30.0\n    buy_40_cci = -240.0\n    buy_40_rsi = 30.0\n    buy_40_cti = -0.8\n    buy_40_r = -90.0\n    buy_40_r_1h = -90.0\n\n    buy_41_cti_1h = -0.84\n    buy_41_r_1h = -42.0\n    buy_41_ma_offset = 0.96\n    buy_41_cti = -0.8\n    buy_41_r = -75.0\n\n    buy_42_cti_1h = 0.5\n    buy_42_r_1h = -46.0\n    buy_42_ema_open_mult = 0.018\n    buy_42_bb_offset = 0.992\n\n    buy_43_cti_1h = 0.5\n    buy_43_r_1h = -80.0\n    buy_43_bb40_bbdelta_close = 0.046\n    buy_43_bb40_closedelta_close = 0.02\n    buy_43_bb40_tail_bbdelta = 0.5\n    buy_43_cti = -0.6\n    buy_43_r = -90.0\n\n    # Sell\n\n    sell_condition_1_enable = True\n    sell_condition_2_enable = True\n    sell_condition_3_enable = True\n    sell_condition_4_enable = True\n    sell_condition_5_enable = True\n    sell_condition_6_enable = True\n    sell_condition_7_enable = True\n    sell_condition_8_enable = True\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = 0.9\n    sell_pump_threshold_48_2 = 0.7\n    sell_pump_threshold_48_3 = 0.5\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = 0.72\n    sell_pump_threshold_36_2 = 4.0\n    sell_pump_threshold_36_3 = 1.0\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = 0.68\n    sell_pump_threshold_24_2 = 0.62\n    sell_pump_threshold_24_3 = 0.88\n\n    sell_rsi_bb_1 = 79.5\n\n    sell_rsi_bb_2 = 81\n\n    sell_rsi_main_3 = 82\n\n    sell_dual_rsi_rsi_4 = 73.4\n    sell_dual_rsi_rsi_1h_4 = 79.6\n\n    sell_ema_relative_5 = 0.024\n    sell_rsi_diff_5 = 4.4\n\n    sell_rsi_under_6 = 79.0\n\n    sell_rsi_1h_7 = 81.7\n\n    sell_bb_relative_8 = 1.1\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = 0.012\n    sell_custom_rsi_under_bull_0 = 34.0\n    sell_custom_profit_bull_1 = 0.02\n    sell_custom_rsi_under_bull_1 = 35.0\n    sell_custom_profit_bull_2 = 0.03\n    sell_custom_rsi_under_bull_2 = 36.0\n    sell_custom_profit_bull_3 = 0.04\n    sell_custom_rsi_under_bull_3 = 37.0\n    sell_custom_profit_bull_4 = 0.05\n    sell_custom_rsi_under_bull_4 = 42.0\n    sell_custom_profit_bull_5 = 0.06\n    sell_custom_rsi_under_bull_5 = 45.0\n    sell_custom_profit_bull_6 = 0.07\n    sell_custom_rsi_under_bull_6 = 48.0\n    sell_custom_profit_bull_7 = 0.08\n    sell_custom_rsi_under_bull_7 = 54.0\n    sell_custom_profit_bull_8 = 0.09\n    sell_custom_rsi_under_bull_8 = 50.0\n    sell_custom_profit_bull_9 = 0.1\n    sell_custom_rsi_under_bull_9 = 46.0\n    sell_custom_profit_bull_10 = 0.12\n    sell_custom_rsi_under_bull_10 = 42.0\n    sell_custom_profit_bull_11 = 0.20\n    sell_custom_rsi_under_bull_11 = 30.0\n\n    sell_custom_profit_bear_0 = 0.012\n    sell_custom_rsi_under_bear_0 = 34.0\n    sell_custom_profit_bear_1 = 0.02\n    sell_custom_rsi_under_bear_1 = 35.0\n    sell_custom_profit_bear_2 = 0.03\n    sell_custom_rsi_under_bear_2 = 37.0\n    sell_custom_profit_bear_3 = 0.04\n    sell_custom_rsi_under_bear_3 = 44.0\n    sell_custom_profit_bear_4 = 0.05\n    sell_custom_rsi_under_bear_4 = 48.0\n    sell_custom_profit_bear_5 = 0.06\n    sell_custom_rsi_under_bear_5 = 50.0\n    sell_custom_rsi_over_bear_5 = 78.0\n    sell_custom_profit_bear_6 = 0.07\n    sell_custom_rsi_under_bear_6 = 52.0\n    sell_custom_rsi_over_bear_6 = 78.0\n    sell_custom_profit_bear_7 = 0.08\n    sell_custom_rsi_under_bear_7 = 54.0\n    sell_custom_rsi_over_bear_7 = 80.0\n    sell_custom_profit_bear_8 = 0.09\n    sell_custom_rsi_under_bear_8 = 52.0\n    sell_custom_rsi_over_bear_8 = 82.0\n    sell_custom_profit_bear_9 = 0.1\n    sell_custom_rsi_under_bear_9 = 46.0\n    sell_custom_profit_bear_10 = 0.12\n    sell_custom_rsi_under_bear_10 = 42.0\n    sell_custom_profit_bear_11 = 0.20\n    sell_custom_rsi_under_bear_11 = 30.0\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = 0.01\n    sell_custom_under_rsi_under_bull_0 = 38.0\n    sell_custom_under_profit_bull_1 = 0.02\n    sell_custom_under_rsi_under_bull_1 = 46.0\n    sell_custom_under_profit_bull_2 = 0.03\n    sell_custom_under_rsi_under_bull_2 = 47.0\n    sell_custom_under_profit_bull_3 = 0.04\n    sell_custom_under_rsi_under_bull_3 = 48.0\n    sell_custom_under_profit_bull_4 = 0.05\n    sell_custom_under_rsi_under_bull_4 = 49.0\n    sell_custom_under_profit_bull_5 = 0.06\n    sell_custom_under_rsi_under_bull_5 = 50.0\n    sell_custom_under_profit_bull_6 = 0.07\n    sell_custom_under_rsi_under_bull_6 = 52.0\n    sell_custom_under_profit_bull_7 = 0.08\n    sell_custom_under_rsi_under_bull_7 = 54.0\n    sell_custom_under_profit_bull_8 = 0.09\n    sell_custom_under_rsi_under_bull_8 = 50.0\n    sell_custom_under_profit_bull_9 = 0.1\n    sell_custom_under_rsi_under_bull_9 = 46.0\n    sell_custom_under_profit_bull_10 = 0.12\n    sell_custom_under_rsi_under_bull_10 = 42.0\n    sell_custom_under_profit_bull_11 = 0.2\n    sell_custom_under_rsi_under_bull_11 = 30.0\n\n    sell_custom_under_profit_bear_0 = 0.01\n    sell_custom_under_rsi_under_bear_0 = 38.0\n    sell_custom_under_profit_bear_1 = 0.02\n    sell_custom_under_rsi_under_bear_1 = 56.0\n    sell_custom_under_profit_bear_2 = 0.03\n    sell_custom_under_rsi_under_bear_2 = 57.0\n    sell_custom_under_profit_bear_3 = 0.04\n    sell_custom_under_rsi_under_bear_3 = 58.0\n    sell_custom_under_profit_bear_4 = 0.05\n    sell_custom_under_rsi_under_bear_4 = 57.0\n    sell_custom_under_profit_bear_5 = 0.06\n    sell_custom_under_rsi_under_bear_5 = 56.0\n    sell_custom_under_rsi_over_bear_5 = 78.0\n    sell_custom_under_profit_bear_6 = 0.07\n    sell_custom_under_rsi_under_bear_6 = 55.0\n    sell_custom_under_rsi_over_bear_6 = 78.0\n    sell_custom_under_profit_bear_7 = 0.08\n    sell_custom_under_rsi_under_bear_7 = 54.0\n    sell_custom_under_rsi_over_bear_7 = 80.0\n    sell_custom_under_profit_bear_8 = 0.09\n    sell_custom_under_rsi_under_bear_8 = 50.0\n    sell_custom_under_rsi_over_bear_8 = 82.0\n    sell_custom_under_profit_bear_9 = 0.1\n    sell_custom_under_rsi_under_bear_9 = 46.0\n    sell_custom_under_profit_bear_10 = 0.12\n    sell_custom_under_rsi_under_bear_10 = 42.0\n    sell_custom_under_profit_bear_11 = 0.2\n    sell_custom_under_rsi_under_bear_11 = 30.0\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = 0.01\n    sell_custom_pump_rsi_1_1 = 34.0\n    sell_custom_pump_profit_1_2 = 0.02\n    sell_custom_pump_rsi_1_2 = 40.0\n    sell_custom_pump_profit_1_3 = 0.04\n    sell_custom_pump_rsi_1_3 = 42.0\n    sell_custom_pump_profit_1_4 = 0.1\n    sell_custom_pump_rsi_1_4 = 34.0\n    sell_custom_pump_profit_1_5 = 0.2\n    sell_custom_pump_rsi_1_5 = 30.0\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = 0.01\n    sell_custom_pump_rsi_2_1 = 34.0\n    sell_custom_pump_profit_2_2 = 0.02\n    sell_custom_pump_rsi_2_2 = 40.0\n    sell_custom_pump_profit_2_3 = 0.04\n    sell_custom_pump_rsi_2_3 = 42.0\n    sell_custom_pump_profit_2_4 = 0.1\n    sell_custom_pump_rsi_2_4 = 34.0\n    sell_custom_pump_profit_2_5 = 0.2\n    sell_custom_pump_rsi_2_5 = 30.0\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = 0.01\n    sell_custom_pump_rsi_3_1 = 34.0\n    sell_custom_pump_profit_3_2 = 0.02\n    sell_custom_pump_rsi_3_2 = 40.0\n    sell_custom_pump_profit_3_3 = 0.04\n    sell_custom_pump_rsi_3_3 = 42.0\n    sell_custom_pump_profit_3_4 = 0.1\n    sell_custom_pump_rsi_3_4 = 34.0\n    sell_custom_pump_profit_3_5 = 0.2\n    sell_custom_pump_rsi_3_5 = 30.0\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = 0.05\n    sell_custom_dec_profit_max_1 = 0.12\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = 0.07\n    sell_custom_dec_profit_max_2 = 0.16\n\n    # Trail 1\n    sell_trail_profit_min_1 = 0.03\n    sell_trail_profit_max_1 = 0.05\n    sell_trail_down_1 = 0.05\n    sell_trail_rsi_min_1 = 10.0\n    sell_trail_rsi_max_1 = 20.0\n\n    # Trail 2\n    sell_trail_profit_min_2 = 0.1\n    sell_trail_profit_max_2 = 0.4\n    sell_trail_down_2 = 0.03\n    sell_trail_rsi_min_2 = 20.0\n    sell_trail_rsi_max_2 = 50.0\n\n    # Trail 3\n    sell_trail_profit_min_3 = 0.06\n    sell_trail_profit_max_3 = 0.2\n    sell_trail_down_3 = 0.05\n\n    # Trail 4\n    sell_trail_profit_min_4 = 0.03\n    sell_trail_profit_max_4 = 0.06\n    sell_trail_down_4 = 0.02\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = 0.001\n    sell_custom_profit_under_profit_max_1 = 0.01\n    sell_custom_profit_under_rel_1 = 0.024\n    sell_custom_profit_under_rsi_diff_1 = 4.4\n\n    sell_custom_profit_under_profit_2 = 0.03\n    sell_custom_profit_under_rel_2 = 0.024\n    sell_custom_profit_under_rsi_diff_2 = 4.4\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = 0.002\n    sell_custom_stoploss_under_rsi_diff_1 = 10.0\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = -0.08\n    sell_custom_stoploss_long_profit_max_1 = -0.04\n    sell_custom_stoploss_long_recover_1 = 0.14\n    sell_custom_stoploss_long_rsi_diff_1 = 4.0\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = 0.06\n    sell_custom_stoploss_long_rsi_diff_2 = 40.0\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = 0.005\n    sell_custom_pump_dec_profit_max_1 = 0.05\n    sell_custom_pump_dec_profit_min_2 = 0.04\n    sell_custom_pump_dec_profit_max_2 = 0.06\n    sell_custom_pump_dec_profit_min_3 = 0.06\n    sell_custom_pump_dec_profit_max_3 = 0.09\n    sell_custom_pump_dec_profit_min_4 = 0.02\n    sell_custom_pump_dec_profit_max_4 = 0.04\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = 0.04\n    sell_custom_pump_under_profit_max_1 = 0.09\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = 0.05\n    sell_custom_pump_trail_profit_max_1 = 0.07\n    sell_custom_pump_trail_down_1 = 0.05\n    sell_custom_pump_trail_rsi_min_1 = 20.0\n    sell_custom_pump_trail_rsi_max_1 = 70.0\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = 0.01\n    sell_custom_stoploss_pump_min_1 = -0.02\n    sell_custom_stoploss_pump_max_1 = -0.01\n    sell_custom_stoploss_pump_ma_offset_1 = 0.94\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = 0.025\n    sell_custom_stoploss_pump_loss_2 = -0.05\n    sell_custom_stoploss_pump_ma_offset_2 = 0.92\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = 0.008\n    sell_custom_stoploss_pump_loss_3 = -0.12\n    sell_custom_stoploss_pump_ma_offset_3 = 0.88\n\n    # Recover\n    sell_custom_recover_profit_1 = 0.06\n    sell_custom_recover_min_loss_1 = 0.12\n\n    sell_custom_recover_profit_min_2 = 0.01\n    sell_custom_recover_profit_max_2 = 0.05\n    sell_custom_recover_min_loss_2 = 0.06\n    sell_custom_recover_rsi_2 = 46.0\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = 0.03\n    sell_custom_long_profit_max_1 = 0.04\n    sell_custom_long_duration_min_1 = 900\n\n    #############################################################\n\n    hold_trades_cache = None\n\n    # Profit Target Signal\n    profit_target_1_enable = True\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = NostalgiaForInfinityNext_maximizer.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            # Load custom_info for initial else save every loop start\n            if not self.custom_info:\n                self.custom_info = get_profit_target_by_pair()\n            else:\n                save_profit_target_by_pair(self.custom_info)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_profit_bull_11:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_11:\n                        return True, 'signal_profit_o_bull_11'\n                elif self.sell_custom_profit_bull_11 > current_profit >= self.sell_custom_profit_bull_10:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_10:\n                        return True, 'signal_profit_o_bull_10'\n                elif self.sell_custom_profit_bull_10 > current_profit >= self.sell_custom_profit_bull_9:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_9:\n                        return True, 'signal_profit_o_bull_9'\n                elif self.sell_custom_profit_bull_9 > current_profit >= self.sell_custom_profit_bull_8:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_8:\n                        return True, 'signal_profit_o_bull_8'\n                elif self.sell_custom_profit_bull_8 > current_profit >= self.sell_custom_profit_bull_7:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_7):\n                        return True, 'signal_profit_o_bull_7'\n                elif self.sell_custom_profit_bull_7 > current_profit >= self.sell_custom_profit_bull_6:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_6) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6'\n                elif self.sell_custom_profit_bull_6 > current_profit >= self.sell_custom_profit_bull_5:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5'\n                elif self.sell_custom_profit_bull_5 > current_profit >= self.sell_custom_profit_bull_4:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_4) and (last_candle['cmf'] < 0.0) :\n                        return True, 'signal_profit_o_bull_4'\n                elif self.sell_custom_profit_bull_4 > current_profit >= self.sell_custom_profit_bull_3:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_3) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3'\n                elif self.sell_custom_profit_bull_3 > current_profit >= self.sell_custom_profit_bull_2:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_2) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2'\n                elif self.sell_custom_profit_bull_2 > current_profit >= self.sell_custom_profit_bull_1:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_1) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1'\n                elif self.sell_custom_profit_bull_1 > current_profit >= self.sell_custom_profit_bull_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_0'\n            else:\n                if current_profit >= self.sell_custom_profit_bear_11:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_11:\n                        return True, 'signal_profit_o_bear_11'\n                elif self.sell_custom_profit_bear_11 > current_profit >= self.sell_custom_profit_bear_10:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_10:\n                        return True, 'signal_profit_o_bear_10'\n                elif self.sell_custom_profit_bear_10 > current_profit >= self.sell_custom_profit_bear_9:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_9:\n                        return True, 'signal_profit_o_bear_9'\n                elif self.sell_custom_profit_bear_9 > current_profit >= self.sell_custom_profit_bear_8:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_8:\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_8):\n                        return True, 'signal_profit_o_bear_8_2'\n                elif self.sell_custom_profit_bear_8 > current_profit >= self.sell_custom_profit_bear_7:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_7):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_7):\n                        return True, 'signal_profit_o_bear_7_2'\n                elif self.sell_custom_profit_bear_7 > current_profit >= self.sell_custom_profit_bear_6:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_6):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_6):\n                        return True, 'signal_profit_o_bear_6_2'\n                elif self.sell_custom_profit_bear_6 > current_profit >= self.sell_custom_profit_bear_5:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_5):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_5):\n                        return True, 'signal_profit_o_bear_5_2'\n                elif self.sell_custom_profit_bear_5 > current_profit >= self.sell_custom_profit_bear_4:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_4):\n                        return True, 'signal_profit_o_bear_4'\n                elif self.sell_custom_profit_bear_4 > current_profit >= self.sell_custom_profit_bear_3:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_3) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3'\n                elif self.sell_custom_profit_bear_3 > current_profit >= self.sell_custom_profit_bear_2:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_2) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2'\n                elif self.sell_custom_profit_bear_2 > current_profit >= self.sell_custom_profit_bear_1:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_1) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1'\n                elif self.sell_custom_profit_bear_1 > current_profit >= self.sell_custom_profit_bear_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_0'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_under_profit_bull_11:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_11:\n                        return True, 'signal_profit_u_bull_11'\n                elif self.sell_custom_under_profit_bull_11 > current_profit >= self.sell_custom_under_profit_bull_10:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_10:\n                        return True, 'signal_profit_u_bull_10'\n                elif self.sell_custom_under_profit_bull_10 > current_profit >= self.sell_custom_under_profit_bull_9:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_9:\n                        return True, 'signal_profit_u_bull_9'\n                elif self.sell_custom_under_profit_bull_9 > current_profit >= self.sell_custom_under_profit_bull_8:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_8:\n                        return True, 'signal_profit_u_bull_8'\n                elif self.sell_custom_under_profit_bull_8 > current_profit >= self.sell_custom_under_profit_bull_7:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_7:\n                        return True, 'signal_profit_u_bull_7'\n                elif self.sell_custom_under_profit_bull_7 > current_profit >= self.sell_custom_under_profit_bull_6:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_6:\n                        return True, 'signal_profit_u_bull_6'\n                elif self.sell_custom_under_profit_bull_6 > current_profit >= self.sell_custom_under_profit_bull_5:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_5:\n                        return True, 'signal_profit_u_bull_5'\n                elif self.sell_custom_under_profit_bull_5 > current_profit >= self.sell_custom_under_profit_bull_4:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_4:\n                        return True, 'signal_profit_u_bull_4'\n                elif self.sell_custom_under_profit_bull_4 > current_profit >= self.sell_custom_under_profit_bull_3:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_3:\n                        return True, 'signal_profit_u_bull_3'\n                elif self.sell_custom_under_profit_bull_3 > current_profit >= self.sell_custom_under_profit_bull_2:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_2:\n                        return True, 'signal_profit_u_bull_2'\n                elif self.sell_custom_under_profit_bull_2 > current_profit >= self.sell_custom_under_profit_bull_1:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_1:\n                        return True, 'signal_profit_u_bull_1'\n                elif self.sell_custom_under_profit_bull_1 > current_profit >= self.sell_custom_under_profit_bull_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_0'\n            else:\n                if current_profit >= self.sell_custom_under_profit_bear_11:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_11:\n                        return True, 'signal_profit_u_bear_11'\n                elif self.sell_custom_under_profit_bear_11 > current_profit >= self.sell_custom_under_profit_bear_10:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_10:\n                        return True, 'signal_profit_u_bear_10'\n                elif self.sell_custom_under_profit_bear_10 > current_profit >= self.sell_custom_under_profit_bear_9:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_9:\n                        return True, 'signal_profit_u_bear_9'\n                elif self.sell_custom_under_profit_bear_9 > current_profit >= self.sell_custom_under_profit_bear_8:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_8:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_8):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif self.sell_custom_under_profit_bear_8 > current_profit >= self.sell_custom_under_profit_bear_7:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_7:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_7):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif self.sell_custom_under_profit_bear_7 > current_profit >= self.sell_custom_under_profit_bear_6:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_6:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_6):\n                        return True, 'signal_profit_u_bear_6_2'\n                elif self.sell_custom_under_profit_bear_6 > current_profit >= self.sell_custom_under_profit_bear_5:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_5:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_5):\n                        return True, 'signal_profit_u_bear_5_2'\n                elif self.sell_custom_under_profit_bear_5 > current_profit >= self.sell_custom_under_profit_bear_4:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_4:\n                        return True, 'signal_profit_u_bear_4'\n                elif self.sell_custom_under_profit_bear_4 > current_profit >= self.sell_custom_under_profit_bear_3:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_3:\n                        return True, 'signal_profit_u_bear_3'\n                elif self.sell_custom_under_profit_bear_3 > current_profit >= self.sell_custom_under_profit_bear_2:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_2:\n                        return True, 'signal_profit_u_bear_2'\n                elif self.sell_custom_under_profit_bear_2 > current_profit >= self.sell_custom_under_profit_bear_1:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_1:\n                        return True, 'signal_profit_u_bear_1'\n                elif self.sell_custom_under_profit_bear_1 > current_profit >= self.sell_custom_under_profit_bear_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_1_5:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_5:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5 > current_profit >= self.sell_custom_pump_profit_1_4:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_4:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4 > current_profit >= self.sell_custom_pump_profit_1_3:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_3:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3 > current_profit >= self.sell_custom_pump_profit_1_2:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_2:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2 > current_profit >= self.sell_custom_pump_profit_1_1:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_1:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_2_5:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_5:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5 > current_profit >= self.sell_custom_pump_profit_2_4:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_4:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4 > current_profit >= self.sell_custom_pump_profit_2_3:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_3:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3 > current_profit >= self.sell_custom_pump_profit_2_2:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_2:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2 > current_profit >= self.sell_custom_pump_profit_2_1:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_1:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_3_5:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_5:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5 > current_profit >= self.sell_custom_pump_profit_3_4:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_4:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4 > current_profit >= self.sell_custom_pump_profit_3_3:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_3:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3 > current_profit >= self.sell_custom_pump_profit_3_2:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_2:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2 > current_profit >= self.sell_custom_pump_profit_3_1:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_1:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1 > current_profit >= self.sell_custom_dec_profit_min_1) and (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2 > current_profit >= self.sell_custom_dec_profit_min_2) and (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1 > current_profit >= self.sell_trail_profit_min_1) and (self.sell_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_trail_rsi_max_1) and (max_profit > (current_profit + self.sell_trail_down_1)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2 > current_profit >= self.sell_trail_profit_min_2) and (self.sell_trail_rsi_min_2 < last_candle['rsi_14'] < self.sell_trail_rsi_max_2) and (max_profit > (current_profit + self.sell_trail_down_2)) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3 > current_profit >= self.sell_trail_profit_min_3) and (max_profit > (current_profit + self.sell_trail_down_3)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4 > current_profit >= self.sell_trail_profit_min_4) and (max_profit > (current_profit + self.sell_trail_down_4)) and (last_candle['sma_200_dec_24']) and (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1 < current_profit < self.sell_custom_long_profit_max_1) and (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n#        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n#            if (self.sell_custom_profit_under_profit_max_1 > current_profit >= self.sell_custom_profit_under_profit_min_1) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1):\n#                return True, 'signal_profit_u_e_1'\n#        else:\n            # Uptrend\n        if (current_profit >= self.sell_custom_profit_under_profit_2) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2):\n            return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, previous_candle_1) -> tuple:\n        if (-0.12 <= current_profit < -0.08):\n            if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                return True, 'signal_stoploss_atr_1'\n        elif (-0.16 <= current_profit < -0.12):\n            if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                return True, 'signal_stoploss_atr_2'\n        elif (-0.2 <= current_profit < -0.16):\n            if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                return True, 'signal_stoploss_atr_3'\n        elif (current_profit < -0.2):\n            if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                return True, 'signal_stoploss_atr_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1 > current_profit >= self.sell_custom_pump_dec_profit_min_1) and (last_candle['sell_pump_48_1_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2 > current_profit >= self.sell_custom_pump_dec_profit_min_2) and (last_candle['sell_pump_48_2_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3 > current_profit >= self.sell_custom_pump_dec_profit_min_3) and (last_candle['sell_pump_48_3_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4 > current_profit >= self.sell_custom_pump_dec_profit_min_4) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1 > current_profit >= self.sell_custom_pump_under_profit_min_1) and (last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (self.sell_custom_pump_trail_profit_max_1 > current_profit >= self.sell_custom_pump_trail_profit_min_1) and (self.sell_custom_pump_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_custom_pump_trail_rsi_max_1) and (max_profit > (current_profit + self.sell_custom_pump_trail_down_1)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1) and (current_profit >= self.sell_custom_recover_profit_1):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2) and (self.sell_custom_recover_profit_max_2 > current_profit >= self.sell_custom_recover_profit_min_2) and (last_candle['rsi_14'] < self.sell_custom_recover_rsi_2) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.5:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.7:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.8:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -0.9:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -4.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.2) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.3) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -4.8) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -3.2) and (last_candle['rsi_14'] > 81.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 81.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -5.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def mark_profit_target(self, pair: str, trade: \"Trade\", current_rate: float, current_profit: float, max_profit: float, last_candle, previous_candle_1) -> tuple:\n        if self.profit_target_1_enable:\n            if ((last_candle['moderi_96']) == False) and (self.sell_custom_profit_under_profit_max_1 > current_profit >= self.sell_custom_profit_under_profit_min_1) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1):\n                self._set_profit_target(pair, current_rate, \"mark_profit_target_01\")\n\n    def sell_profit_target(self, pair: str, trade: \"Trade\", current_time: \"datetime\", current_rate: float, current_profit: float, max_profit: float, last_candle, previous_candle_1) -> tuple:\n        # Check if pair exist on custom_info\n        if pair not in self.custom_info.keys():\n            return False, None\n\n        previous_rate = self.custom_info[pair]['rate']\n\n        if self.profit_target_1_enable:\n            if (current_rate < (previous_rate - 0.005)):\n                return True, 'maximizer_stoploss'\n            if (last_candle['zlema_1_sell'] < last_candle['zlema_4_sell']) and (previous_candle_1['zlema_1_sell'] > previous_candle_1['zlema_4_sell']) and (last_candle['hrsi_sell'] > 90):\n                return True, 'maximizer_strike'\n            if (current_rate < (max_profit - 0.01)):\n                return True, 'maximizer_trail'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (last_candle['close'] < last_candle['atr_high_thresh_q']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_q']):\n            if (0.05 > current_profit > 0.02):\n                return True, 'signal_profit_q_atr'\n            elif (current_profit < -0.08):\n                return True, 'signal_stoploss_q_atr'\n\n        if (current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n                return True, 'signal_profit_q_pmax_bull'\n        if (current_profit > 0.001) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n                return True, 'signal_profit_q_pmax_bear'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.0 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 78.0):\n            return True, 'signal_profit_ichi_u'\n        elif (-0.03 < current_profit < -0.0) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 75.0):\n            return True, 'signal_stoploss_ichi_u'\n\n        elif (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_profit_ichi_r_0'\n        elif (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_profit_ichi_r_1'\n        elif (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_profit_ichi_r_2'\n        elif (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_profit_ichi_r_3'\n        elif (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_profit_ichi_r_4'\n\n        elif (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_profit_ichi_slow'\n\n        elif (0.07 < current_profit < 0.1) and (max_profit-current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_profit_ichi_t'\n\n        elif (current_profit < -0.1):\n            return True, 'signal_stoploss_ichi'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        else:\n            trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n            if not buy_signal.empty:\n                buy_signal_candle = buy_signal.iloc[-1]\n                buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if all(c in ['32', '33', '34', '35', '36', '37', '38', '39', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, previous_candle_1)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Profit Target Signal\n        sell, signal_name = self.sell_profit_target(pair, trade, current_time, current_rate, current_profit, max_profit, last_candle, previous_candle_1)\n        if (sell) and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        self.mark_profit_target(pair, trade, current_rate, current_profit, max_profit, last_candle, previous_candle_1)\n\n        # Sell signal 1\n        if self.sell_condition_1_enable and (last_candle['rsi_14'] > self.sell_rsi_bb_1) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_1_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable) and (last_candle['rsi_14'] > self.sell_rsi_bb_2) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_2_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4) and (last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_4_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable and (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6):\n            if (current_profit > 0.0):\n                    return 'sell_signal_6_1' + ' ( ' + buy_tag + ')'\n            elif (max_loss > 0.25):\n                return 'sell_signal_6_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_7_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_8_2_2' + ' ( ' + buy_tag + ')'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h['chikou_span_greater'] = (informative_1h['chikou_span'] > informative_1h['senkou_a']).shift(30).fillna(False)\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # EFI - Elders Force Index\n        informative_1h['efi'] = pta.efi(informative_1h[\"close\"], informative_1h[\"volume\"], length=13)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24, self.buy_pump_pull_threshold_10_24)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36, self.buy_pump_pull_threshold_10_36)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48, self.buy_pump_pull_threshold_10_48)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24, self.buy_pump_pull_threshold_20_24)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36, self.buy_pump_pull_threshold_20_36)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48, self.buy_pump_pull_threshold_20_48)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24, self.buy_pump_pull_threshold_30_24)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36, self.buy_pump_pull_threshold_30_36)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48, self.buy_pump_pull_threshold_30_48)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24, self.buy_pump_pull_threshold_40_24)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36, self.buy_pump_pull_threshold_40_36)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48, self.buy_pump_pull_threshold_40_48)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24, self.buy_pump_pull_threshold_50_24)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36, self.buy_pump_pull_threshold_50_36)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48, self.buy_pump_pull_threshold_50_48)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24, self.buy_pump_pull_threshold_60_24)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36, self.buy_pump_pull_threshold_60_36)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48, self.buy_pump_pull_threshold_60_48)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24, self.buy_pump_pull_threshold_70_24)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36, self.buy_pump_pull_threshold_70_36)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48, self.buy_pump_pull_threshold_70_48)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24, self.buy_pump_pull_threshold_80_24)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36, self.buy_pump_pull_threshold_80_36)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48, self.buy_pump_pull_threshold_80_48)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24, self.buy_pump_pull_threshold_90_24)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36, self.buy_pump_pull_threshold_90_36)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48, self.buy_pump_pull_threshold_90_48)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24, self.buy_pump_pull_threshold_100_24)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36, self.buy_pump_pull_threshold_100_36)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48, self.buy_pump_pull_threshold_100_48)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24, self.buy_pump_pull_threshold_110_24)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36, self.buy_pump_pull_threshold_110_36)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48, self.buy_pump_pull_threshold_110_48)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24, self.buy_pump_pull_threshold_120_24)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36, self.buy_pump_pull_threshold_120_36)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48, self.buy_pump_pull_threshold_120_48)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        # HRSI\n        dataframe['hull'] = (2 * dataframe['hlc3'] - ta.WMA(dataframe['hlc3'], 2))\n        dataframe['hrsi'] = ta.RSI(dataframe['hull'], 2)\n\n        # ZLEMA\n        dataframe['zlema_2'] = pta.zlma(dataframe['hlc3'], length = 2)\n        dataframe['zlema_4'] = pta.zlma(dataframe['hlc3'], length = 4)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 5.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 5.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n        dataframe['atr_high_thresh_q'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1, self.buy_dip_threshold_10_2, self.buy_dip_threshold_10_3, self.buy_dip_threshold_10_4)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1, self.buy_dip_threshold_20_2, self.buy_dip_threshold_20_3, self.buy_dip_threshold_20_4)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1, self.buy_dip_threshold_30_2, self.buy_dip_threshold_30_3, self.buy_dip_threshold_30_4)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1, self.buy_dip_threshold_40_2, self.buy_dip_threshold_40_3, self.buy_dip_threshold_40_4)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1, self.buy_dip_threshold_50_2, self.buy_dip_threshold_50_3, self.buy_dip_threshold_50_4)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1, self.buy_dip_threshold_60_2, self.buy_dip_threshold_60_3, self.buy_dip_threshold_60_4)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1, self.buy_dip_threshold_70_2, self.buy_dip_threshold_70_3, self.buy_dip_threshold_70_4)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1, self.buy_dip_threshold_80_2, self.buy_dip_threshold_80_3, self.buy_dip_threshold_80_4)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1, self.buy_dip_threshold_90_2, self.buy_dip_threshold_90_3, self.buy_dip_threshold_90_4)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1, self.buy_dip_threshold_100_2, self.buy_dip_threshold_100_3, self.buy_dip_threshold_100_4)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1, self.buy_dip_threshold_110_2, self.buy_dip_threshold_110_3, self.buy_dip_threshold_110_4)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1, self.buy_dip_threshold_120_2, self.buy_dip_threshold_120_3, self.buy_dip_threshold_120_4)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1, self.buy_dip_threshold_130_2, self.buy_dip_threshold_130_3, self.buy_dip_threshold_130_4)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        #HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        #HRSI\n        dataframe['hull'] = (2 * dataframe['hlc3'] - ta.WMA(dataframe['hlc3'], 2))\n        dataframe['hrsi'] = ta.RSI(dataframe['hull'], 2)\n\n        dataframe['hull_sell'] = (2 * dataframe['low'] - ta.WMA(dataframe['low'], 2))\n        dataframe['hrsi_sell'] = ta.RSI(dataframe['hull_sell'], 2)\n\n        #Kalman Filter HLC3\n        dataframe['hlc3KF'] = KalmanFilter(dataframe, source='hlc3')\n\n        #Kalman Filter LOW\n        dataframe['lowKF'] = KalmanFilter(dataframe, source='low')\n\n        #ZLEMA BUY\n        dataframe['zlema_1'] = dataframe['hlc3KF']\n        dataframe['zlema_1_std'] =  dataframe['hlc3']\n        dataframe['ema_data'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(2))\n        dataframe['ema_data_2'] = dataframe['hlc3KF']  + (dataframe['hlc3KF']  - dataframe['hlc3KF'].shift(1))\n        dataframe['zlema_4'] = ta.EMA(dataframe['ema_data'], timeperiod = 4)\n        dataframe['zlema_2'] = ta.EMA(dataframe['ema_data_2'], timeperiod = 2)\n        dataframe['zlema_4_std'] = pta.zlma(dataframe['hlc3'], length = 4)\n\n        #ZLEMA SELL\n        dataframe['zlema_1_sell'] =  dataframe['lowKF']\n        dataframe['zlema_1_std_sell'] =  dataframe['low']\n        dataframe['ema_data_sell'] = dataframe['lowKF']  + (dataframe['lowKF']  - dataframe['lowKF'].shift(2))\n        dataframe['zlema_4_sell'] = ta.EMA(dataframe['ema_data_sell'], timeperiod = 4)\n        dataframe['zlema_4_std_sell'] = pta.zlma(dataframe['low'], length = 4)\n\n        #CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params['buy_condition_' + str(index) + '_enable']:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type']}\"])\n                if global_buy_protection_params[\"safe_pump\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period']}_{global_buy_protection_params['safe_pump_type']}_1h\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_1)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_1)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_1)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_1)\n\n                # Condition #2\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14_1h'] - self.buy_rsi_1h_diff_2)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2))\n\n                # Condition #3\n                elif index == 3:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_3)\n\n                # Condition #4\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4 * dataframe['bb20_2_low'])\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_4)\n\n                # Condition #5\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_5)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5))\n\n                # Condition #6\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6))\n\n                # Condition #7\n                elif index == 7:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_7)\n\n                # Condition #8\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_8)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8))\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_8)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8))\n\n                # Condition #9\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_9)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_9)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9)\n\n                # Condition #10\n                elif index == 10:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_10)\n\n                # Condition #11\n                elif index == 11:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_11)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_11)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_11)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11)\n\n                # Condition #12\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_12)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_12)\n\n                # Condition #13\n                elif index == 13:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_13)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13)\n\n                # Condition #14\n                elif index == 14:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_14)\n\n                # Condition #15\n                elif index == 15:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_15)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15)\n\n                # Condition #16\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_16)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_16)\n\n                # Condition #17\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_17)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17))\n\n                # Condition #18\n                elif index == 18:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n                    item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_18)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_18)\n\n                # Condition #19\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_19)\n                    item_buy_logic.append(dataframe['chop'] < self.buy_chop_max_19)\n                    item_buy_logic.append(dataframe['moderi_32'] == True)\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['moderi_96'] == True)\n\n                # Condition #20\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_20)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_20)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_20)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20))\n\n                # Condition #21\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_21)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_21)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_21)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21))\n\n                # Condition #22\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22) > dataframe['volume'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_22)\n\n                # Condition #23\n                elif index == 23:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_23)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_23)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_23)\n\n                # Condition #24\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_24_rsi_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_24_rsi_1h_min)\n\n                # Condition #25\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset))\n                    item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset))\n                    item_buy_logic.append(\n                        (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                        (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                    )\n                    item_buy_logic.append(dataframe['cti'] < self.buy_25_cti)\n\n                # Condition #26\n                elif index == 26:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_26_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_26_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_26_r_1h)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume))\n\n                # Condition #27\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < self.buy_27_rsi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_27_cti)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume))\n\n                # Condition #28\n                elif index == 28:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_28_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_28_cti)\n\n                # Condition #29\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_29_cti)\n\n                # Condition #30\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_30_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_30_cti)\n\n                # Condition #31\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset )\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr)\n\n                # Condition #32 - Quick mode buy\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_32'])\n                    item_buy_logic.append(dataframe['moderi_64'])\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_32_cti)\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n\n                # Condition #33 - Quick mode buy\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_33_cti)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_33_rsi)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume))\n\n                # Condition #34 - Quick mode buy\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['cti'] < self.buy_34_cti)\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume))\n\n                # Condition #35 - PMAX0 buy\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_35_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_35_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_35_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_35_cti)\n\n                # Condition #36 - PMAX1 buy\n                elif index == 36:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_36_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_36_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_36_cti)\n\n                # Condition #37 - PMAX2 buy\n                elif index == 37:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_37_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_37_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_37_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_37_cti)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #38 - PMAX3 buy\n                elif index == 38:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_38_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_38_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_38_cti)\n\n                # Condition #39 - Ichimoku\n                elif index == 39:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['cloud_top_1h'])\n                    item_buy_logic.append(dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h'])\n                    item_buy_logic.append(dataframe['chikou_span_greater_1h'])\n                    item_buy_logic.append(dataframe['efi_1h'] > 0)\n                    item_buy_logic.append(dataframe['ssl_up_1h'] > dataframe['ssl_down_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['ssl_up_1h'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_39_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_39_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_39_r_1h)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > dataframe['rsi_14_1h'].shift(12))\n                    # Start of trend\n                    item_buy_logic.append(\n                        (dataframe['leading_senkou_span_a_1h'].shift(12) < dataframe['leading_senkou_span_b_1h'].shift(12)) |\n                        (dataframe['ssl_up_1h'].shift(12) < dataframe['ssl_down_1h'].shift(12))\n                    )\n\n                # Condition #40 - ZLEMA X buy\n                elif index == 40:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['zlema_2'], dataframe['zlema_4']))\n                    item_buy_logic.append(dataframe['hrsi'] < self.buy_40_hrsi)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_40_cci)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_40_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_40_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_40_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_40_r_1h)\n\n                # Condition #41\n                elif index == 41:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_41_cti_1h)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_41_r_1h)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_41_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_41_cti)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_41_r)\n\n                # Condition #42\n                elif index == 42:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_42_cti_1h)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_42_r_1h)\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_42_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_42_bb_offset))\n\n                # Condition #43\n                elif index == 43:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_43_cti_1h)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_43_r_1h)\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_43_bb40_bbdelta_close))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_43_bb40_closedelta_close))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_43_bb40_tail_bbdelta))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_43_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_43_r)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += str(index) + ' '\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        # if self._should_catch_profit_target(pair, trade, rate, sell_reason):\n        #     self._set_profit_target(pair, trade, rate, sell_reason)\n        #     return False\n        self._remove_profit_target(pair)\n        return True\n\n    # def _should_catch_profit_target(self, pair: str, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n    #     if sell_reason == \"force_sell\":\n    #         return False\n\n    #     # ADD LOGIC HERE\n    #     if sell_reason in ['profit_target_01']:\n    #         return True\n    #     return False\n\n    def _set_profit_target(self, pair: str, rate: float, sell_reason: str):\n        self.custom_info[pair] = {\n            \"rate\": rate,\n            \"sell_reason\": sell_reason\n        }\n\n    def _remove_profit_target(self, pair: str):\n        if pair in self.custom_info.keys():\n            self.custom_info.pop(pair)\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n            self.load_hold_trades_config()\n\n            if not self.hold_trade_ids:\n                # We have no pairs we want to hold until profit, sell\n                return False\n\n            if trade.id not in self.hold_trade_ids:\n                # This pair is not on the list to hold until profit, sell\n                return False\n\n            trade_profit_ratio = self.hold_trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return True\n        else:\n            return False\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n    )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\n#Kalman Filter\ndef KalmanFilter(dtloc, source = 'close'):\n\n    dtKF = dtloc.copy().fillna(0)\n    dtKF['TRANGE'] = ta.TRANGE(dtloc).fillna(0)\n\n\n    def calc_dtKF(dfr, init=0):\n        global calc_dtKF_value_1\n        global calc_dtKF_value_2\n        global calc_dtKF_value_3\n        global calc_dtKF_source\n        if init == 1:\n            calc_dtKF_value_1 = 0.0\n            calc_dtKF_value_2 = 0.0\n            calc_dtKF_value_3 = 0.0\n            calc_dtKF_source = 0.0\n            return\n        calc_dtKF_value_1 = 0.2 * (dfr[source] - calc_dtKF_source) + 0.8 * calc_dtKF_value_1\n        calc_dtKF_value_2 = 0.1 * dfr['TRANGE'] + 0.8 * calc_dtKF_value_2\n        if calc_dtKF_value_2 != 0:\n            vlambda = abs(calc_dtKF_value_1/calc_dtKF_value_2)\n        else:\n            vlambda = 0\n        valpha =  (-1*math.pow(vlambda,2) + math.sqrt(math.pow(vlambda,4) + 16 * math.pow(vlambda,2)))/8\n        calc_dtKF_value_3 = valpha * dfr[source] + (1 - valpha) * calc_dtKF_value_3\n        calc_dtKF_source = dfr[source]\n\n        return calc_dtKF_value_3\n    calc_dtKF(None, init=1)\n    dtKF['KF'] = dtKF.apply(calc_dtKF, axis = 1)\n    return dtKF['KF']\n\n# ------------------------------\n# Utility\n# ------------------------------\nUSER_DATA_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))\nDATA_NFI_TARGET_PROFIT_BY_PAIR_PATH = os.path.join(\n    USER_DATA_DIR, \"data-nfi-profit_target_by_pair.json\")\n\ndef get_profit_target_by_pair() -> Dict:\n    if not os.path.isfile(DATA_NFI_TARGET_PROFIT_BY_PAIR_PATH):\n        return {}\n    f = open(DATA_NFI_TARGET_PROFIT_BY_PAIR_PATH)\n    return json.load(f)\n\ndef save_profit_target_by_pair(profit_target_by_pair: Dict):\n    file1 = open(DATA_NFI_TARGET_PROFIT_BY_PAIR_PATH, \"w\")\n    file1.write(json.dumps(profit_target_by_pair))\n    file1.close()\n\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = json_load(rfh)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        file_dump_json(self.path, self.data, is_zip=False, log=True)\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n\n        if not trade_ids:\n            return {}\n\n        rdata = {}\n        open_trades = {\n            trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n        }\n\n        if isinstance(trade_ids, dict):\n            # New syntax\n            for trade_id, profit_ratio in trade_ids.items():\n                try:\n                    trade_id = int(trade_id)\n                except ValueError:\n                    log.error(\n                        \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                        trade_id, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                        profit_ratio,\n                        trade_id,\n                        self.path\n                    )\n                if trade_id in open_trades:\n                    formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_id],\n                        formatted_profit_ratio\n                    )\n                    rdata[trade_id] = profit_ratio\n                else:\n                    log.warning(\n                        \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                        trade_id,\n                        self.path\n                    )\n        else:\n            # Initial Syntax\n            profit_ratio = data.get(\"profit_ratio\")\n            if profit_ratio:\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                        profit_ratio,\n                        self.path\n                    )\n            else:\n                profit_ratio = 0.005\n            formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n            for trade_id in trade_ids:\n                if not isinstance(trade_id, int):\n                    log.error(\n                        \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                        trade_id, self.path\n                    )\n                    continue\n                if trade_id in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_id],\n                        formatted_profit_ratio\n                    )\n                    rdata[trade_id] = profit_ratio\n                else:\n                    log.warning(\n                        \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                        trade_id,\n                        self.path\n                    )\n\n        return rdata\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV1/NostalgiaForInfinityV1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.persistence import Trade\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV1 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass NostalgiaForInfinityV1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.25\n    }\n\n    stoploss = -0.36\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    custom_info = {}\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.3\n\n    # Custom stoploss\n    use_custom_stoploss = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        # Prevent ROI trigger, if there is more potential, in order to maximize profit\n        if (sell_reason == 'roi') & (last_candle['rsi'] > 50):\n            return False\n        return True\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['sma_9'] = ta.EMA(dataframe, timeperiod=9)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['sma_9']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * 0.045) &\n                dataframe['closedelta'].gt(dataframe['close'] * 0.023) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * 0.266) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_9']) &\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < 0.992 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 34))\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - 36.815) &\n                (dataframe['volume'] > 0)\n            )\n            ,\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['rsi'] > 78) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0)\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV2/NostalgiaForInfinityV2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom pandas import DataFrame\nfrom freqtrade.strategy import merge_informative_pair\nfrom freqtrade.persistence import Trade\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV2 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 60 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass NostalgiaForInfinityV2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    stoploss = -1.0\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    custom_info = {}\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.04\n    # Custom stoploss\n    use_custom_stoploss = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Buy  params\n    buy_params = {\n        \"buy_bb40_bbdelta_close\": 0.017,\n        \"buy_bb40_closedelta_close\": 0.013,\n        \"buy_bb40_tail_bbdelta\": 0.445,\n\n        \"buy_bb20_close_bblowerband\": 0.992,\n        \"buy_bb20_volume\": 27,\n\n        \"buy_rsi_diff\": 52.438,\n    }\n\n    # Sell params\n    sell_params = {\n        \"sell_rsi_bb\": 79.706,\n\n        \"sell_rsi_main\": 85.023,\n\n        \"sell_rsi_2\": 87.545,\n\n        \"sell_rsi_diff\": 0.873,\n        \"sell_ema_relative\": 0.03,\n    }\n\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.05, default=0.049, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.15, 0.45, default=0.287, space='buy', optimize=True, load=True)\n    buy_bb20_close_bblowerband = DecimalParameter(0.8, 1.1, default=0.991, space='buy', optimize=True, load=True)\n    buy_bb20_volume = IntParameter(18, 34, default=20, space='buy', optimize=True, load=True)\n    buy_rsi_diff = DecimalParameter(36.0, 54.0, default=37.0, space='buy', optimize=True, load=True)\n\n    sell_rsi_bb = DecimalParameter(60.0, 80.0, default=70, space='sell', optimize=True, load=True)\n    sell_rsi_main = DecimalParameter(72.0, 90.0, default=78.0, space='sell', optimize=True, load=True)\n    sell_rsi_2 = DecimalParameter(72.0, 90.0, default=60.0, space='sell', optimize=True, load=True)\n    sell_ema_relative = DecimalParameter(0.005, 0.1, default=0.03, space='sell', optimize=False, load=True)\n    sell_rsi_diff = DecimalParameter(0.0, 5.0, default=5.0, space='sell', optimize=True, load=True)\n\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # SSL Channels\n        ssl_down_1h, ssl_up_1h = SSLChannels(informative_1h, 20)\n        informative_1h['ssl_down'] = ssl_down_1h\n        informative_1h['ssl_up'] = ssl_up_1h\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['sma_9']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_9']) &\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n\n                (dataframe['close'] < dataframe['ema_slow']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * self.buy_bb20_volume.value))\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ssl_up_1h'] > dataframe['ssl_down_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n            ,\n            'buy'\n        ] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > self.sell_rsi_bb.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['rsi'] > self.sell_rsi_main.value) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_2.value) &\n                (dataframe['volume'] > 0)\n            )\n            |\n            (\n                (dataframe['close'] < dataframe['ema_200']) &\n                (((dataframe['ema_200'] - dataframe['close']) / dataframe['close']) < self.sell_ema_relative.value) &\n\n                (dataframe['rsi'] > dataframe['rsi_1h'] + self.sell_rsi_diff.value) &\n                (dataframe['volume'] > 0)\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV3/NostalgiaForInfinityV3.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV3 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 20 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                                     ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99 # effectively disabled.\n\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    custom_info = {}\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.\n    ignore_roi_if_buy_signal = True\n\n    # Trailing stoploss\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.05\n    trailing_stop_positive_offset = 0.15\n\n    # Custom stoploss\n    use_custom_stoploss = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n    }\n\n    ############################################################################\n\n    # Buy\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_dip_threshold_0 = DecimalParameter(0.001, 0.1, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.05, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_1 = DecimalParameter(1.0, 30.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_min_inc_1 = DecimalParameter(0.005, 0.05, default=0.029, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(40.0, 70.0, default=45.25, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=85.06, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(30.0, 40.0, default=36.64, space='buy', decimals=2, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(36.0, 65.0, default=45.25, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.96, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_relative_2 = DecimalParameter(0.005, 0.08, default=0.006, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(40.0, 70.0, default=63.91, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=89.94, space='buy', decimals=2, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(35.0, 55.0, default=38.69, space='buy', decimals=2, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(36.0, 65.0, default=53.89, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n\n    buy_bb20_close_bblowerband = DecimalParameter(0.7, 1.1, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume = IntParameter(18, 35, default=24, space='buy', optimize=False, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=4.12, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.01, 0.04, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.48, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.025, 0.05, default=0.033, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=7.04, space='buy', decimals=2, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.015, 0.03, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=41.09, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 30.0, default=17.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 1.05, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=9.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 1.05, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(15.0, 40.0, default=30.2, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.382, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=87.708, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.20, default=0.01, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.65, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.20, default=0.05, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.37, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.15, 0.30, default=0.25, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=51.87, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.7, default=0.45, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.35, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.05, 0.3, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.166, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.38, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.154, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.035, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.045, space='sell', decimals=3, optimize=False, load=True)\n\n    ############################################################################\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'target_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'target_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'target_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'target_profit_1'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'target_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['sma_200_dec']):\n                return 'target_profit_u_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_1.value)):\n                return 'target_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (((trade.max_rate - trade.open_rate) / 100) > (current_profit + self.sell_trail_down_2.value)):\n                return 'target_profit_t_2'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_50'] = ta.SMA(informative_1h, timeperiod=50)\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(window=30).mean()\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n\n        # If don't exceed the dip limits\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_0.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value))\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_1.value > dataframe['volume']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['close'] < dataframe['sma_5']) &\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_100']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (((dataframe['close'] - dataframe['ema_200']) / dataframe['ema_200']) < self.buy_ema_relative_2.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['close'] > dataframe['ema_100']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50'] > dataframe['ema_100']) &\n                (dataframe['ema_15_1h'] > dataframe['ema_50_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                #(dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'])) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['close'] > dataframe['open']) &\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_10.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_5_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (((dataframe['ema_200'] - dataframe['close']) / dataframe['close']) < self.sell_ema_relative_5.value) &\n                (dataframe['rsi'] > dataframe['rsi_1h'] + self.sell_rsi_diff_5.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                (qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV4/NostalgiaForInfinityV4.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV4(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -1.0\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=False, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.382, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=30.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=36.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.035, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_5_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (((dataframe['ema_200'] - dataframe['close']) / dataframe['close']) < self.sell_ema_relative_5.value) &\n                (dataframe['rsi'] > dataframe['rsi_1h'] + self.sell_rsi_diff_5.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV4HO/NostalgiaForInfinityV4HO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV4 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV4HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -1.0\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n     # Buy hyperspace params:\n    buy_params = {\n        \"buy_bb20_close_bblowerband_4\": 0.933,\n        \"buy_bb20_volume_4\": 32,\n        \"buy_bb40_bbdelta_close_3\": 0.024,\n        \"buy_bb40_closedelta_close_3\": 0.022,\n        \"buy_bb40_tail_bbdelta_3\": 0.329,\n        \"buy_bb_offset_10\": 0.983,\n        \"buy_bb_offset_14\": 0.99,\n        \"buy_bb_offset_2\": 0.977,\n        \"buy_bb_offset_5\": 0.989,\n        \"buy_bb_offset_6\": 0.987,\n        \"buy_bb_offset_9\": 0.978,\n        \"buy_condition_10_enable\": False,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": False,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": False,\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": False,\n        \"buy_condition_6_enable\": False,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": False,\n        \"buy_condition_9_enable\": True,\n        \"buy_dip_threshold_1\": 0.019,\n        \"buy_dip_threshold_2\": 0.12,\n        \"buy_dip_threshold_3\": 0.248,\n        \"buy_dip_threshold_4\": 0.392,\n        \"buy_dip_threshold_5\": 0.023,\n        \"buy_dip_threshold_6\": 0.2,\n        \"buy_dip_threshold_7\": 0.397,\n        \"buy_dip_threshold_8\": 0.295,\n        \"buy_ema_open_mult_14\": 0.011,\n        \"buy_ema_open_mult_15\": 0.021,\n        \"buy_ema_open_mult_5\": 0.023,\n        \"buy_ema_open_mult_6\": 0.035,\n        \"buy_ema_open_mult_7\": 0.038,\n        \"buy_ema_rel_15\": 0.987,\n        \"buy_ema_rel_3\": 0.979,\n        \"buy_ema_rel_5\": 0.994,\n        \"buy_ema_rel_8\": 0.979,\n        \"buy_ewo_12\": 2.8,\n        \"buy_ewo_13\": -8.0,\n        \"buy_ewo_16\": 5.1,\n        \"buy_ewo_17\": -17.9,\n        \"buy_ma_offset_10\": 0.965,\n        \"buy_ma_offset_11\": 0.948,\n        \"buy_ma_offset_12\": 0.941,\n        \"buy_ma_offset_13\": 0.971,\n        \"buy_ma_offset_14\": 0.957,\n        \"buy_ma_offset_15\": 0.99,\n        \"buy_ma_offset_16\": 0.96,\n        \"buy_ma_offset_17\": 0.97,\n        \"buy_ma_offset_9\": 0.977,\n        \"buy_mfi_1\": 21.7,\n        \"buy_mfi_11\": 53.7,\n        \"buy_mfi_2\": 36.5,\n        \"buy_mfi_9\": 40.7,\n        \"buy_min_inc_1\": 0.032,\n        \"buy_min_inc_11\": 0.036,\n        \"buy_pump_pull_threshold_1\": 1.56,\n        \"buy_pump_pull_threshold_2\": 2.88,\n        \"buy_pump_pull_threshold_3\": 2.88,\n        \"buy_pump_pull_threshold_4\": 2.42,\n        \"buy_pump_pull_threshold_5\": 2.21,\n        \"buy_pump_pull_threshold_6\": 2.35,\n        \"buy_pump_threshold_1\": 0.601,\n        \"buy_pump_threshold_2\": 0.886,\n        \"buy_pump_threshold_3\": 0.691,\n        \"buy_pump_threshold_4\": 0.599,\n        \"buy_pump_threshold_5\": 0.804,\n        \"buy_pump_threshold_6\": 0.512,\n        \"buy_rsi_1\": 23.4,\n        \"buy_rsi_11\": 42.0,\n        \"buy_rsi_12\": 39.8,\n        \"buy_rsi_15\": 33.1,\n        \"buy_rsi_16\": 40.1,\n        \"buy_rsi_1h_10\": 29.5,\n        \"buy_rsi_1h_diff_2\": 45.1,\n        \"buy_rsi_1h_max_1\": 88.9,\n        \"buy_rsi_1h_max_11\": 80.3,\n        \"buy_rsi_1h_max_2\": 88.2,\n        \"buy_rsi_1h_max_9\": 78.4,\n        \"buy_rsi_1h_min_1\": 25.2,\n        \"buy_rsi_1h_min_11\": 40.8,\n        \"buy_rsi_1h_min_2\": 31.8,\n        \"buy_rsi_1h_min_9\": 38.1,\n        \"buy_rsi_7\": 39.1,\n        \"buy_rsi_8\": 41.3,\n        \"buy_volume_10\": 13.3,\n        \"buy_volume_12\": 10.0,\n        \"buy_volume_14\": 7.3,\n        \"buy_volume_16\": 3.1,\n        \"buy_volume_2\": 8.3,\n        \"buy_volume_5\": 4.6,\n        \"buy_volume_6\": 1.5,\n        \"buy_volume_7\": 9.1,\n        \"buy_volume_9\": 3.93,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_bb_relative_8\": 1.293,\n        \"sell_condition_1_enable\": False,\n        \"sell_condition_2_enable\": False,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": False,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": False,\n        \"sell_condition_7_enable\": False,\n        \"sell_condition_8_enable\": True,\n        \"sell_custom_profit_0\": 0.04,\n        \"sell_custom_profit_1\": 0.012,\n        \"sell_custom_profit_2\": 0.083,\n        \"sell_custom_profit_3\": 0.067,\n        \"sell_custom_profit_4\": 0.587,\n        \"sell_custom_rsi_0\": 39.492,\n        \"sell_custom_rsi_1\": 48.33,\n        \"sell_custom_rsi_2\": 45.91,\n        \"sell_custom_rsi_3\": 47.92,\n        \"sell_custom_rsi_4\": 54.5,\n        \"sell_custom_under_profit_1\": 0.012,\n        \"sell_custom_under_profit_2\": 0.088,\n        \"sell_custom_under_profit_3\": 0.121,\n        \"sell_dual_rsi_rsi_1h_4\": 89.3,\n        \"sell_dual_rsi_rsi_4\": 78.9,\n        \"sell_ema_relative_5\": 0.015,\n        \"sell_rsi_1h_7\": 87.7,\n        \"sell_rsi_bb_1\": 65.4,\n        \"sell_rsi_bb_2\": 77.6,\n        \"sell_rsi_diff_5\": 3.116,\n        \"sell_rsi_main_3\": 81.1,\n        \"sell_rsi_under_6\": 81.1,\n        \"sell_trail_down_1\": 0.154,\n        \"sell_trail_down_2\": 0.089,\n        \"sell_trail_profit_max_1\": 0.5,\n        \"sell_trail_profit_max_2\": 0.13,\n        \"sell_trail_profit_min_1\": 0.193,\n        \"sell_trail_profit_min_2\": 0.046,\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 12 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 56.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=90.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=34.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.99, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.9, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = IntParameter(16, 35, default=18, space='buy', optimize=True, load=True)\n\n    buy_volume_5 = DecimalParameter(1.0, 10.0, default=6.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_6 = DecimalParameter(1.0, 10.0, default=1.5, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_6 = DecimalParameter(0.03, 0.04, default=0.025, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.995, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_8 = DecimalParameter(30.0, 50.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_8 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=80.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 26.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.938, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=82.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=46.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-7.9, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.992, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.998, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.985, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.95, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=38.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=3.6, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=True, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.382, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=30.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=36.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.035, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=True, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # Alligator\n        dataframe['lips'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['smma_lips'] = dataframe['lips'].rolling(3).mean()\n        dataframe['teeth'] = ta.SMA(dataframe, timeperiod=8)\n        dataframe['smma_teeth'] = dataframe['teeth'].rolling(5).mean()\n        dataframe['jaw'] = ta.SMA(dataframe, timeperiod=13)\n        dataframe['smma_jaw'] = dataframe['jaw'].rolling(8).mean()\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_5.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_6.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_8.value)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['close'] > dataframe['open']) &\n\n                (dataframe['close'] > dataframe['smma_lips']) &\n\n                (dataframe['smma_lips'] > dataframe['smma_teeth']) &\n                (dataframe['smma_teeth'] > dataframe['smma_jaw']) &\n                (dataframe['smma_lips'].shift(1) > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_teeth'].shift(1) > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['smma_lips'] > dataframe['smma_lips'].shift(1)) &\n                (dataframe['smma_teeth'] > dataframe['smma_teeth'].shift(1)) &\n                (dataframe['smma_jaw'] > dataframe['smma_jaw'].shift(1)) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_48_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_5_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (((dataframe['ema_200'] - dataframe['close']) / dataframe['close']) < self.sell_ema_relative_5.value) &\n                (dataframe['rsi'] > dataframe['rsi_1h'] + self.sell_rsi_diff_5.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV5/NostalgiaForInfinityV5.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV5(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV5MultiOffsetAndHO/NostalgiaForInfinityV5MultiOffsetAndHO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NostalgiaForInfinityV5MultiOffsetAndHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 47,\n        \"buy_chop_min_19\": 41.0,\n        \"buy_rsi_1h_min_19\": 50.9,\n        \"ewo_high\": 3.28,\n        \"ewo_low\": -16.004,\n        \"low_offset_ema\": 0.93,\n        \"low_offset_kama\": 0.985,\n        \"low_offset_sma\": 0.9,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.973,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 34,\n        \"high_offset_ema\": 1.047,\n        \"high_offset_kama\": 1.07,\n        \"high_offset_sma\": 1.051,\n        \"high_offset_t3\": 0.999,\n        \"high_offset_trima\": 1.096,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV5MultiOffsetAndHO2/NostalgiaForInfinityV5MultiOffsetAndHO2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV5 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n# 20210624\n# NostalgiaForInfinityV5 + MultiOffsetLamboV0 + Hyper-optimized some parameters.\n\n# I hope you do enough testing before proceeding.\n# Thank you to those who created these strategies.\n\nclass NostalgiaForInfinityV5MultiOffsetAndHO2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_buy\": 80,\n        \"buy_chop_min_19\": 41.8,\n        \"buy_rsi_1h_min_19\": 51.4,\n        \"ewo_high\": 7.714,\n        \"ewo_low\": -16.744,\n        \"low_offset_ema\": 0.983,\n        \"low_offset_kama\": 0.962,\n        \"low_offset_sma\": 0.919,\n        \"low_offset_t3\": 0.975,\n        \"low_offset_trima\": 0.943,\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n        # Hyperopt\n        # Multi Offset\n        \"base_nb_candles_sell\": 39,\n        \"high_offset_ema\": 1.059,\n        \"high_offset_kama\": 1.081,\n        \"high_offset_sma\": 1.047,\n        \"high_offset_t3\": 1.072,\n        \"high_offset_trima\": 1.014,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01,\n    }\n\n    stoploss = -0.99\n\n    # Multi Offset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=20, load=True, space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=20, load=True, space='sell', optimize=True)\n    low_offset_sma = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_sma = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_ema = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_ema = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_trima = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_trima = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_t3 = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_t3 = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n    low_offset_kama = DecimalParameter(\n        0.9, 0.99, default=0.958, load=True, space='buy', optimize=True)\n    high_offset_kama = DecimalParameter(\n        0.99, 1.1, default=1.012, load=True, space='sell', optimize=True)\n\n    # Protection\n    ewo_low = DecimalParameter(\n        -20.0, -8.0, default=-20.0, load=True, space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=6.0, load=True, space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=50, load=True, space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=200, load=True, space='buy', optimize=False)\n\n    # MA list\n    ma_types = ['sma', 'ema', 'trima', 't3', 'kama']\n    ma_map = {\n        'sma': {\n            'low_offset': low_offset_sma.value,\n            'high_offset': high_offset_sma.value,\n            'calculate': ta.SMA\n        },\n        'ema': {\n            'low_offset': low_offset_ema.value,\n            'high_offset': high_offset_ema.value,\n            'calculate': ta.EMA\n        },\n        'trima': {\n            'low_offset': low_offset_trima.value,\n            'high_offset': high_offset_trima.value,\n            'calculate': ta.TRIMA\n        },\n        't3': {\n            'low_offset': low_offset_t3.value,\n            'high_offset': high_offset_t3.value,\n            'calculate': ta.T3\n        },\n        'kama': {\n            'low_offset': low_offset_kama.value,\n            'high_offset': high_offset_kama.value,\n            'calculate': ta.KAMA\n        }\n    }\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 300\n\n    # plot config\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    #############################################################\n\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.06, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.5, 3.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.3, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_2 = DecimalParameter(1.0, 10.0, default=2.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.999, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_7 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_7 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(36.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_9 = DecimalParameter(1.0, 4.0, default=1.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_ma_offset_9 = DecimalParameter(0.94, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 65.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_10 = DecimalParameter(1.0, 8.0, default=2.4, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(30.0, 48.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(36.0, 56.0, default=38.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_12 = DecimalParameter(1.0, 10.0, default=1.7, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.936, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(2.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_13 = DecimalParameter(1.0, 10.0, default=1.6, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.978, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-10.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_14 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.97, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_15 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_open_mult_15 = DecimalParameter(0.02, 0.04, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(30.0, 50.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_volume_16 = DecimalParameter(1.0, 10.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(4.0, 8.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_17 = DecimalParameter(0.5, 8.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.958, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_18 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_20 = DecimalParameter(0.5, 6.0, default=1.2, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_20 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_21 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    #buy_ema_rel_21 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(34.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.06, 0.30, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.3, 0.6, default=0.25, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.6, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=62.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_custom_dec_profit_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_2 = DecimalParameter(0.05, 0.2, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.25, default=0.15, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.3, 0.5, default=0.46, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.04, 0.2, default=0.18, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_2 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.08, 0.25, default=0.12, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.04, 0.2, default=0.14, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            elif (current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n\n            elif (current_profit > self.sell_custom_dec_profit_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (current_profit > self.sell_custom_dec_profit_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            elif (current_profit > self.sell_trail_profit_min_1.value) & (current_profit < self.sell_trail_profit_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (current_profit > self.sell_trail_profit_min_2.value) & (current_profit < self.sell_trail_profit_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n        # EMA\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n        # Pump protections\n        informative_1h['safe_pump_24'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_1.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_1.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_2.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_2.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_3.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_3.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_strict'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_4.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_4.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_strict'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_5.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_5.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_strict'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_6.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_6.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        informative_1h['safe_pump_24_loose'] = ((((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / informative_1h['close'].rolling(24).min()) < self.buy_pump_threshold_7.value) | (((informative_1h['open'].rolling(24).max() - informative_1h['close'].rolling(24).min()) / self.buy_pump_pull_threshold_7.value) > (informative_1h['close'] - informative_1h['close'].rolling(24).min())))\n        informative_1h['safe_pump_36_loose'] = ((((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / informative_1h['close'].rolling(36).min()) < self.buy_pump_threshold_8.value) | (((informative_1h['open'].rolling(36).max() - informative_1h['close'].rolling(36).min()) / self.buy_pump_pull_threshold_8.value) > (informative_1h['close'] - informative_1h['close'].rolling(36).min())))\n        informative_1h['safe_pump_48_loose'] = ((((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / informative_1h['close'].rolling(48).min()) < self.buy_pump_threshold_9.value) | (((informative_1h['open'].rolling(48).max() - informative_1h['close'].rolling(48).min()) / self.buy_pump_pull_threshold_9.value) > (informative_1h['close'] - informative_1h['close'].rolling(48).min())))\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        # Offset\n        for i in self.ma_types:\n            dataframe[f'{i}_offset_buy'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_buy.value) * \\\n                self.ma_map[f'{i}']['low_offset']\n            dataframe[f'{i}_offset_sell'] = self.ma_map[f'{i}']['calculate'](\n                dataframe, self.base_nb_candles_sell.value) * \\\n                self.ma_map[f'{i}']['high_offset']\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.buy_condition_1_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(50)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value) &\n                (dataframe['rsi'] < self.buy_rsi_1.value) &\n                (dataframe['mfi'] < self.buy_mfi_1.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_2_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume']) &\n\n                #(dataframe['rsi_1h'] > self.buy_rsi_1h_min_2.value) &\n                #(dataframe['rsi_1h'] < self.buy_rsi_1h_max_2.value) &\n                (dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value) &\n                (dataframe['mfi'] < self.buy_mfi_2.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_3_enable.value &\n\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value)) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                dataframe['lower'].shift().gt(0) &\n                dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value) &\n                dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value) &\n                dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value) &\n                dataframe['close'].lt(dataframe['lower'].shift()) &\n                dataframe['close'].le(dataframe['close'].shift()) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_4_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'] < dataframe['ema_50']) &\n                (dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_5_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_6_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_7_enable.value &\n\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                (dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_7.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_8_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['rsi'] < self.buy_rsi_8.value) &\n                (dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value)) &\n                (dataframe['close'] > dataframe['open']) &\n                ((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value)) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_9_enable.value &\n\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value) &\n                (dataframe['mfi'] < self.buy_mfi_9.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_10_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_10.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value) &\n                (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_10.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_11_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_1h']) &\n                (dataframe['safe_pump_48_loose_1h']) &\n\n                (((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value) &\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value) &\n                (dataframe['rsi'] < self.buy_rsi_11.value) &\n                (dataframe['mfi'] < self.buy_mfi_11.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_12_enable.value &\n\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value) &\n                (dataframe['ewo'] > self.buy_ewo_12.value) &\n                (dataframe['rsi'] < self.buy_rsi_12.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_13_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_100_1h']) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24)) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n                (dataframe['safe_pump_36_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value) &\n                (dataframe['ewo'] < self.buy_ewo_13.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_14_enable.value &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(30)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(50)) &\n\n                (dataframe['safe_dips_loose']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value)) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_15_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_36_strict_1h']) &\n\n                (dataframe['ema_26'] > dataframe['ema_12']) &\n                ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value)) &\n                ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &\n                (dataframe['rsi'] < self.buy_rsi_15.value) &\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_16_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value) &\n                (dataframe['ewo'] > self.buy_ewo_16.value) &\n                (dataframe['rsi'] < self.buy_rsi_16.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_17_enable.value &\n\n                (dataframe['safe_dips_strict']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_17.value) > dataframe['volume']) &\n\n                (dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value) &\n                (dataframe['ewo'] < self.buy_ewo_17.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_18_enable.value &\n\n                (dataframe['close'] > dataframe['ema_200_1h']) &\n                (dataframe['ema_100'] > dataframe['ema_200']) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(20)) &\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(44)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36)) &\n                (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(72)) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_strict_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_18.value) &\n                (dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_19_enable.value &\n\n                (dataframe['ema_100_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['sma_200'] > dataframe['sma_200'].shift(36)) &\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_1h']) &\n\n                (dataframe['close'].shift(1) > dataframe['ema_100_1h']) &\n                (dataframe['low'] < dataframe['ema_100_1h']) &\n                (dataframe['close'] > dataframe['ema_100_1h']) &\n                (dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value) &\n                (dataframe['chop'] < self.buy_chop_min_19.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_20_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips']) &\n                (dataframe['safe_pump_24_loose_1h']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_20.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_20.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.buy_condition_21_enable.value &\n\n                (dataframe['ema_50_1h'] > dataframe['ema_200_1h']) &\n\n                (dataframe['safe_dips_strict']) &\n\n                ((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume']) &\n\n                (dataframe['rsi'] < self.buy_rsi_21.value) &\n                (dataframe['rsi_1h'] < self.buy_rsi_1h_21.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    dataframe['close'] < dataframe[f'{i}_offset_buy']) &\n                (\n                    (dataframe['ewo'] < self.ewo_low.value) |\n                    (dataframe['ewo'] > self.ewo_high.value)\n                ) &\n                (dataframe['volume'] > 0)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        for i in self.ma_types:\n            conditions.append(\n                (\n                    (dataframe['close'] > dataframe[f'{i}_offset_sell']) &\n                    (dataframe['volume'] > 0)\n                )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV6/NostalgiaForInfinityV6.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV6 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV6(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.965, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['lower'].shift().gt(0))\n        buy_03_logic.append(dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['lower'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_normal_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_loose_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_24_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV6HO/NostalgiaForInfinityV6HO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV6 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV6HO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=True, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=True, load=True)\n\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=True, load=True)\n\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=True, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"loose\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=True, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"strict\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"strict\",\"normal\",\"loose\"], default=\"normal\", space='buy', optimize=True, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=True, load=True)\n\n    # Normal dips\n    buy_dip_threshold_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=True, load=True)\n    # Strict dips\n    buy_dip_threshold_5 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_6 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_7 = DecimalParameter(0.05, 0.4, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_8 = DecimalParameter(0.2, 0.5, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    # Loose dips\n    buy_dip_threshold_9 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_10 = DecimalParameter(0.01, 0.2, default=0.24, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_11 = DecimalParameter(0.05, 0.4, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    buy_dip_threshold_12 = DecimalParameter(0.2, 0.5, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours\n    buy_pump_pull_threshold_1 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_1 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours\n    buy_pump_pull_threshold_2 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_2 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours\n    buy_pump_pull_threshold_3 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_3 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours strict\n    buy_pump_pull_threshold_4 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_4 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours strict\n    buy_pump_pull_threshold_5 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_5 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours strict\n    buy_pump_pull_threshold_6 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_6 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=True, load=True)\n\n    # 24 hours loose\n    buy_pump_pull_threshold_7 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_7 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=True, load=True)\n    # 36 hours loose\n    buy_pump_pull_threshold_8 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_8 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=True, load=True)\n    # 48 hours loose\n    buy_pump_pull_threshold_9 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=True, load=True)\n    buy_pump_threshold_9 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.057, space='buy', optimize=True, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=True, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=True, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.979, space='buy', optimize=True, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=True, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=True, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.024, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.965, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.994, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.939, space='buy', decimals=3, optimize=True, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=56.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=True, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=True, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=True, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=True, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=True, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=True, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=True, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=True, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=True, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=True, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=True, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=33.0, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=38.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=44.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=49.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=54.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=50.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=33.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=58.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(32.0, 48.0, default=44.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=True, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=True, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=True, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=True, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=True, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=8.0, space='sell', optimize=True, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=True, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_4 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_5 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_6 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=True, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_7 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_8 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=True, load=True)\n    sell_pump_threshold_9 = DecimalParameter(0.2, 0.5, default=0.3, space='sell', decimals=2, optimize=True, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=True, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=True, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=True, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=True, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=True, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=True, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n                return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (self.range_percent_change(df, length) < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb_lowerband'] = bollinger['lower']\n        informative_1h['bb_middleband'] = bollinger['mid']\n        informative_1h['bb_upperband'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['safe_pump_24_normal'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_1.value, self.buy_pump_pull_threshold_1.value)\n        informative_1h['safe_pump_36_normal'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_2.value, self.buy_pump_pull_threshold_2.value)\n        informative_1h['safe_pump_48_normal'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_3.value, self.buy_pump_pull_threshold_3.value)\n\n        informative_1h['safe_pump_24_strict'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_4.value, self.buy_pump_pull_threshold_4.value)\n        informative_1h['safe_pump_36_strict'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_5.value, self.buy_pump_pull_threshold_5.value)\n        informative_1h['safe_pump_48_strict'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_6.value, self.buy_pump_pull_threshold_6.value)\n\n        informative_1h['safe_pump_24_loose'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_7.value, self.buy_pump_pull_threshold_7.value)\n        informative_1h['safe_pump_36_loose'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_8.value, self.buy_pump_pull_threshold_8.value)\n        informative_1h['safe_pump_48_loose'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_9.value, self.buy_pump_pull_threshold_9.value)\n\n        informative_1h['sell_pump_48_1'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_1.value)\n        informative_1h['sell_pump_48_2'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_2.value)\n        informative_1h['sell_pump_48_3'] = (((informative_1h['high'].rolling(48).max() - informative_1h['low'].rolling(48).min()) / informative_1h['low'].rolling(48).min()) > self.sell_pump_threshold_3.value)\n\n        informative_1h['sell_pump_36_1'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_4.value)\n        informative_1h['sell_pump_36_2'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_5.value)\n        informative_1h['sell_pump_36_3'] = (((informative_1h['high'].rolling(36).max() - informative_1h['low'].rolling(36).min()) / informative_1h['low'].rolling(36).min()) > self.sell_pump_threshold_6.value)\n\n        informative_1h['sell_pump_24_1'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_7.value)\n        informative_1h['sell_pump_24_2'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_8.value)\n        informative_1h['sell_pump_24_3'] = (((informative_1h['high'].rolling(24).max() - informative_1h['low'].rolling(24).min()) / informative_1h['low'].rolling(24).min()) > self.sell_pump_threshold_9.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # BB 20\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Dip protection\n        dataframe['safe_dips_normal'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_1.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_2.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_3.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_4.value))\n\n        dataframe['safe_dips_strict'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_5.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_6.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_7.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_8.value))\n\n        dataframe['safe_dips_loose'] = ((((dataframe['open'] - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_9.value) &\n                                  (((dataframe['open'].rolling(2).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_10.value) &\n                                  (((dataframe['open'].rolling(12).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_11.value) &\n                                  (((dataframe['open'].rolling(144).max() - dataframe['close']) / dataframe['close']) < self.buy_dip_threshold_12.value))\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['lower'].shift().gt(0))\n        buy_03_logic.append(dataframe['bbdelta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bbdelta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['lower'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb_lowerband'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_normal_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_loose_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb_lowerband'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe.loc[:, 'buy_24_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb_upperband'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb_upperband'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb_upperband'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb_upperband']) &\n                (dataframe['close'].shift(1) > dataframe['bb_upperband'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb_upperband'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb_upperband_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV7/NostalgiaForInfinityV7.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV7(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV7_7_2/NostalgiaForInfinityV7_7_2.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.misc import json_load, file_dump_json\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import zema, VIDYA, ichimoku\n\n\nlog = logging.getLogger(__name__)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: pip install pandas_ta\")\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV8 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"hold-trades.json\" in the same directory as this strategy.                                          ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled parameter                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV7_7_2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    plot_config = {\n        'main_plot': {\n             },\n        'subplots': {\n            \"buy tag\": {\n                'buy_tag': {'color': 'green'}\n            },\n        }\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe = '1h'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        \"buy_condition_44_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"80\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"70\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        3: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        4: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        5: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"30\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        9: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"40\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"50\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        18: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        19: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"36\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"90\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"15\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        24: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"20\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"10\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"20\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        30: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"110\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"120\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : True,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : False\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"10\",\n            \"safe_pump_period\"          : \"36\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"15\",\n            \"close_above_ema_fast\"      : True,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        40: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"25\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : True,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"130\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"50\",\n            \"safe_pump_period\"          : \"48\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        41: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"50\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"120\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        42: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"110\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        43: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : True,\n            \"safe_dips_type\"            : \"70\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : True\n        },\n        44: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"20\",\n            \"safe_dips\"                 : False,\n            \"safe_dips_type\"            : \"100\",\n            \"safe_pump\"                 : False,\n            \"safe_pump_type\"            : \"100\",\n            \"safe_pump_period\"          : \"24\",\n            \"btc_1h_not_downtrend\"      : False\n        }\n    }\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = 0.015\n    buy_dip_threshold_10_2 = 0.1\n    buy_dip_threshold_10_3 = 0.24\n    buy_dip_threshold_10_4 = 0.42\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = 0.016\n    buy_dip_threshold_20_2 = 0.11\n    buy_dip_threshold_20_3 = 0.26\n    buy_dip_threshold_20_4 = 0.44\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = 0.018\n    buy_dip_threshold_30_2 = 0.12\n    buy_dip_threshold_30_3 = 0.28\n    buy_dip_threshold_30_4 = 0.46\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = 0.019\n    buy_dip_threshold_40_2 = 0.13\n    buy_dip_threshold_40_3 = 0.3\n    buy_dip_threshold_40_4 = 0.48\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = 0.02\n    buy_dip_threshold_50_2 = 0.14\n    buy_dip_threshold_50_3 = 0.32\n    buy_dip_threshold_50_4 = 0.5\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = 0.022\n    buy_dip_threshold_60_2 = 0.18\n    buy_dip_threshold_60_3 = 0.34\n    buy_dip_threshold_60_4 = 0.56\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = 0.023\n    buy_dip_threshold_70_2 = 0.2\n    buy_dip_threshold_70_3 = 0.36\n    buy_dip_threshold_70_4 = 0.6\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = 0.024\n    buy_dip_threshold_80_2 = 0.22\n    buy_dip_threshold_80_3 = 0.38\n    buy_dip_threshold_80_4 = 0.66\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = 0.025\n    buy_dip_threshold_90_2 = 0.23\n    buy_dip_threshold_90_3 = 0.4\n    buy_dip_threshold_90_4 = 0.7\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = 0.026\n    buy_dip_threshold_100_2 = 0.24\n    buy_dip_threshold_100_3 = 0.42\n    buy_dip_threshold_100_4 = 0.8\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = 0.027\n    buy_dip_threshold_110_2 = 0.26\n    buy_dip_threshold_110_3 = 0.44\n    buy_dip_threshold_110_4 = 0.84\n    # Loose dips - level 120\n    buy_dip_threshold_120_1 = 0.028\n    buy_dip_threshold_120_2 = 0.28\n    buy_dip_threshold_120_3 = 0.46\n    buy_dip_threshold_120_4 = 0.86\n    # Loose dips - level 130\n    buy_dip_threshold_130_1 = 0.028\n    buy_dip_threshold_130_2 = 0.3\n    buy_dip_threshold_130_3 = 0.48\n    buy_dip_threshold_130_4 = 0.9\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = 2.2\n    buy_pump_threshold_10_24 = 0.42\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = 2.0\n    buy_pump_threshold_10_36 = 0.58\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = 2.0\n    buy_pump_threshold_10_48 = 0.8\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = 2.2\n    buy_pump_threshold_20_24 = 0.46\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = 2.0\n    buy_pump_threshold_20_36 = 0.6\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = 2.0\n    buy_pump_threshold_20_48 = 0.81\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = 2.2\n    buy_pump_threshold_30_24 = 0.5\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = 2.0\n    buy_pump_threshold_30_36 = 0.62\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = 2.0\n    buy_pump_threshold_30_48 = 0.82\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = 2.2\n    buy_pump_threshold_40_24 = 0.54\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = 2.0\n    buy_pump_threshold_40_36 = 0.63\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = 2.0\n    buy_pump_threshold_40_48 = 0.84\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = 1.75\n    buy_pump_threshold_50_24 = 0.6\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = 1.75\n    buy_pump_threshold_50_36 = 0.64\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = 1.75\n    buy_pump_threshold_50_48 = 0.85\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = 1.75\n    buy_pump_threshold_60_24 = 0.62\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = 1.75\n    buy_pump_threshold_60_36 = 0.66\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = 1.75\n    buy_pump_threshold_60_48 = 0.9\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = 1.75\n    buy_pump_threshold_70_24 = 0.63\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = 1.75\n    buy_pump_threshold_70_36 = 0.67\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = 1.75\n    buy_pump_threshold_70_48 = 0.95\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = 1.75\n    buy_pump_threshold_80_24 = 0.64\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = 1.75\n    buy_pump_threshold_80_36 = 0.68\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = 1.75\n    buy_pump_threshold_80_48 = 1.0\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = 1.75\n    buy_pump_threshold_90_24 = 0.65\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = 1.75\n    buy_pump_threshold_90_36 = 0.69\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = 1.75\n    buy_pump_threshold_90_48 = 1.1\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = 1.7\n    buy_pump_threshold_100_24 = 0.66\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = 1.7\n    buy_pump_threshold_100_36 = 0.7\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = 1.4\n    buy_pump_threshold_100_48 = 1.6\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = 1.7\n    buy_pump_threshold_110_24 = 0.7\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = 1.7\n    buy_pump_threshold_110_36 = 0.74\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = 1.4\n    buy_pump_threshold_110_48 = 1.8\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = 1.7\n    buy_pump_threshold_120_24 = 0.78\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = 1.7\n    buy_pump_threshold_120_36 = 0.78\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = 1.4\n    buy_pump_threshold_120_48 = 2.0\n\n    # 5 hours - level 10\n    buy_dump_protection_10_5 = 0.4\n\n    # 5 hours - level 20\n    buy_dump_protection_20_5 = 0.44\n\n    # 5 hours - level 30\n    buy_dump_protection_30_5 = 0.50\n\n    # 5 hours - level 40\n    buy_dump_protection_40_5 = 0.58\n\n    # 5 hours - level 50\n    buy_dump_protection_50_5 = 0.66\n\n    # 5 hours - level 60\n    buy_dump_protection_60_5 = 0.74\n\n    buy_min_inc_1 = 0.022\n    buy_rsi_1h_min_1 = 20.0\n    buy_rsi_1h_max_1 = 84.0\n    buy_rsi_1 = 36.0\n    buy_mfi_1 = 50.0\n    buy_cti_1 = -0.92\n\n    buy_rsi_1h_min_2 = 32.0\n    buy_rsi_1h_max_2 = 84.0\n    buy_rsi_1h_diff_2 = 38.8\n    buy_mfi_2 = 49.0\n    buy_bb_offset_2 = 0.983\n    buy_volume_2 = 1.6\n\n    buy_bb40_bbdelta_close_3 = 0.045\n    buy_bb40_closedelta_close_3 = 0.023\n    buy_bb40_tail_bbdelta_3 = 0.418\n    buy_ema_rel_3 = 0.986\n    buy_cti_3 = -0.5\n\n    buy_bb20_close_bblowerband_4 = 0.979\n    buy_bb20_volume_4 = 10.0\n    buy_cti_4 = -0.8\n\n    buy_ema_open_mult_5 = 0.018\n    buy_bb_offset_5 = 0.996\n    buy_ema_rel_5 = 0.915\n    buy_cti_5 = -0.84\n    buy_volume_5 = 1.8\n\n    buy_ema_open_mult_6 = 0.021\n    buy_bb_offset_6 = 0.976\n\n    buy_ema_open_mult_7 = 0.030\n    buy_cti_7 = -0.89\n\n    buy_cti_8 = -0.88\n    buy_rsi_8 = 40.0\n    buy_bb_offset_8 = 0.99\n    buy_rsi_1h_8 = 64.0\n    buy_volume_8 = 1.8\n\n    buy_ma_offset_9 = 0.968\n    buy_bb_offset_9 = 0.942\n    buy_rsi_1h_min_9 = 20.0\n    buy_rsi_1h_max_9 = 88.0\n    buy_mfi_9 = 50.0\n\n    buy_ma_offset_10 = 0.98\n    buy_bb_offset_10 = 0.972\n    buy_rsi_1h_10 = 50.0\n\n    buy_ma_offset_11 = 0.946\n    buy_min_inc_11 = 0.038\n    buy_rsi_1h_min_11 = 46.0\n    buy_rsi_1h_max_11 = 84.0\n    buy_rsi_11 = 38.0\n    buy_mfi_11 = 36.0\n\n    buy_ma_offset_12 = 0.921\n    buy_rsi_12 = 28.0\n    buy_ewo_12 = 1.8\n    buy_cti_12 = -0.7\n\n    buy_ma_offset_13 = 0.99\n    buy_cti_13 = -0.82\n    buy_ewo_13 = -9.0\n\n    buy_ema_open_mult_14 = 0.014\n    buy_bb_offset_14 = 0.988\n    buy_ma_offset_14 = 0.945\n    buy_cti_14 = -0.86\n\n    buy_ema_open_mult_15 = 0.024\n    buy_ma_offset_15 = 0.958\n    buy_rsi_15 = 28.0\n    buy_ema_rel_15 = 0.974\n\n    buy_ma_offset_16 = 0.953\n    buy_rsi_16 = 31.0\n    buy_ewo_16 = 2.8\n    buy_cti_16 = -0.84\n\n    buy_ma_offset_17 = 0.99\n    buy_ewo_17 = -9.4\n    buy_cti_17 = -0.96\n    buy_volume_17 = 2.0\n\n    buy_rsi_18 = 33.0\n    buy_bb_offset_18 = 0.986\n    buy_volume_18 = 2.0\n    buy_cti_18 = -0.86\n\n    buy_rsi_1h_min_19 = 30.0\n    buy_chop_max_19 = 21.3\n\n    buy_rsi_20 = 36.0\n    buy_rsi_1h_20 = 16.0\n    buy_cti_20 = -0.84\n    buy_volume_20 = 2.0\n\n    buy_rsi_21 = 14.0\n    buy_rsi_1h_21 = 28.0\n    buy_cti_21 = -0.902\n    buy_volume_21 = 2.0\n\n    buy_volume_22 = 2.0\n    buy_bb_offset_22 = 0.984\n    buy_ma_offset_22 = 0.942\n    buy_ewo_22 = 5.8\n    buy_rsi_22 = 36.0\n\n    buy_23_bb_offset = 0.984\n    buy_23_ewo = 7.8\n    buy_23_rsi = 32.4\n    buy_23_rsi_1h = 80.0\n    buy_23_cti = -0.66\n    buy_23_r = -80.0\n    buy_23_r_1h = -80.0\n\n    buy_24_rsi_max = 50.0\n    buy_24_rsi_1h_min = 66.9\n\n    buy_25_ma_offset = 0.922\n    buy_25_rsi_4 = 38.0\n    buy_25_cti = -0.76\n\n    buy_26_zema_low_offset = 0.94\n    buy_26_cti = -0.91\n    buy_26_r = -35.0\n    buy_26_r_1h = -60.0\n    buy_26_volume = 2.0\n\n    buy_27_wr_max = 90.0\n    buy_27_wr_1h_max = 90.0\n    buy_27_rsi_max = 50\n    buy_27_cti = -0.93\n    buy_27_volume = 2.0\n\n    buy_28_ma_offset = 0.97\n    buy_28_ewo = 7.2\n    buy_28_rsi = 32.5\n    buy_28_cti = -0.9\n\n    buy_29_ma_offset = 0.94\n    buy_29_ewo = -4.0\n    buy_29_cti = -0.95\n\n    buy_30_ma_offset = 0.97\n    buy_30_ewo = 7.4\n    buy_30_rsi = 40.0\n    buy_30_cti = -0.88\n\n    buy_31_ma_offset = 0.962\n    buy_31_ewo = -10.4\n    buy_31_wr = -90.0\n    buy_31_cti = -0.89\n\n    buy_32_ma_offset = 0.934\n    buy_32_dip = 0.005\n    buy_32_rsi = 46.0\n    buy_32_cti = -0.8\n\n    buy_33_ma_offset = 0.988\n    buy_33_rsi = 32.0\n    buy_33_cti = -0.88\n    buy_33_ewo = 6.4\n    buy_33_volume = 2.0\n\n    buy_34_ma_offset = 0.93\n    buy_34_dip = 0.005\n    buy_34_ewo = -6.0\n    buy_34_cti = -0.88\n    buy_34_volume = 2.0\n\n    buy_35_ma_offset = 0.984\n    buy_35_ewo = 9.6\n    buy_35_rsi = 32.0\n    buy_35_cti = -0.5\n\n    buy_36_ma_offset = 0.98\n    buy_36_ewo = -8.8\n    buy_36_cti = -0.8\n\n    buy_37_ma_offset = 0.98\n    buy_37_ewo = 9.8\n    buy_37_rsi = 56.0\n    buy_37_cti = -0.7\n\n    buy_38_ma_offset = 0.98\n    buy_38_ewo = -5.2\n    buy_38_cti = -0.96\n\n    buy_39_cti = -0.77\n    buy_39_r = -60.0\n    buy_39_r_1h = -38.0\n\n    buy_40_hrsi = 30.0\n    buy_40_cci = -240.0\n    buy_40_rsi = 30.0\n    buy_40_cti = -0.8\n    buy_40_r = -90.0\n    buy_40_r_1h = -90.0\n\n    buy_41_cti_1h = -0.84\n    buy_41_r_1h = -42.0\n    buy_41_ma_offset = 0.96\n    buy_41_cti = -0.8\n    buy_41_r = -75.0\n\n    buy_42_cti_1h = 0.5\n    buy_42_r_1h = -46.0\n    buy_42_ema_open_mult = 0.018\n    buy_42_bb_offset = 0.992\n\n    buy_43_cti_1h = 0.5\n    buy_43_r_1h = -80.0\n    buy_43_bb40_bbdelta_close = 0.046\n    buy_43_bb40_closedelta_close = 0.02\n    buy_43_bb40_tail_bbdelta = 0.5\n    buy_43_cti = -0.6\n    buy_43_r = -90.0\n\n    buy_44_ma_offset = 0.982\n    buy_44_ewo = -18.143\n    buy_44_cti = -0.8\n    buy_44_r_1h = -75.0\n\n    # Sell\n\n    sell_condition_1_enable = True\n    sell_condition_2_enable = True\n    sell_condition_3_enable = True\n    sell_condition_4_enable = True\n    sell_condition_5_enable = True\n    sell_condition_6_enable = True\n    sell_condition_7_enable = True\n    sell_condition_8_enable = True\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = 0.9\n    sell_pump_threshold_48_2 = 0.7\n    sell_pump_threshold_48_3 = 0.5\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = 0.72\n    sell_pump_threshold_36_2 = 4.0\n    sell_pump_threshold_36_3 = 1.0\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = 0.68\n    sell_pump_threshold_24_2 = 0.62\n    sell_pump_threshold_24_3 = 0.88\n\n    sell_rsi_bb_1 = 79.5\n\n    sell_rsi_bb_2 = 81\n\n    sell_rsi_main_3 = 82\n\n    sell_dual_rsi_rsi_4 = 73.4\n    sell_dual_rsi_rsi_1h_4 = 79.6\n\n    sell_ema_relative_5 = 0.024\n    sell_rsi_diff_5 = 4.4\n\n    sell_rsi_under_6 = 79.0\n\n    sell_rsi_1h_7 = 81.7\n\n    sell_bb_relative_8 = 1.1\n\n    # Profit over EMA200\n    sell_custom_profit_bull_0 = 0.012\n    sell_custom_rsi_under_bull_0 = 34.0\n    sell_custom_profit_bull_1 = 0.02\n    sell_custom_rsi_under_bull_1 = 35.0\n    sell_custom_profit_bull_2 = 0.03\n    sell_custom_rsi_under_bull_2 = 36.0\n    sell_custom_profit_bull_3 = 0.04\n    sell_custom_rsi_under_bull_3 = 37.0\n    sell_custom_profit_bull_4 = 0.05\n    sell_custom_rsi_under_bull_4 = 42.0\n    sell_custom_profit_bull_5 = 0.06\n    sell_custom_rsi_under_bull_5 = 49.0\n    sell_custom_profit_bull_6 = 0.07\n    sell_custom_rsi_under_bull_6 = 50.0\n    sell_custom_profit_bull_7 = 0.08\n    sell_custom_rsi_under_bull_7 = 54.0\n    sell_custom_profit_bull_8 = 0.09\n    sell_custom_rsi_under_bull_8 = 50.0\n    sell_custom_profit_bull_9 = 0.1\n    sell_custom_rsi_under_bull_9 = 46.0\n    sell_custom_profit_bull_10 = 0.12\n    sell_custom_rsi_under_bull_10 = 42.0\n    sell_custom_profit_bull_11 = 0.20\n    sell_custom_rsi_under_bull_11 = 30.0\n\n    sell_custom_profit_bear_0 = 0.012\n    sell_custom_rsi_under_bear_0 = 34.0\n    sell_custom_profit_bear_1 = 0.02\n    sell_custom_rsi_under_bear_1 = 35.0\n    sell_custom_profit_bear_2 = 0.03\n    sell_custom_rsi_under_bear_2 = 37.0\n    sell_custom_profit_bear_3 = 0.04\n    sell_custom_rsi_under_bear_3 = 44.0\n    sell_custom_profit_bear_4 = 0.05\n    sell_custom_rsi_under_bear_4 = 48.0\n    sell_custom_profit_bear_5 = 0.06\n    sell_custom_rsi_under_bear_5 = 50.0\n    sell_custom_rsi_over_bear_5 = 78.0\n    sell_custom_profit_bear_6 = 0.07\n    sell_custom_rsi_under_bear_6 = 52.0\n    sell_custom_rsi_over_bear_6 = 78.0\n    sell_custom_profit_bear_7 = 0.08\n    sell_custom_rsi_under_bear_7 = 54.0\n    sell_custom_rsi_over_bear_7 = 80.0\n    sell_custom_profit_bear_8 = 0.09\n    sell_custom_rsi_under_bear_8 = 52.0\n    sell_custom_rsi_over_bear_8 = 82.0\n    sell_custom_profit_bear_9 = 0.1\n    sell_custom_rsi_under_bear_9 = 46.0\n    sell_custom_profit_bear_10 = 0.12\n    sell_custom_rsi_under_bear_10 = 42.0\n    sell_custom_profit_bear_11 = 0.20\n    sell_custom_rsi_under_bear_11 = 30.0\n\n    # Profit under EMA200\n    sell_custom_under_profit_bull_0 = 0.01\n    sell_custom_under_rsi_under_bull_0 = 38.0\n    sell_custom_under_profit_bull_1 = 0.02\n    sell_custom_under_rsi_under_bull_1 = 46.0\n    sell_custom_under_profit_bull_2 = 0.03\n    sell_custom_under_rsi_under_bull_2 = 47.0\n    sell_custom_under_profit_bull_3 = 0.04\n    sell_custom_under_rsi_under_bull_3 = 48.0\n    sell_custom_under_profit_bull_4 = 0.05\n    sell_custom_under_rsi_under_bull_4 = 49.0\n    sell_custom_under_profit_bull_5 = 0.06\n    sell_custom_under_rsi_under_bull_5 = 50.0\n    sell_custom_under_profit_bull_6 = 0.07\n    sell_custom_under_rsi_under_bull_6 = 52.0\n    sell_custom_under_profit_bull_7 = 0.08\n    sell_custom_under_rsi_under_bull_7 = 54.0\n    sell_custom_under_profit_bull_8 = 0.09\n    sell_custom_under_rsi_under_bull_8 = 50.0\n    sell_custom_under_profit_bull_9 = 0.1\n    sell_custom_under_rsi_under_bull_9 = 46.0\n    sell_custom_under_profit_bull_10 = 0.12\n    sell_custom_under_rsi_under_bull_10 = 42.0\n    sell_custom_under_profit_bull_11 = 0.2\n    sell_custom_under_rsi_under_bull_11 = 30.0\n\n    sell_custom_under_profit_bear_0 = 0.01\n    sell_custom_under_rsi_under_bear_0 = 38.0\n    sell_custom_under_profit_bear_1 = 0.02\n    sell_custom_under_rsi_under_bear_1 = 56.0\n    sell_custom_under_profit_bear_2 = 0.03\n    sell_custom_under_rsi_under_bear_2 = 57.0\n    sell_custom_under_profit_bear_3 = 0.04\n    sell_custom_under_rsi_under_bear_3 = 58.0\n    sell_custom_under_profit_bear_4 = 0.05\n    sell_custom_under_rsi_under_bear_4 = 57.0\n    sell_custom_under_profit_bear_5 = 0.06\n    sell_custom_under_rsi_under_bear_5 = 56.0\n    sell_custom_under_rsi_over_bear_5 = 78.0\n    sell_custom_under_profit_bear_6 = 0.07\n    sell_custom_under_rsi_under_bear_6 = 55.0\n    sell_custom_under_rsi_over_bear_6 = 78.0\n    sell_custom_under_profit_bear_7 = 0.08\n    sell_custom_under_rsi_under_bear_7 = 54.0\n    sell_custom_under_rsi_over_bear_7 = 80.0\n    sell_custom_under_profit_bear_8 = 0.09\n    sell_custom_under_rsi_under_bear_8 = 50.0\n    sell_custom_under_rsi_over_bear_8 = 82.0\n    sell_custom_under_profit_bear_9 = 0.1\n    sell_custom_under_rsi_under_bear_9 = 46.0\n    sell_custom_under_profit_bear_10 = 0.12\n    sell_custom_under_rsi_under_bear_10 = 42.0\n    sell_custom_under_profit_bear_11 = 0.2\n    sell_custom_under_rsi_under_bear_11 = 30.0\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = 0.01\n    sell_custom_pump_rsi_1_1 = 34.0\n    sell_custom_pump_profit_1_2 = 0.02\n    sell_custom_pump_rsi_1_2 = 40.0\n    sell_custom_pump_profit_1_3 = 0.04\n    sell_custom_pump_rsi_1_3 = 42.0\n    sell_custom_pump_profit_1_4 = 0.1\n    sell_custom_pump_rsi_1_4 = 34.0\n    sell_custom_pump_profit_1_5 = 0.2\n    sell_custom_pump_rsi_1_5 = 30.0\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = 0.01\n    sell_custom_pump_rsi_2_1 = 34.0\n    sell_custom_pump_profit_2_2 = 0.02\n    sell_custom_pump_rsi_2_2 = 40.0\n    sell_custom_pump_profit_2_3 = 0.04\n    sell_custom_pump_rsi_2_3 = 42.0\n    sell_custom_pump_profit_2_4 = 0.1\n    sell_custom_pump_rsi_2_4 = 34.0\n    sell_custom_pump_profit_2_5 = 0.2\n    sell_custom_pump_rsi_2_5 = 30.0\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = 0.01\n    sell_custom_pump_rsi_3_1 = 34.0\n    sell_custom_pump_profit_3_2 = 0.02\n    sell_custom_pump_rsi_3_2 = 40.0\n    sell_custom_pump_profit_3_3 = 0.04\n    sell_custom_pump_rsi_3_3 = 42.0\n    sell_custom_pump_profit_3_4 = 0.1\n    sell_custom_pump_rsi_3_4 = 34.0\n    sell_custom_pump_profit_3_5 = 0.2\n    sell_custom_pump_rsi_3_5 = 30.0\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = 0.05\n    sell_custom_dec_profit_max_1 = 0.12\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = 0.07\n    sell_custom_dec_profit_max_2 = 0.16\n\n    # Trail 1\n    sell_trail_profit_min_1 = 0.03\n    sell_trail_profit_max_1 = 0.05\n    sell_trail_down_1 = 0.05\n    sell_trail_rsi_min_1 = 10.0\n    sell_trail_rsi_max_1 = 20.0\n\n    # Trail 2\n    sell_trail_profit_min_2 = 0.1\n    sell_trail_profit_max_2 = 0.4\n    sell_trail_down_2 = 0.03\n    sell_trail_rsi_min_2 = 20.0\n    sell_trail_rsi_max_2 = 50.0\n\n    # Trail 3\n    sell_trail_profit_min_3 = 0.06\n    sell_trail_profit_max_3 = 0.2\n    sell_trail_down_3 = 0.05\n\n    # Trail 4\n    sell_trail_profit_min_4 = 0.03\n    sell_trail_profit_max_4 = 0.06\n    sell_trail_down_4 = 0.02\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_profit_min_1 = 0.001\n    sell_custom_profit_under_profit_max_1 = 0.008\n    sell_custom_profit_under_rel_1 = 0.024\n    sell_custom_profit_under_rsi_diff_1 = 4.4\n\n    sell_custom_profit_under_profit_2 = 0.03\n    sell_custom_profit_under_rel_2 = 0.024\n    sell_custom_profit_under_rsi_diff_2 = 4.4\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = 0.002\n    sell_custom_stoploss_under_rsi_diff_1 = 10.0\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = -0.08\n    sell_custom_stoploss_long_profit_max_1 = -0.04\n    sell_custom_stoploss_long_recover_1 = 0.14\n    sell_custom_stoploss_long_rsi_diff_1 = 4.0\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = 0.06\n    sell_custom_stoploss_long_rsi_diff_2 = 40.0\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = 0.005\n    sell_custom_pump_dec_profit_max_1 = 0.05\n    sell_custom_pump_dec_profit_min_2 = 0.04\n    sell_custom_pump_dec_profit_max_2 = 0.06\n    sell_custom_pump_dec_profit_min_3 = 0.06\n    sell_custom_pump_dec_profit_max_3 = 0.09\n    sell_custom_pump_dec_profit_min_4 = 0.02\n    sell_custom_pump_dec_profit_max_4 = 0.04\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = 0.04\n    sell_custom_pump_under_profit_max_1 = 0.09\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = 0.05\n    sell_custom_pump_trail_profit_max_1 = 0.07\n    sell_custom_pump_trail_down_1 = 0.05\n    sell_custom_pump_trail_rsi_min_1 = 20.0\n    sell_custom_pump_trail_rsi_max_1 = 70.0\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = 0.01\n    sell_custom_stoploss_pump_min_1 = -0.02\n    sell_custom_stoploss_pump_max_1 = -0.01\n    sell_custom_stoploss_pump_ma_offset_1 = 0.94\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = 0.025\n    sell_custom_stoploss_pump_loss_2 = -0.05\n    sell_custom_stoploss_pump_ma_offset_2 = 0.92\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = 0.008\n    sell_custom_stoploss_pump_loss_3 = -0.12\n    sell_custom_stoploss_pump_ma_offset_3 = 0.88\n\n    # Recover\n    sell_custom_recover_profit_1 = 0.06\n    sell_custom_recover_min_loss_1 = 0.12\n\n    sell_custom_recover_profit_min_2 = 0.01\n    sell_custom_recover_profit_max_2 = 0.05\n    sell_custom_recover_min_loss_2 = 0.06\n    sell_custom_recover_rsi_2 = 46.0\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = 0.03\n    sell_custom_long_profit_max_1 = 0.04\n    sell_custom_long_duration_min_1 = 900\n\n    #############################################################\n\n    hold_trades_cache = None\n\n    @staticmethod\n    def get_hold_trades_config_file():\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            return hold_trades_config_file_absolute\n\n        if hold_trades_config_file_resolve != hold_trades_config_file_absolute:\n            looked_in = f\"'{hold_trades_config_file_resolve}' and '{hold_trades_config_file_absolute}'\"\n        else:\n            looked_in = f\"'{hold_trades_config_file_resolve}'\"\n        log.warning(\n            \"The 'hold-trades.json' file was not found. Looked in %s. HOLD support disabled.\",\n            looked_in\n        )\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = NostalgiaForInfinityNext.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n        if self.holdSupportEnabled and self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_profit_bull_11:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_11:\n                        return True, 'signal_profit_o_bull_11'\n                elif self.sell_custom_profit_bull_11 > current_profit >= self.sell_custom_profit_bull_10:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_10:\n                        return True, 'signal_profit_o_bull_10'\n                elif self.sell_custom_profit_bull_10 > current_profit >= self.sell_custom_profit_bull_9:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_9:\n                        return True, 'signal_profit_o_bull_9'\n                elif self.sell_custom_profit_bull_9 > current_profit >= self.sell_custom_profit_bull_8:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_8:\n                        return True, 'signal_profit_o_bull_8'\n                elif self.sell_custom_profit_bull_8 > current_profit >= self.sell_custom_profit_bull_7:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_7):\n                        return True, 'signal_profit_o_bull_7'\n                elif self.sell_custom_profit_bull_7 > current_profit >= self.sell_custom_profit_bull_6:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_6) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_6'\n                elif self.sell_custom_profit_bull_6 > current_profit >= self.sell_custom_profit_bull_5:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_5) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_5'\n                elif self.sell_custom_profit_bull_5 > current_profit >= self.sell_custom_profit_bull_4:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_4) and (last_candle['cmf'] < 0.0) :\n                        return True, 'signal_profit_o_bull_4'\n                elif self.sell_custom_profit_bull_4 > current_profit >= self.sell_custom_profit_bull_3:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_3) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_3'\n                elif self.sell_custom_profit_bull_3 > current_profit >= self.sell_custom_profit_bull_2:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_2) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_2'\n                elif self.sell_custom_profit_bull_2 > current_profit >= self.sell_custom_profit_bull_1:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_1) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_1'\n                elif self.sell_custom_profit_bull_1 > current_profit >= self.sell_custom_profit_bull_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bull_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bull_0'\n            else:\n                if current_profit >= self.sell_custom_profit_bear_11:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_11:\n                        return True, 'signal_profit_o_bear_11'\n                elif self.sell_custom_profit_bear_11 > current_profit >= self.sell_custom_profit_bear_10:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_10:\n                        return True, 'signal_profit_o_bear_10'\n                elif self.sell_custom_profit_bear_10 > current_profit >= self.sell_custom_profit_bear_9:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_9:\n                        return True, 'signal_profit_o_bear_9'\n                elif self.sell_custom_profit_bear_9 > current_profit >= self.sell_custom_profit_bear_8:\n                    if last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_8:\n                        return True, 'signal_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_8):\n                        return True, 'signal_profit_o_bear_8_2'\n                elif self.sell_custom_profit_bear_8 > current_profit >= self.sell_custom_profit_bear_7:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_7):\n                        return True, 'signal_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_7):\n                        return True, 'signal_profit_o_bear_7_2'\n                elif self.sell_custom_profit_bear_7 > current_profit >= self.sell_custom_profit_bear_6:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_6):\n                        return True, 'signal_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_6):\n                        return True, 'signal_profit_o_bear_6_2'\n                elif self.sell_custom_profit_bear_6 > current_profit >= self.sell_custom_profit_bear_5:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_5):\n                        return True, 'signal_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_rsi_over_bear_5):\n                        return True, 'signal_profit_o_bear_5_2'\n                elif self.sell_custom_profit_bear_5 > current_profit >= self.sell_custom_profit_bear_4:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_4):\n                        return True, 'signal_profit_o_bear_4'\n                elif self.sell_custom_profit_bear_4 > current_profit >= self.sell_custom_profit_bear_3:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_3) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_3'\n                elif self.sell_custom_profit_bear_3 > current_profit >= self.sell_custom_profit_bear_2:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_2) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_2'\n                elif self.sell_custom_profit_bear_2 > current_profit >= self.sell_custom_profit_bear_1:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_1) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_1'\n                elif self.sell_custom_profit_bear_1 > current_profit >= self.sell_custom_profit_bear_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_rsi_under_bear_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_o_bear_0'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['moderi_96']):\n                if current_profit >= self.sell_custom_under_profit_bull_11:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_11:\n                        return True, 'signal_profit_u_bull_11'\n                elif self.sell_custom_under_profit_bull_11 > current_profit >= self.sell_custom_under_profit_bull_10:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_10:\n                        return True, 'signal_profit_u_bull_10'\n                elif self.sell_custom_under_profit_bull_10 > current_profit >= self.sell_custom_under_profit_bull_9:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_9:\n                        return True, 'signal_profit_u_bull_9'\n                elif self.sell_custom_under_profit_bull_9 > current_profit >= self.sell_custom_under_profit_bull_8:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_8:\n                        return True, 'signal_profit_u_bull_8'\n                elif self.sell_custom_under_profit_bull_8 > current_profit >= self.sell_custom_under_profit_bull_7:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_7:\n                        return True, 'signal_profit_u_bull_7'\n                elif self.sell_custom_under_profit_bull_7 > current_profit >= self.sell_custom_under_profit_bull_6:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_6:\n                        return True, 'signal_profit_u_bull_6'\n                elif self.sell_custom_under_profit_bull_6 > current_profit >= self.sell_custom_under_profit_bull_5:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_5:\n                        return True, 'signal_profit_u_bull_5'\n                elif self.sell_custom_under_profit_bull_5 > current_profit >= self.sell_custom_under_profit_bull_4:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_4:\n                        return True, 'signal_profit_u_bull_4'\n                elif self.sell_custom_under_profit_bull_4 > current_profit >= self.sell_custom_under_profit_bull_3:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_3:\n                        return True, 'signal_profit_u_bull_3'\n                elif self.sell_custom_under_profit_bull_3 > current_profit >= self.sell_custom_under_profit_bull_2:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_2:\n                        return True, 'signal_profit_u_bull_2'\n                elif self.sell_custom_under_profit_bull_2 > current_profit >= self.sell_custom_under_profit_bull_1:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_1:\n                        return True, 'signal_profit_u_bull_1'\n                elif self.sell_custom_under_profit_bull_1 > current_profit >= self.sell_custom_under_profit_bull_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bull_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bull_0'\n            else:\n                if current_profit >= self.sell_custom_under_profit_bear_11:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_11:\n                        return True, 'signal_profit_u_bear_11'\n                elif self.sell_custom_under_profit_bear_11 > current_profit >= self.sell_custom_under_profit_bear_10:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_10:\n                        return True, 'signal_profit_u_bear_10'\n                elif self.sell_custom_under_profit_bear_10 > current_profit >= self.sell_custom_under_profit_bear_9:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_9:\n                        return True, 'signal_profit_u_bear_9'\n                elif self.sell_custom_under_profit_bear_9 > current_profit >= self.sell_custom_under_profit_bear_8:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_8:\n                        return True, 'signal_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_8):\n                        return True, 'signal_profit_u_bear_8_2'\n                elif self.sell_custom_under_profit_bear_8 > current_profit >= self.sell_custom_under_profit_bear_7:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_7:\n                        return True, 'signal_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_7):\n                        return True, 'signal_profit_u_bear_7_2'\n                elif self.sell_custom_under_profit_bear_7 > current_profit >= self.sell_custom_under_profit_bear_6:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_6:\n                        return True, 'signal_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_6):\n                        return True, 'signal_profit_u_bear_6_2'\n                elif self.sell_custom_under_profit_bear_6 > current_profit >= self.sell_custom_under_profit_bear_5:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_5:\n                        return True, 'signal_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] > self.sell_custom_under_rsi_over_bear_5):\n                        return True, 'signal_profit_u_bear_5_2'\n                elif self.sell_custom_under_profit_bear_5 > current_profit >= self.sell_custom_under_profit_bear_4:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_4:\n                        return True, 'signal_profit_u_bear_4'\n                elif self.sell_custom_under_profit_bear_4 > current_profit >= self.sell_custom_under_profit_bear_3:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_3:\n                        return True, 'signal_profit_u_bear_3'\n                elif self.sell_custom_under_profit_bear_3 > current_profit >= self.sell_custom_under_profit_bear_2:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_2:\n                        return True, 'signal_profit_u_bear_2'\n                elif self.sell_custom_under_profit_bear_2 > current_profit >= self.sell_custom_under_profit_bear_1:\n                    if last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_1:\n                        return True, 'signal_profit_u_bear_1'\n                elif self.sell_custom_under_profit_bear_1 > current_profit >= self.sell_custom_under_profit_bear_0:\n                    if (last_candle['rsi_14'] < self.sell_custom_under_rsi_under_bear_0) and (last_candle['cmf'] < 0.0):\n                        return True, 'signal_profit_u_bear_0'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['sell_pump_48_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_1_5:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_5:\n                    return True, 'signal_profit_p_1_5'\n            elif self.sell_custom_pump_profit_1_5 > current_profit >= self.sell_custom_pump_profit_1_4:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_4:\n                    return True, 'signal_profit_p_1_4'\n            elif self.sell_custom_pump_profit_1_4 > current_profit >= self.sell_custom_pump_profit_1_3:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_3:\n                    return True, 'signal_profit_p_1_3'\n            elif self.sell_custom_pump_profit_1_3 > current_profit >= self.sell_custom_pump_profit_1_2:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_2:\n                    return True, 'signal_profit_p_1_2'\n            elif self.sell_custom_pump_profit_1_2 > current_profit >= self.sell_custom_pump_profit_1_1:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_1_1:\n                    return True, 'signal_profit_p_1_1'\n\n        elif last_candle['sell_pump_36_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_2_5:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_5:\n                    return True, 'signal_profit_p_2_5'\n            elif self.sell_custom_pump_profit_2_5 > current_profit >= self.sell_custom_pump_profit_2_4:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_4:\n                    return True, 'signal_profit_p_2_4'\n            elif self.sell_custom_pump_profit_2_4 > current_profit >= self.sell_custom_pump_profit_2_3:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_3:\n                    return True, 'signal_profit_p_2_3'\n            elif self.sell_custom_pump_profit_2_3 > current_profit >= self.sell_custom_pump_profit_2_2:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_2:\n                    return True, 'signal_profit_p_2_2'\n            elif self.sell_custom_pump_profit_2_2 > current_profit >= self.sell_custom_pump_profit_2_1:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_2_1:\n                    return True, 'signal_profit_p_2_1'\n\n        elif last_candle['sell_pump_24_1_1h']:\n            if current_profit >= self.sell_custom_pump_profit_3_5:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_5:\n                    return True, 'signal_profit_p_3_5'\n            elif self.sell_custom_pump_profit_3_5 > current_profit >= self.sell_custom_pump_profit_3_4:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_4:\n                    return True, 'signal_profit_p_3_4'\n            elif self.sell_custom_pump_profit_3_4 > current_profit >= self.sell_custom_pump_profit_3_3:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_3:\n                    return True, 'signal_profit_p_3_3'\n            elif self.sell_custom_pump_profit_3_3 > current_profit >= self.sell_custom_pump_profit_3_2:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_2:\n                    return True, 'signal_profit_p_3_2'\n            elif self.sell_custom_pump_profit_3_2 > current_profit >= self.sell_custom_pump_profit_3_1:\n                if last_candle['rsi_14'] < self.sell_custom_pump_rsi_3_1:\n                    return True, 'signal_profit_p_3_1'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_dec_profit_max_1 > current_profit >= self.sell_custom_dec_profit_min_1) and (last_candle['sma_200_dec_20']):\n            return True, 'signal_profit_d_1'\n        elif (self.sell_custom_dec_profit_max_2 > current_profit >= self.sell_custom_dec_profit_min_2) and (last_candle['close'] < last_candle['ema_100']):\n            return True, 'signal_profit_d_2'\n\n        return False, None\n\n    def sell_trail_main(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        if (self.sell_trail_profit_max_1 > current_profit >= self.sell_trail_profit_min_1) and (self.sell_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_trail_rsi_max_1) and (max_profit > (current_profit + self.sell_trail_down_1)) and (last_candle['moderi_96'] == False):\n            return True, 'signal_profit_t_1'\n        elif (self.sell_trail_profit_max_2 > current_profit >= self.sell_trail_profit_min_2) and (self.sell_trail_rsi_min_2 < last_candle['rsi_14'] < self.sell_trail_rsi_max_2) and (max_profit > (current_profit + self.sell_trail_down_2)) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_t_2'\n        elif (self.sell_trail_profit_max_3 > current_profit >= self.sell_trail_profit_min_3) and (max_profit > (current_profit + self.sell_trail_down_3)) and (last_candle['sma_200_dec_20_1h']):\n            return True, 'signal_profit_t_3'\n        elif (self.sell_trail_profit_max_4 > current_profit >= self.sell_trail_profit_min_4) and (max_profit > (current_profit + self.sell_trail_down_4)) and (last_candle['sma_200_dec_24']) and (last_candle['cmf'] < 0.0):\n            return True, 'signal_profit_t_4'\n\n        return False, None\n\n    def sell_duration_main(self, current_profit: float, last_candle, trade: 'Trade', current_time: 'datetime') -> tuple:\n        # Pumped pair, short duration\n        if (last_candle['sell_pump_24_1_1h']) and (0.2 > current_profit >= 0.07) and (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            return True, 'signal_profit_p_s_1'\n\n        elif (self.sell_custom_long_profit_min_1 < current_profit < self.sell_custom_long_profit_max_1) and (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1) > trade.open_date_utc):\n            return True, 'signal_profit_l_1'\n\n        return False, None\n\n    def sell_under_min(self, current_profit: float, last_candle) -> tuple:\n        if ((last_candle['moderi_96']) == False):\n            # Downtrend\n            if (self.sell_custom_profit_under_profit_max_1 > current_profit >= self.sell_custom_profit_under_profit_min_1) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_1):\n                return True, 'signal_profit_u_e_1'\n        else:\n            # Uptrend\n            if (current_profit >= self.sell_custom_profit_under_profit_2) and (last_candle['close'] < last_candle['ema_200']) and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_2) and (last_candle['rsi_14'] > last_candle['rsi_14_1h'] + self.sell_custom_profit_under_rsi_diff_2):\n                return True, 'signal_profit_u_e_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, last_candle, previous_candle_1) -> tuple:\n        if (-0.12 <= current_profit < -0.08):\n            if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                return True, 'signal_stoploss_atr_1'\n        elif (-0.16 <= current_profit < -0.12):\n            if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                return True, 'signal_stoploss_atr_2'\n        elif (-0.2 <= current_profit < -0.16):\n            if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                return True, 'signal_stoploss_atr_3'\n        elif (current_profit < -0.2):\n            if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                return True, 'signal_stoploss_atr_4'\n\n        return False, None\n\n    def sell_pump_dec(self, current_profit: float, last_candle) -> tuple:\n        if (self.sell_custom_pump_dec_profit_max_1 > current_profit >= self.sell_custom_pump_dec_profit_min_1) and (last_candle['sell_pump_48_1_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_1'\n        elif (self.sell_custom_pump_dec_profit_max_2 > current_profit >= self.sell_custom_pump_dec_profit_min_2) and (last_candle['sell_pump_48_2_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_2'\n        elif (self.sell_custom_pump_dec_profit_max_3 > current_profit >= self.sell_custom_pump_dec_profit_min_3) and (last_candle['sell_pump_48_3_1h']) and (last_candle['sma_200_dec_20']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_d_3'\n        elif (self.sell_custom_pump_dec_profit_max_4 > current_profit >= self.sell_custom_pump_dec_profit_min_4) and (last_candle['sma_200_dec_20']) and (last_candle['sell_pump_24_2_1h']):\n            return True, 'signal_profit_p_d_4'\n\n        return False, None\n\n    def sell_pump_extra(self, current_profit: float, last_candle, max_profit: float) -> tuple:\n        # Pumped 48h 1, under EMA200\n        if (self.sell_custom_pump_under_profit_max_1 > current_profit >= self.sell_custom_pump_under_profit_min_1) and (last_candle['sell_pump_48_1_1h']) and (last_candle['close'] < last_candle['ema_200']):\n            return True, 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n        elif (last_candle['sell_pump_36_2_1h']) and (self.sell_custom_pump_trail_profit_max_1 > current_profit >= self.sell_custom_pump_trail_profit_min_1) and (self.sell_custom_pump_trail_rsi_min_1 < last_candle['rsi_14'] < self.sell_custom_pump_trail_rsi_max_1) and (max_profit > (current_profit + self.sell_custom_pump_trail_down_1)):\n            return True, 'signal_profit_p_t_1'\n\n        return False, None\n\n    def sell_recover(self, current_profit: float, last_candle, max_loss: float) -> tuple:\n        if (max_loss > self.sell_custom_recover_min_loss_1) and (current_profit >= self.sell_custom_recover_profit_1):\n            return True, 'signal_profit_r_1'\n\n        elif (max_loss > self.sell_custom_recover_min_loss_2) and (self.sell_custom_recover_profit_max_2 > current_profit >= self.sell_custom_recover_profit_min_2) and (last_candle['rsi_14'] < self.sell_custom_recover_rsi_2) and (last_candle['ema_25'] < last_candle['ema_50']):\n            return True, 'signal_profit_r_2'\n\n        return False, None\n\n    def sell_r_1(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if last_candle['r_480'] > -0.5:\n                return True, 'signal_profit_w_1_1'\n        elif 0.03 > current_profit >= 0.02:\n            if last_candle['r_480'] > -0.6:\n                return True, 'signal_profit_w_1_2'\n        elif 0.04 > current_profit >= 0.03:\n            if last_candle['r_480'] > -0.7:\n                return True, 'signal_profit_w_1_3'\n        elif 0.05 > current_profit >= 0.04:\n            if last_candle['r_480'] > -0.8:\n                return True, 'signal_profit_w_1_4'\n        elif 0.06 > current_profit >= 0.05:\n            if last_candle['r_480'] > -0.9:\n                return True, 'signal_profit_w_1_5'\n        elif 0.07 > current_profit >= 0.06:\n            if last_candle['r_480'] > -2.0:\n                return True, 'signal_profit_w_1_6'\n        elif 0.08 > current_profit >= 0.07:\n            if last_candle['r_480'] > -2.2:\n                return True, 'signal_profit_w_1_7'\n        elif 0.09 > current_profit >= 0.08:\n            if last_candle['r_480'] > -2.4:\n                return True, 'signal_profit_w_1_8'\n        elif 0.1 > current_profit >= 0.09:\n            if last_candle['r_480'] > -2.6:\n                return True, 'signal_profit_w_1_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'signal_profit_w_1_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'signal_profit_w_1_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -1.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'signal_profit_w_1_12'\n\n        return False, None\n\n    def sell_r_2(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -4.1) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.2) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.3) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_4'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_5'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_6'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_7'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_8'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -4.8) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_9'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -4.4) and (last_candle['rsi_14'] > 80.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_10'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -3.2) and (last_candle['rsi_14'] > 81.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_11'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 81.5) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_2_12'\n\n        return False, None\n\n    def sell_r_3(self, current_profit: float, last_candle) -> tuple:\n        if 0.02 > current_profit >= 0.012:\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0) and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_1'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_2'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_3'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['stochrsi_fastk_96'] > 99.0)  and (last_candle['stochrsi_fastd_96'] > 99.0):\n                return True, 'signal_profit_w_3_4'\n\n        return False, None\n\n    def sell_r_4(self, current_profit: float, last_candle) -> tuple:\n        if (0.02 > current_profit >= 0.012):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_1'\n        elif (0.03 > current_profit >= 0.02):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_2'\n        elif (0.04 > current_profit >= 0.03):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_3'\n        elif (0.05 > current_profit >= 0.04):\n            if (last_candle['r_480'] > -3.5) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_4'\n        elif (0.06 > current_profit >= 0.05):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_5'\n        elif (0.07 > current_profit >= 0.06):\n            if (last_candle['r_480'] > -4.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_6'\n        elif (0.08 > current_profit >= 0.07):\n            if (last_candle['r_480'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_7'\n        elif (0.09 > current_profit >= 0.08):\n            if (last_candle['r_480'] > -5.5) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_8'\n        elif (0.1 > current_profit >= 0.09):\n            if (last_candle['r_480'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_9'\n        elif (0.12 > current_profit >= 0.1):\n            if (last_candle['r_480'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_10'\n        elif (0.2 > current_profit >= 0.12):\n            if (last_candle['r_480'] > -2.5) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_11'\n        elif (current_profit >= 0.2):\n            if (last_candle['r_480'] > -2.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cti'] > 0.9):\n                return True, 'signal_profit_w_4_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (last_candle['close'] < last_candle['atr_high_thresh_q']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_q']):\n            if (0.05 > current_profit > 0.02):\n                return True, 'signal_profit_q_atr'\n            elif (current_profit < -0.08):\n                return True, 'signal_stoploss_q_atr'\n\n        if (0.04 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return True, 'signal_profit_q_pmax_bull'\n        if (0.045 > current_profit > 0.003) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return True, 'signal_profit_q_pmax_bear'\n\n        return False, None\n\n    def sell_ichi(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (0.0 < current_profit < 0.05) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 78.0):\n            return True, 'signal_profit_ichi_u'\n        elif (-0.03 < current_profit < -0.0) and (current_time - timedelta(minutes=1440) > trade.open_date_utc) and (last_candle['rsi_14'] > 75.0):\n            return True, 'signal_stoploss_ichi_u'\n\n        elif (max_loss > 0.07) and (current_profit > 0.02):\n            return True, 'signal_profit_ichi_r_0'\n        elif (max_loss > 0.06) and (current_profit > 0.03):\n            return True, 'signal_profit_ichi_r_1'\n        elif (max_loss > 0.05) and (current_profit > 0.04):\n            return True, 'signal_profit_ichi_r_2'\n        elif (max_loss > 0.04) and (current_profit > 0.05):\n            return True, 'signal_profit_ichi_r_3'\n        elif (max_loss > 0.03) and (current_profit > 0.06):\n            return True, 'signal_profit_ichi_r_4'\n\n        elif (0.05 < current_profit < 0.1) and (current_time - timedelta(minutes=720) > trade.open_date_utc):\n            return True, 'signal_profit_ichi_slow'\n\n        elif (0.07 < current_profit < 0.1) and (max_profit-current_profit > 0.025) and (max_profit > 0.1):\n            return True, 'signal_profit_ichi_t'\n\n        elif (current_profit < -0.1):\n            return True, 'signal_stoploss_ichi'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        else:\n            trade_open_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            buy_signal = dataframe.loc[dataframe['date'] < trade_open_date]\n            if not buy_signal.empty:\n                buy_signal_candle = buy_signal.iloc[-1]\n                buy_tag = buy_signal_candle['buy_tag'] if buy_signal_candle['buy_tag'] != '' else 'empty'\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Quick sell mode\n        if all(c in ['32', '33', '34', '35', '36', '37', '38', '39', '40'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Ichi Trade management\n        if all(c in ['39'] for c in buy_tags):\n            sell, signal_name = self.sell_ichi(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n            if sell and (signal_name is not None):\n                return signal_name + ' ( ' + buy_tag + ')'\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is pumped\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Trailing\n        sell, signal_name = self.sell_trail_main(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Duration based\n        sell, signal_name = self.sell_duration_main(current_profit, last_candle, trade, current_time)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Under EMA200, exit with any profit\n        sell, signal_name = self.sell_under_min(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, last_candle, previous_candle_1)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Pumped descending pairs\n        sell, signal_name = self.sell_pump_dec(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for pumped pairs\n        sell, signal_name = self.sell_pump_extra(current_profit, last_candle, max_profit)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Extra sells for trades that recovered\n        sell, signal_name = self.sell_recover(current_profit, last_candle, max_loss)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 1\n        sell, signal_name = self.sell_r_1(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 2\n        sell, signal_name = self.sell_r_2(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 3\n        sell, signal_name = self.sell_r_3(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Williams %R based sell 4, plus CTI\n        sell, signal_name = self.sell_r_4(current_profit, last_candle)\n        if (sell) and (signal_name is not None):\n            return signal_name + ' ( ' + buy_tag + ')'\n\n        # Sell signal 1\n        if self.sell_condition_1_enable and (last_candle['rsi_14'] > self.sell_rsi_bb_1) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_1_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_1_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 2\n        elif (self.sell_condition_2_enable) and (last_candle['rsi_14'] > self.sell_rsi_bb_2) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_2_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_2_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 4\n        elif self.sell_condition_4_enable and (last_candle['rsi_14'] > self.sell_dual_rsi_rsi_4) and (last_candle['rsi_14_1h'] > self.sell_dual_rsi_rsi_1h_4):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_4_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_4_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 6\n        elif self.sell_condition_6_enable and (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > self.sell_rsi_under_6):\n            if (current_profit > 0.0):\n                return 'sell_signal_6_1' + ' ( ' + buy_tag + ')'\n            elif (max_loss > 0.25):\n                return 'sell_signal_6_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 7\n        elif self.sell_condition_7_enable and (last_candle['rsi_14_1h'] > self.sell_rsi_1h_7) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_7_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_7_2_2' + ' ( ' + buy_tag + ')'\n\n        # Sell signal 8\n        elif self.sell_condition_8_enable and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * self.sell_bb_relative_8):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_1_1' + ' ( ' + buy_tag + ')'\n            else:\n                if (current_profit > 0.0):\n                    return 'sell_signal_8_2_1' + ' ( ' + buy_tag + ')'\n                elif (max_loss > 0.25):\n                    return 'sell_signal_8_2_2' + ' ( ' + buy_tag + ')'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return self.range_maxgap(dataframe, length) / adjustment\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        return dataframe['close'] - dataframe['close'].rolling(length).min()\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        return (dataframe[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(dataframe, length, pull_thresh) > self.range_height(dataframe, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe) for pair in pairs]\n        informative_pairs.append(('BTC/USDT', self.timeframe))\n        informative_pairs.append(('BTC/USDT', self.info_timeframe))\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Williams %R\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # Ichimoku\n        ichi = ichimoku(informative_1h, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        informative_1h['chikou_span'] = ichi['chikou_span']\n        informative_1h['tenkan_sen'] = ichi['tenkan_sen']\n        informative_1h['kijun_sen'] = ichi['kijun_sen']\n        informative_1h['senkou_a'] = ichi['senkou_span_a']\n        informative_1h['senkou_b'] = ichi['senkou_span_b']\n        informative_1h['leading_senkou_span_a'] = ichi['leading_senkou_span_a']\n        informative_1h['leading_senkou_span_b'] = ichi['leading_senkou_span_b']\n        informative_1h['chikou_span_greater'] = (informative_1h['chikou_span'] > informative_1h['senkou_a']).shift(30).fillna(False)\n        informative_1h.loc[:, 'cloud_top'] = informative_1h.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n\n        # EFI - Elders Force Index\n        informative_1h['efi'] = pta.efi(informative_1h[\"close\"], informative_1h[\"volume\"], length=13)\n\n        # SSL\n        ssl_down, ssl_up = SSLChannels(informative_1h, 10)\n        informative_1h['ssl_down'] = ssl_down\n        informative_1h['ssl_up'] = ssl_up\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24, self.buy_pump_pull_threshold_10_24)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36, self.buy_pump_pull_threshold_10_36)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48, self.buy_pump_pull_threshold_10_48)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24, self.buy_pump_pull_threshold_20_24)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36, self.buy_pump_pull_threshold_20_36)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48, self.buy_pump_pull_threshold_20_48)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24, self.buy_pump_pull_threshold_30_24)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36, self.buy_pump_pull_threshold_30_36)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48, self.buy_pump_pull_threshold_30_48)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24, self.buy_pump_pull_threshold_40_24)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36, self.buy_pump_pull_threshold_40_36)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48, self.buy_pump_pull_threshold_40_48)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24, self.buy_pump_pull_threshold_50_24)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36, self.buy_pump_pull_threshold_50_36)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48, self.buy_pump_pull_threshold_50_48)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24, self.buy_pump_pull_threshold_60_24)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36, self.buy_pump_pull_threshold_60_36)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48, self.buy_pump_pull_threshold_60_48)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24, self.buy_pump_pull_threshold_70_24)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36, self.buy_pump_pull_threshold_70_36)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48, self.buy_pump_pull_threshold_70_48)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24, self.buy_pump_pull_threshold_80_24)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36, self.buy_pump_pull_threshold_80_36)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48, self.buy_pump_pull_threshold_80_48)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24, self.buy_pump_pull_threshold_90_24)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36, self.buy_pump_pull_threshold_90_36)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48, self.buy_pump_pull_threshold_90_48)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24, self.buy_pump_pull_threshold_100_24)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36, self.buy_pump_pull_threshold_100_36)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48, self.buy_pump_pull_threshold_100_48)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24, self.buy_pump_pull_threshold_110_24)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36, self.buy_pump_pull_threshold_110_36)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48, self.buy_pump_pull_threshold_110_48)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24, self.buy_pump_pull_threshold_120_24)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36, self.buy_pump_pull_threshold_120_36)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48, self.buy_pump_pull_threshold_120_48)\n\n        informative_1h['safe_dump_10'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_10_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_20'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_20_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_30'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_30_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_40'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_40_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_50_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n        informative_1h['safe_dump_60'] = ((informative_1h['hl_pct_change_5'] < self.buy_dump_protection_60_5) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_20'] = ta.SMA(dataframe, timeperiod=20)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Williams %R\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # Stochastic RSI\n        stochrsi = ta.STOCHRSI(dataframe, timeperiod=96, fastk_period=3, fastd_period=3, fastd_matype=0)\n        dataframe['stochrsi_fastk_96'] = stochrsi['fastk']\n        dataframe['stochrsi_fastd_96'] = stochrsi['fastd']\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # hull\n        dataframe['hull_75'] = hull(dataframe, 75)\n\n        # zlema\n        dataframe['zlema_68'] = zlema(dataframe, 68)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_68'] = ta.SMA(dataframe, timeperiod=68)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n\n        # HLC3\n        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n        # HRSI\n        dataframe['hull'] = (2 * dataframe['hlc3'] - ta.WMA(dataframe['hlc3'], 2))\n        dataframe['hrsi'] = ta.RSI(dataframe['hull'], 2)\n\n        # ZLEMA\n        dataframe['zlema_2'] = pta.zlma(dataframe['hlc3'], length = 2)\n        dataframe['zlema_4'] = pta.zlma(dataframe['hlc3'], length = 4)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 5.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 5.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n        dataframe['atr_high_thresh_q'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1, self.buy_dip_threshold_10_2, self.buy_dip_threshold_10_3, self.buy_dip_threshold_10_4)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1, self.buy_dip_threshold_20_2, self.buy_dip_threshold_20_3, self.buy_dip_threshold_20_4)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1, self.buy_dip_threshold_30_2, self.buy_dip_threshold_30_3, self.buy_dip_threshold_30_4)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1, self.buy_dip_threshold_40_2, self.buy_dip_threshold_40_3, self.buy_dip_threshold_40_4)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1, self.buy_dip_threshold_50_2, self.buy_dip_threshold_50_3, self.buy_dip_threshold_50_4)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1, self.buy_dip_threshold_60_2, self.buy_dip_threshold_60_3, self.buy_dip_threshold_60_4)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1, self.buy_dip_threshold_70_2, self.buy_dip_threshold_70_3, self.buy_dip_threshold_70_4)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1, self.buy_dip_threshold_80_2, self.buy_dip_threshold_80_3, self.buy_dip_threshold_80_4)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1, self.buy_dip_threshold_90_2, self.buy_dip_threshold_90_3, self.buy_dip_threshold_90_4)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1, self.buy_dip_threshold_100_2, self.buy_dip_threshold_100_3, self.buy_dip_threshold_100_4)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1, self.buy_dip_threshold_110_2, self.buy_dip_threshold_110_3, self.buy_dip_threshold_110_4)\n        dataframe['safe_dips_120'] = self.safe_dips(dataframe, self.buy_dip_threshold_120_1, self.buy_dip_threshold_120_2, self.buy_dip_threshold_120_3, self.buy_dip_threshold_120_4)\n        dataframe['safe_dips_130'] = self.safe_dips(dataframe, self.buy_dip_threshold_130_1, self.buy_dip_threshold_130_2, self.buy_dip_threshold_130_3, self.buy_dip_threshold_130_4)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s  if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: \"btc_\" + s if (not s in ignore_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(\"BTC/USDT\", self.info_timeframe)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe, ffill=True)\n            drop_columns = [(s + \"_\" + self.info_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: s+\"_{}\".format(self.res_timeframe) if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [(s + \"_\" + self.res_timeframe) for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params['buy_condition_' + str(index) + '_enable']:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_dips_{global_buy_protection_params['safe_dips_type']}\"])\n                if global_buy_protection_params[\"safe_pump\"]:\n                    item_buy_protection_list.append(dataframe[f\"safe_pump_{global_buy_protection_params['safe_pump_period']}_{global_buy_protection_params['safe_pump_type']}_1h\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_1)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_1)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_1)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_1)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_1)\n\n                # Condition #2\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14_1h'] - self.buy_rsi_1h_diff_2)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_2)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_2))\n\n                # Condition #3\n                elif index == 3:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_3)\n\n                # Condition #4\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4 * dataframe['bb20_2_low'])\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_4)\n\n                # Condition #5\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_5)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_5))\n\n                # Condition #6\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6))\n\n                # Condition #7\n                elif index == 7:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_7)\n\n                # Condition #8\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_8)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_8))\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_8)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_8))\n\n                # Condition #9\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_9)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_9)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_9)\n\n                # Condition #10\n                elif index == 10:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_10)\n\n                # Condition #11\n                elif index == 11:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_11)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_max_11)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_11)\n                    item_buy_logic.append(dataframe['mfi'] < self.buy_mfi_11)\n\n                # Condition #12\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_12)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_12)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_12)\n\n                # Condition #13\n                elif index == 13:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_13)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_13)\n\n                # Condition #14\n                elif index == 14:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_14)\n\n                # Condition #15\n                elif index == 15:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_15)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15)\n\n                # Condition #16\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_16)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_16)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_16)\n\n                # Condition #17\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_ewo_17)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_17)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_17))\n\n                # Condition #18\n                elif index == 18:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n                    item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_18)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18))\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_18))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_18)\n\n                # Condition #19\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_rsi_1h_min_19)\n                    item_buy_logic.append(dataframe['chop'] < self.buy_chop_max_19)\n                    item_buy_logic.append(dataframe['moderi_32'] == True)\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['moderi_96'] == True)\n\n                # Condition #20\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_20)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_20)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_20)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_20))\n\n                # Condition #21\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_21)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_rsi_1h_21)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_cti_21)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_volume_21))\n\n                # Condition #22\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22) > dataframe['volume'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_ewo_22)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_rsi_22)\n\n                # Condition #23\n                elif index == 23:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_23_bb_offset))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_23_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_23_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_23_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_23_r_1h)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_23_rsi)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < self.buy_23_rsi_1h)\n\n                # Condition #24\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_24_rsi_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > self.buy_24_rsi_1h_min)\n\n                # Condition #25\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_25_rsi_4)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_20'] * self.buy_25_ma_offset))\n                    item_buy_logic.append(dataframe['open'] > (dataframe['sma_20'] * self.buy_25_ma_offset))\n                    item_buy_logic.append(\n                        (dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h']) |\n                        (dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])\n                    )\n                    item_buy_logic.append(dataframe['cti'] < self.buy_25_cti)\n\n                # Condition #26\n                elif index == 26:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['zema_61'] * self.buy_26_zema_low_offset))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_26_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_26_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_26_r_1h)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_26_volume))\n\n                # Condition #27\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -self.buy_27_wr_max)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -self.buy_27_wr_1h_max)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < self.buy_27_rsi_max)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_27_cti)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_27_volume))\n\n                # Condition #28\n                elif index == 28:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_28_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_28_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_28_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_28_cti)\n\n                # Condition #29\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == True)\n                    item_buy_logic.append(dataframe['close'] < dataframe['hull_75'] * self.buy_29_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_29_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_29_cti)\n\n                # Condition #30\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_30_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_30_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_30_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_30_cti)\n\n                # Condition #31\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_64'] == False)\n                    item_buy_logic.append(dataframe['close'] < dataframe['zlema_68'] * self.buy_31_ma_offset )\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_31_ewo)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_31_wr)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_31_cti)\n\n                # Condition #32 - Quick mode buy\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_32'])\n                    item_buy_logic.append(dataframe['moderi_64'])\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_32_cti)\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_4'] < self.buy_32_rsi)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_32_dip)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['sma_15'] * self.buy_32_ma_offset))\n                    item_buy_logic.append(\n                        ((dataframe['open'] < dataframe['ema_20_1h']) & (dataframe['low'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open'] > dataframe['ema_20_1h']) & (dataframe['low'] > dataframe['ema_20_1h'])))\n\n                # Condition #33 - Quick mode buy\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['moderi_96'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_33_cti)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_13'] * self.buy_33_ma_offset))\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_33_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_33_rsi)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_33_volume))\n\n                # Condition #34 - Quick mode buy\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['cti'] < self.buy_34_cti)\n                    item_buy_logic.append((dataframe['open'] - dataframe['close']) / dataframe['close'] < self.buy_34_dip)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * self.buy_34_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_34_ewo)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * self.buy_34_volume))\n\n                # Condition #35 - PMAX0 buy\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_35_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_35_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_35_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_35_cti)\n\n                # Condition #36 - PMAX1 buy\n                elif index == 36:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] <= dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_36_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_36_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_36_cti)\n\n                # Condition #37 - PMAX2 buy\n                elif index == 37:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_37_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] > self.buy_37_ewo)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_37_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_37_cti)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #38 - PMAX3 buy\n                elif index == 38:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_38_ma_offset)\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_38_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_38_cti)\n\n                # Condition #39 - Ichimoku\n                elif index == 39:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['tenkan_sen_1h'] > dataframe['kijun_sen_1h'])\n                    item_buy_logic.append(dataframe['close'] > dataframe['cloud_top_1h'])\n                    item_buy_logic.append(dataframe['leading_senkou_span_a_1h'] > dataframe['leading_senkou_span_b_1h'])\n                    item_buy_logic.append(dataframe['chikou_span_greater_1h'])\n                    item_buy_logic.append(dataframe['efi_1h'] > 0)\n                    item_buy_logic.append(dataframe['ssl_up_1h'] > dataframe['ssl_down_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['ssl_up_1h'])\n                    item_buy_logic.append(dataframe['cti'] < self.buy_39_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_39_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_39_r_1h)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > dataframe['rsi_14_1h'].shift(12))\n                    # Start of trend\n                    item_buy_logic.append(\n                        (dataframe['leading_senkou_span_a_1h'].shift(12) < dataframe['leading_senkou_span_b_1h'].shift(12)) |\n                        (dataframe['ssl_up_1h'].shift(12) < dataframe['ssl_down_1h'].shift(12))\n                    )\n\n                # Condition #40 - ZLEMA X buy\n                elif index == 40:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['zlema_2'], dataframe['zlema_4']))\n                    item_buy_logic.append(dataframe['hrsi'] < self.buy_40_hrsi)\n                    item_buy_logic.append(dataframe['cci'] < self.buy_40_cci)\n                    item_buy_logic.append(dataframe['rsi_14'] < self.buy_40_rsi)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_40_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_40_r)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_40_r_1h)\n\n                # Condition #41\n                elif index == 41:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_41_cti_1h)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_41_r_1h)\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * self.buy_41_ma_offset)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_41_cti)\n                    item_buy_logic.append(dataframe['r_480'] < self.buy_41_r)\n\n                # Condition #42\n                elif index == 42:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_42_cti_1h)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_42_r_1h)\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_42_ema_open_mult))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_42_bb_offset))\n\n                # Condition #43\n                elif index == 43:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['cti_1h'] < self.buy_43_cti_1h)\n                    item_buy_logic.append(dataframe['r_480_1h'] > self.buy_43_r_1h)\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_43_bb40_bbdelta_close))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_43_bb40_closedelta_close))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_43_bb40_tail_bbdelta))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < self.buy_43_cti)\n                    item_buy_logic.append(dataframe['r_480'] > self.buy_43_r)\n\n                # Condition #44\n                elif index == 44:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * self.buy_44_ma_offset))\n                    item_buy_logic.append(dataframe['ewo'] < self.buy_44_ewo)\n                    item_buy_logic.append(dataframe['cti'] < self.buy_44_cti)\n                    item_buy_logic.append(dataframe['r_480_1h'] < self.buy_44_r_1h)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += str(index) + ' '\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        if self.holdSupportEnabled and self.config['runmode'].value in ('live', 'dry_run'):\n            self.load_hold_trades_config()\n\n            if not self.hold_trades_cache:\n                # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n                return True\n\n            if not self.hold_trades_cache.data:\n                # We have no pairs we want to hold until profit, sell\n                return True\n\n            if trade.id not in self.hold_trades_cache.data:\n                # This pair is not on the list to hold until profit, sell\n                return True\n\n            trade_profit_ratio = self.hold_trades_cache.data[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = \"{}%\".format(trade_profit_ratio * 100)\n                formatted_current_profit_ratio = \"{}%\".format(current_profit_ratio * 100)\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return True\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                return True\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            return False\n        else:\n            return True\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=\"{0} Williams %R\".format(period),\n        )\n\n    return WR * -100\n\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\n\n# zlema\ndef zlema(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        ema_data = dataframe  + (dataframe  - dataframe.shift(lag))\n    else:\n        ema_data = dataframe['close']  + (dataframe['close']  - dataframe['close'] .shift(lag))\n    return ta.EMA(ema_data, timeperiod = timeperiod)\n\n\n# zlhull\ndef zlhull(dataframe, timeperiod):\n    lag =  int(math.floor((timeperiod - 1) / 2) )\n    if isinstance(dataframe, Series):\n        wma_data = dataframe + (dataframe  - dataframe.shift(lag))\n    else:\n        wma_data = dataframe['close'] + (dataframe['close']  - dataframe['close'] .shift(lag))\n\n    return  ta.WMA(\n        2 * ta.WMA(wma_data, int(math.floor(timeperiod/2))) - ta.WMA(wma_data, timeperiod), int(round(np.sqrt(timeperiod)))\n    )\n\n\n# hull\ndef hull(dataframe, timeperiod):\n    if isinstance(dataframe, Series):\n        return  ta.WMA(\n            2 * ta.WMA(dataframe, int(math.floor(timeperiod/2))) - ta.WMA(dataframe, timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n    else:\n        return  ta.WMA(\n            2 * ta.WMA(dataframe['close'], int(math.floor(timeperiod/2))) - ta.WMA(dataframe['close'], timeperiod), int(round(np.sqrt(timeperiod)))\n        )\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = 'MA_' + str(MAtype) + '_' + str(length)\n    atr = 'ATR_' + str(period)\n    pm = 'pm_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n    pmx = 'pmX_' + str(period) + '_' + str(multiplier) + '_' + str(length) + '_' + str(MAtype)\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n\ndef calc_streaks(series: Series):\n    # logic tables\n    geq = series >= series.shift(1)  # True if rising\n    eq = series == series.shift(1)  # True if equal\n    logic_table = concat([geq, eq], axis=1)\n\n    streaks = [0]  # holds the streak duration, starts with 0\n\n    for row in logic_table.iloc[1:].itertuples():  # iterate through logic table\n        if row[2]:  # same value as before\n            streaks.append(0)\n            continue\n        last_value = streaks[-1]\n        if row[1]:  # higher value than before\n            streaks.append(last_value + 1 if last_value >=\n                                             0 else 1)  # increase or reset to +1\n        else:  # lower value than before\n            streaks.append(last_value - 1 if last_value <\n                                             0 else -1)  # decrease or reset to -1\n\n    return streaks\n\n# SSL Channels\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    ATR = ta.ATR(dataframe, timeperiod=14)\n    smaHigh = dataframe['high'].rolling(length).mean() + ATR\n    smaLow = dataframe['low'].rolling(length).mean() - ATR\n    hlv = Series(np.where(dataframe['close'] > smaHigh, 1, np.where(dataframe['close'] < smaLow, -1, np.NAN)))\n    hlv = hlv.ffill()\n    sslDown = np.where(hlv < 0, smaHigh, smaLow)\n    sslUp = np.where(hlv < 0, smaLow, smaHigh)\n    return sslDown, sslUp\n\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = json_load(rfh)\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        file_dump_json(self.path, self.data, is_zip=False, log=True)\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n\n        if not trade_ids:\n            return {}\n\n        rdata = {}\n        open_trades = {\n            trade.id: trade for trade in Trade.get_trades_proxy(is_open=True)\n        }\n\n        if isinstance(trade_ids, dict):\n            # New syntax\n            for trade_id, profit_ratio in trade_ids.items():\n                try:\n                    trade_id = int(trade_id)\n                except ValueError:\n                    log.error(\n                        \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                        trade_id, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                        profit_ratio,\n                        trade_id,\n                        self.path\n                    )\n                if trade_id in open_trades:\n                    formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_id],\n                        formatted_profit_ratio\n                    )\n                    rdata[trade_id] = profit_ratio\n                else:\n                    log.warning(\n                        \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                        trade_id,\n                        self.path\n                    )\n        else:\n            # Initial Syntax\n            profit_ratio = data.get(\"profit_ratio\")\n            if profit_ratio:\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                        profit_ratio,\n                        self.path\n                    )\n            else:\n                profit_ratio = 0.005\n            formatted_profit_ratio = \"{}%\".format(profit_ratio * 100)\n            for trade_id in trade_ids:\n                if not isinstance(trade_id, int):\n                    log.error(\n                        \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                        trade_id, self.path\n                    )\n                    continue\n                if trade_id in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_id],\n                        formatted_profit_ratio\n                    )\n                    rdata[trade_id] = profit_ratio\n                else:\n                    log.warning(\n                        \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                        trade_id,\n                        self.path\n                    )\n\n        return rdata\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV7_SMA/NostalgiaForInfinityV7_SMA.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV7_SMA(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n        \n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        \n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityV7_SMAv2/NostalgiaForInfinityV7_SMAv2.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV7_SMAv2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n        \n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        \n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')"
  },
  {
    "path": "strategies/NostalgiaForInfinityV7_SMAv2_1/NostalgiaForInfinityV7_SMAv2_1.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityV7_SMAv2_1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n\n        informative_1h['ema_fast'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_slow'] = ta.EMA(informative_1h, timeperiod=25)\n\n        informative_1h['uptrend'] = (\n            (informative_1h['ema_fast'] > informative_1h['ema_slow'])\n        ).astype('int')\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=30)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n\n        dataframe['ma_lower'] = ta.SMA(dataframe, timeperiod=15) * 0.953\n\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=30)\n        dataframe['rsi_slow_descending'] = (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift()).astype('int')\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=45)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 20)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=100)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n        \n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(\n                           \n                (\n                    (dataframe['rsi_slow_descending'].rolling(1).sum() == 1)\n                    &\n                    (dataframe['rsi_fast'] < 35)\n                    &\n                    (dataframe['uptrend_1h'] > 0)\n                    &\n                    (dataframe['close'] < dataframe['ma_lower'])\n                    &\n                    (dataframe['open'] > dataframe['ma_lower'])\n                    &\n                    (dataframe['volume'] > 0)\n                    &\n                    (\n                    (dataframe['open']<dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()<dataframe['ema_fast_1h'])\n                    |\n                    (dataframe['open']>dataframe['ema_fast_1h'])\n                    &\n                    (dataframe['low'].abs()>dataframe['ema_fast_1h'])\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['hma_fast_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['hma_fast_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['hma_fast_1h'])\n                    )\n                    #&\n                    #(\n                    #(dataframe['open']<dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()<dataframe['ema_slow_1h'])\n                    #|\n                    #(dataframe['open']>dataframe['ema_slow_1h'])\n                    #&\n                    #(dataframe['low'].abs()>dataframe['ema_slow_1h'])\n                    #)\n                    #)\n                )\n        )\n        \n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityX/NostalgiaForInfinityX.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n###########################################################################################################\n##                NostalgiaForInfinityX by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"hold-trades.json\" file add something like:                                                         ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (USDT, ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                         ##\n##   TRC20/TRON (USDT, TRON, ...): TTAa9MX6zMLXNgWMhg7tkNormVHWCoq8Xk                                    ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=EAZC47FM (5% discount on trading fees)         ##\n##  Kucoin: https://www.kucoin.com/r/QBSSSPYV (5% discount on trading fees)                              ##\n##  Gate.io: https://www.gate.io/signup/8054544                                                          ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityX(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe_1d = '1d'\n    info_timeframe_1h = '1h'\n    info_timeframe_15m = '15m'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": False,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_102_enable\": True,\n        \"buy_condition_103_enable\": True,\n        \"buy_condition_104_enable\": True,\n        \"buy_condition_105_enable\": True,\n        \"buy_condition_106_enable\": True,\n        \"buy_condition_107_enable\": False,\n        \"buy_condition_108_enable\": True,\n        \"buy_condition_702_enable\": True,\n        \"buy_condition_201_enable\": True,\n        \"buy_condition_202_enable\": True,\n        \"buy_condition_203_enable\": True,\n        \"buy_condition_204_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        \"buy_condition_44_enable\": True,\n        \"buy_condition_45_enable\": True,\n        \"buy_condition_46_enable\": True,\n        \"buy_condition_47_enable\": True,\n        \"buy_condition_48_enable\": True,\n        \"buy_condition_49_enable\": True,\n        \"buy_condition_50_enable\": True,\n        \"buy_condition_51_enable\": True,\n        \"buy_condition_52_enable\": True,\n        \"buy_condition_53_enable\": True,\n        \"buy_condition_54_enable\": True,\n        \"buy_condition_55_enable\": True,\n        \"buy_condition_56_enable\": True,\n        \"buy_condition_57_enable\": True,\n        \"buy_condition_58_enable\": True,\n        \"buy_condition_59_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.36,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        3: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.34,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup2\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.97,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.012,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.54,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.7,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.95,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.68,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02, # 0.03 0.015\n            \"safe_dips_threshold_2\"     : 0.09, # 0.08\n            \"safe_dips_threshold_12\"    : 0.3, # 0.48\n            \"safe_dips_threshold_144\"   : 0.9, # 0.9\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None, # 0.7\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"pivot\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.4\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        9: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.88,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.06,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.25,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        18: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.65,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        19: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.026,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        24: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.029,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        30: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.07\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        102: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        103: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        104: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        105: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        106: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        107: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        108: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        702: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        201: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"20\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.22,\n            \"safe_dips_threshold_12\"    : 0.38,\n            \"safe_dips_threshold_144\"   : 0.66,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        202: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"100\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        203: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"50\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        204: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"100\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"50\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"100\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.3,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        36: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.021,\n            \"safe_dips_threshold_2\"     : 0.12,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.2\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 2.0,\n            \"safe_pump_36h_threshold\"   : 2.0,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.55,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.25\n        },\n        40: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.55,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.7,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        41: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.018,\n            \"safe_dips_threshold_2\"     : 0.08,\n            \"safe_dips_threshold_12\"    : 0.2,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 3.2,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        42: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.022,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.4,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.5, # 0.5\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        43: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : 0.9,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.99,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        44: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        45: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : 0.8,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.35,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        46: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.016,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.85,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        47: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        48: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.3,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        49: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.6,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        50: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.56,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        51: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : 0.58,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        52: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.7,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.95,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        53: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        54: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.95,\n            \"safe_pump_48h_threshold\"   : 1.05,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        55: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 1.15,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        56: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        57: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        58: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        59: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.75,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         }\n    }\n\n    # Sell\n    sell_condition_1_enable = True\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def is_support(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] > row_data[row+1])\n            else:\n                conditions.append(row_data[row] < row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def is_resistance(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] < row_data[row+1])\n            else:\n                conditions.append(row_data[row] > row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_1_2_2'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 80.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_2_2_2'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 83.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_3_2_2'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_4_2_2'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_signal_6_1'\n            # elif (current_profit < -0.05) and (max_loss > 0.12):\n            #     return True, 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_7_2_2'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_8_2_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (\n                (last_candle['sma_200_dec_20'])\n                and (last_candle['ema_vwma_osc_32'] < -0.0)\n                and (last_candle['ema_vwma_osc_64'] < -0.0)\n                and (last_candle['ema_vwma_osc_96'] < -0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (current_time - timedelta(minutes=2880) > trade.open_date_utc)\n        ):\n            if (-0.12 <= current_profit < -0.0):\n                if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                    return True, 'sell_stoploss_atr_1'\n            elif (-0.16 <= current_profit < -0.12):\n                if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                    return True, 'sell_stoploss_atr_2'\n            elif (-0.2 <= current_profit < -0.16):\n                if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                    return True, 'sell_stoploss_atr_3'\n            elif (current_profit < -0.2):\n                if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                    return True, 'sell_stoploss_atr_4'\n\n        return False, None\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96']):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_12_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_12_3'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_12_4'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_12_5'\n                    elif (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_11_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_11_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_11_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_11_6'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_10_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_10_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_10_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_10_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_10_6'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_9_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_9_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_9_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_9_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_8_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_8_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_7_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_7_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_6_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_6_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_5_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_5_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_4_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_4_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_4_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_3_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_3_4'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_3_5'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_2_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_2_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_1_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_1_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_1_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_1_6'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_12_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_12_3'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_12_4'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_12_5'\n                    elif (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_11_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_11_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_11_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_11_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_10_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_10_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_10_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_10_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_9_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_9_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_9_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_8_4'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_8_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_7_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_7_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_6_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_6_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_5_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_5_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_4_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_4_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_3_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_3_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_3_5'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_2_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_2_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_1_2'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_1_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_1_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_1_6'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_12_2'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_12_3'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_12_4'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_12_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_11_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_11_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_11_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_10_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_10_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_10_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_10_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_9_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_9_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_9_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_9_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_8_2'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_8_4'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_8_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_7_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_7_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_u_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_6_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_6_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_5_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_5_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_4_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_4_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_4_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_3_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_3_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_3_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_3_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_2_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_2_5'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_1_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_1_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_1_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_1_6'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_u_bear_12_1'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_12_2'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_12_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_12_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_12_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_u_bear_11_1'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_11_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_11_3'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_11_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_11_5'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_10_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_10_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_10_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_10_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_10_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_9_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_9_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_9_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_8_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_8_4'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_8_5'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_7_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_7_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_7_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_7_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_6_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_6_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_6_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_5_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_5_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_5_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_4_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_4_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_4_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_3_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_3_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_3_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_2_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_2_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_2_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_1_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_1_4'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_1_5'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_1_6'\n\n        return False, None\n\n    def sell_r(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.01 > current_profit > 0.001:\n            if (last_candle['r_96'] < -90.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.2):\n                return True, 'sell_profit_w_0_1'\n            elif (last_candle['rsi_14'] < 30.0) and (last_candle['r_96'] < -90.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.3) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_0_2'\n            elif (last_candle['rsi_14'] < 28.0) and (last_candle['cmf'] < -0.5) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_0_3'\n            elif (last_candle['r_480'] < -80.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'sell_profit_w_0_4'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -90.0):\n                return True, 'sell_profit_w_0_5'\n        elif 0.02 > current_profit >= 0.01:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_1_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_1_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_1_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_1_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_1_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_1_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_1_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_1_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_1_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_1_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_1_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_1_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_1_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_1_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_1_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_1_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_1_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_1_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_1_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_1_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_48'\n            elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_1_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_1_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_1_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_1_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_1_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_1_58'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_2_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_2_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_2_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 350.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_2_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_2_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_2_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_2_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_2_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_2_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_2_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_2_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_2_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_2_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_2_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_2_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_2_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_2_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_2_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_2_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_2_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_2_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_48'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_2_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_2_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_2_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_2_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_2_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_2_58'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -0.6):\n                return True, 'sell_profit_w_3_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_3_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_3_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_3_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_3_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_3_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_3_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_3_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_3_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_3_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_3_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_3_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_3_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_3_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_3_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_3_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_3_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_3_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_3_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_48'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_3_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_3_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_3_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_3_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_3_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_3_58'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -0.7):\n                return True, 'sell_profit_w_4_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_4_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_4_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_4_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_4_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_4_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_4_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_4_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_4_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_4_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_4_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_4_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_4_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_4_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_4_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_4_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_4_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_4_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_4_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_48'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_4_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_4_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_4_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_4_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_4_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_4_58'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -0.8):\n                return True, 'sell_profit_w_5_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 54.0):\n                return True, 'sell_profit_w_5_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_5_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_6'\n            elif (last_candle['rsi_14'] < 49.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 64.0):\n                return True, 'sell_profit_w_5_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_5_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_5_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_5_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_5_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_5_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_5_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_5_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 200.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_5_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_5_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_5_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_5_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_5_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_5_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_5_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_5_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_48'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_5_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_5_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_5_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_5_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_5_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_5_58'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -0.9):\n                return True, 'sell_profit_w_6_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_6_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_6_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_6_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_6_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_6_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0):\n                return True, 'sell_profit_w_6_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_6_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_6_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_6_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_6_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_6_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_6_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_6_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_6_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_6_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_6_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_6_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_6_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_48'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_6_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_6_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_6_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_6_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_6_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_6_58'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_7_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_7_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_7_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_7_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_7_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_7_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_7_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_7_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_7_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_7_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_7_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_7_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_7_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_7_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_7_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_7_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_7_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_7_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_7_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_48'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_7_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_7_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_7_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_7_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_7_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_7_58'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_8_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_8_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_8_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_8_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_8_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_8_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_8_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_8_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_8_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_8_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_8_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_8_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_8_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_8_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_8_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_8_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_8_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_8_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_48'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_8_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_8_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_8_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_8_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_8_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_8_58'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_9_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_9_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_9_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_9_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_9_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_9_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_9_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_9_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_9_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_9_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_9_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_9_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_9_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_9_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_9_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_9_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_9_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_9_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_9_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_48'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_9_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_9_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_9_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_9_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_9_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_9_58'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_10_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_10_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_10_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_6'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_10_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_10_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 240.0):\n                return True, 'sell_profit_w_10_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_10_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_10_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_10_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_10_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_10_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_10_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 300.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_10_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_10_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_10_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_10_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_10_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_10_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_10_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_10_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_48'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_10_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_10_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_10_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_10_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_10_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_10_58'\n        elif 0.2 > current_profit >= 0.12:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_11_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_11_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_11_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_6'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_11_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_11_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_11_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_11_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_11_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_11_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_11_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_11_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_11_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_11_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_11_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_11_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_11_37'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_11_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_11_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_11_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_11_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_11_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_48'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_11_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_11_51'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_11_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_11_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_11_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_11_58'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_12_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_w_12_3'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_12_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_6'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_12_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_12_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_12_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_12_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_12_14'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_12_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_12_17'\n            elif (last_candle['r_14'] > -7.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['close'] < last_candle['ema_200']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_12_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_12_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_12_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 340.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_32'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -1.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_12_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_12_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_12_37'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_12_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_12_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_12_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_12_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_12_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_48'\n            elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_12_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_12_51'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_12_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_12_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_12_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_12_58'\n\n        return False, None\n\n    def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 32.0):\n                return True, 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_t_0_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_0_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_5'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_6'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['sma_200_dec_20_15m']):\n                return True, 'sell_profit_t_0_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 49.0):\n                return True, 'sell_profit_t_0_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_10'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_6'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_1_8'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_1_11'\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_1_12'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_13'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_14'\n        elif 0.03 > current_profit >= 0.02:\n            if (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_1'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_2'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_2_4'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_6'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_7'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_2_8'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_2_9'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_2_10'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_2_12'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_13'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_14'\n        elif 0.04 > current_profit >= 0.03:\n            if (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_3_1'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_2'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_3'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_3_4'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_6'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_3_8'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_3_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_3_10'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_3_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_3_12'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_13'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_14'\n        elif 0.05 > current_profit >= 0.04:\n            if (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_4_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_3'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_4_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_6'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_7'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_4_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_4_9'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_4_10'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_4_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_4_12'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_13'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_14'\n        elif 0.06 > current_profit >= 0.05:\n            if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_5_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_2'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_3'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_5_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_7'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_5_8'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_5_9'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_5_10'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0):\n                return True, 'sell_profit_t_5_11'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_5_12'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_13'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_14'\n        elif 0.07 > current_profit >= 0.06:\n            if (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_t_6_1'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_2'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_3'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_6_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_7'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_6_8'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_6_9'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_6_10'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_6_11'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_6_12'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_13'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_14'\n        elif 0.08 > current_profit >= 0.07:\n            if (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_7_1'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_2'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_3'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_7_4'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_7'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_7_8'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_7_9'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_7_10'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_7_11'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_7_12'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_13'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_14'\n        elif 0.09 > current_profit >= 0.08:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_8_1'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_8_4'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_7'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_8_8'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_8_9'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_8_10'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_8_11'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_8_12'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_13'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_14'\n        elif 0.1 > current_profit >= 0.09:\n            if (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_9_1'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_2'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_3'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_9_4'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_7'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_9_8'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_9_9'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_9_10'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_9_11'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_9_12'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_13'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_14'\n        elif 0.12 > current_profit >= 0.1:\n            if (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_10_1'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_3'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_10_4'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 41.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_10_8'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_10_9'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_10_10'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_10_11'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_10_12'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_13'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_14'\n        elif 0.2 > current_profit >= 0.12:\n            if (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_11_1'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_2'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_3'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_11_4'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_7'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_11_8'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_11_9'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_11_10'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_11_11'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_11_12'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_13'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_14'\n        elif current_profit >= 0.2:\n            if (max_profit > (current_profit + 0.7)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_12_1'\n            elif (max_profit > (current_profit + 0.9)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_3'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_12_4'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_12_8'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_12_9'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_12_10'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 33.0):\n                return True, 'sell_profit_t_12_11'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_12_12'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_13'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_14'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['close'] > last_candle['ema_200']):\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):\n                    return True, 'sell_profit_d_o_1_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_4'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_1_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_7'\n                elif (last_candle['rsi_14'] > 70.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_1_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_1_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_1_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_1_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_1_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_1_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_1_14'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_1_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_1_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_1_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_1_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_19'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_1_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_1_21'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_1_22'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_2_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_2_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_2_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_2_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_2_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_2_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_2_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_2_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_2_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_2_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_2_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_2_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_2_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_2_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_2_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_2_22'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_3_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_3_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_3_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_3_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_3_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_3_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_3_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_3_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_3_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_3_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_3_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_3_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_3_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_3_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_3_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_3_22'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):\n                    return True, 'sell_profit_d_o_4_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_4_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_4_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_4_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_4_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_4_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_4_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_4_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_4_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_4_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_4_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_4_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_4_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_4_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_4_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_4_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_4_22'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_5_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_o_5_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_5_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_6'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_5_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_5_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_5_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_5_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_5_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_5_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_5_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_5_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_5_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_5_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_5_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_19'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_5_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_5_21'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_5_22'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_6_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_6_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_6_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_6_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_6_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_6_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_6_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_6_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_6_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_6_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_6_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_6_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_6_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_6_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_6_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_6_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_6_22'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_7_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_o_7_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_7_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_7_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_7_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_7_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_7_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_7_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_7_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_7_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_7_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_7_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_7_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_7_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_7_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_7_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_7_22'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):\n                    return True, 'sell_profit_d_o_8_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_2'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_8_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_8_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_8_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_8_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_8_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_8_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_8_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_8_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_8_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_8_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_8_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_8_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_8_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_8_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_8_22'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_9_1'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_2'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_4'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_9_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_7'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_9_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_9_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_9_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_9_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_9_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_9_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_9_14'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_9_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_9_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_9_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_9_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_19'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_9_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_9_21'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_9_22'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_10_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_o_10_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_4'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_10_5'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_6'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_7'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_10_8'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_10_9'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_10_10'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_10_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_10_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_10_13'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_10_14'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_10_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_10_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_10_17'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_10_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_19'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_10_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_10_21'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_10_22'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_11_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):\n                    return True, 'sell_profit_d_o_11_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_4'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_11_5'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_6'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_7'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_11_8'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_11_9'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_11_10'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_11_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_11_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_11_13'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_11_14'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_11_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_11_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_11_17'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_11_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_19'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_11_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_11_21'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_11_22'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_12_1'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_12_2'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_4'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_12_5'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_6'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_7'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_12_8'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_12_9'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_12_10'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_12_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_12_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_12_13'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_12_14'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_12_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_12_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_12_17'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_12_18'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_19'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_12_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_12_21'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_12_22'\n        else:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_1_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_1_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_1_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_7'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_1_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_1_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_1_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_1_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_1_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_1_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_1_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_1_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_1_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_1_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_1_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_1_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_1_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_1_22'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_2_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_2_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_2_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_2_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_2_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_2_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_2_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_2_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_2_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_2_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_2_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_2_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_2_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_2_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_2_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_2_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_2_22'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_3_1'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_4'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_3_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_7'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_3_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_3_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_3_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_3_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_3_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_3_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_3_14'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_3_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_3_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_3_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_3_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_3_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_3_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_3_22'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_4_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_4_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_4'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_4_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_7'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_4_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_4_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_4_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_4_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_4_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_4_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_4_14'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_4_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_4_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_4_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_4_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_19'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_4_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_4_21'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_4_22'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_5_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                    return True, 'sell_profit_d_u_5_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_3'\n                elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_4'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_5_5'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_7'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_5_8'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_5_9'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_5_10'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_5_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 55.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_5_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_5_13'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_5_14'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_5_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_5_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_5_17'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_5_18'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_19'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_5_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_5_21'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_5_22'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_6_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):\n                    return True, 'sell_profit_d_u_6_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_4'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_6_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_7'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_6_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_6_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_6_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_6_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_6_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_6_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_6_14'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_6_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_6_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_6_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_6_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_19'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_6_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_6_21'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_6_22'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_7_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_7_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_4'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_7_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_7'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_7_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_7_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_7_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_7_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_7_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_7_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_7_14'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_7_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_7_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_7_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_7_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_7_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_7_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_7_22'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_8_1'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_8_2'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_8_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_8_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_8_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_8_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_8_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_8_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_8_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_8_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_8_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_8_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_8_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_8_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_8_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_8_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_8_22'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_9_1'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_9_2'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_9_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_6'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_9_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_9_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_9_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_9_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_9_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_9_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_9_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_9_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_9_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_9_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_9_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_9_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_9_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_9_22'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_10_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_10_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_6'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_10_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_10_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_10_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_10_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_10_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_10_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_10_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_10_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_10_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_10_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_10_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_19'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_10_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_10_21'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_10_22'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_11_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_11_5'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_6'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_11_8'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_11_9'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_11_10'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_11_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_11_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_11_13'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_11_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_11_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_11_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_11_17'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_11_18'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_19'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_11_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_11_21'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_11_22'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_12_1'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_u_12_2'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_4'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_12_5'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_6'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_7'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_12_8'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_12_9'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_12_10'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_12_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_12_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_12_13'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_12_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_12_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_12_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_12_17'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_12_18'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_19'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_12_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_12_21'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_12_22'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 31.0):\n                        return True, 'sell_profit_p_bull_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bull_48_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bear_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bear_48_1_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.8):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_2_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.5):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bear_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.72):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bull_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bull_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_36_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bear_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_36_1_1_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.68):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bull_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_p_bull_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bull_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_24_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bear_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bear_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_24_1_1_1'\n\n        return False, None\n\n    def sell_pump_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.95):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.005)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_1'\n            elif (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.01)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_36_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\n            if (\n                    (-0.05 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n                    and (last_candle['rsi_14'] < 40.0)\n            ):\n                return True, 'sell_stoploss_p_36_2_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit < 0.01)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_24_1_1'\n\n\n        return False, None\n\n    def sell_pivot(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.2)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_12_1'\n\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.1)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_2_12_1'\n\n        if (last_candle['close'] > (last_candle['res1_1d'] * 1.0)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_12_1'\n\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.8)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_pv_4_12_1'\n\n        return False, None\n\n    def sell_long_mode(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        if (0.0 < current_profit <= 0.02) and (max_profit - current_profit > 0.025) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_0'\n        elif (0.02 < current_profit <= 0.04) and (max_profit - current_profit > 0.03) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_1'\n        elif (0.04 < current_profit <= 0.06) and (max_profit - current_profit > 0.035) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_2'\n        elif (0.06 < current_profit <= 0.08) and (max_profit - current_profit > 0.04) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_3'\n        elif (0.08 < current_profit <= 0.1) and (max_profit - current_profit > 0.045) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_4'\n        elif (0.1 < current_profit <= 0.12) and (max_profit - current_profit > 0.05) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_5'\n        elif (0.12 < current_profit <= 0.14) and (max_profit - current_profit > 0.055) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_6'\n        elif (0.14 < current_profit <= 0.16) and (max_profit - current_profit > 0.06) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_7'\n        elif (0.16 < current_profit <= 0.18) and (max_profit - current_profit > 0.065) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.18 < current_profit <= 0.2) and (max_profit - current_profit > 0.07) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.2 < current_profit <= 0.3) and (max_profit - current_profit > 0.075) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_9'\n        elif (0.3 < current_profit <= 0.4) and (max_profit - current_profit > 0.08) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_10'\n        elif (0.4 < current_profit <= 0.5) and (max_profit - current_profit > 0.085) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_11'\n        elif (0.5 < current_profit <= 1.0) and (max_profit - current_profit > 0.09) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_12'\n\n        return False, None\n\n    def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:\n        if (0.06 > current_profit > 0.02) and (last_candle['rsi_14'] > 80.0):\n            return True, 'signal_profit_q_1'\n\n        if (0.06 > current_profit > 0.02) and (last_candle['cti'] > 0.95):\n            return True, 'signal_profit_q_2'\n\n        if (0.04 > current_profit > 0.02) and (last_candle['pm'] <= last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.1):\n            return True, 'signal_profit_q_pmax_bull'\n        if (0.045 > current_profit > 0.005) and (last_candle['pm'] > last_candle['pmax_thresh']) and (last_candle['close'] > last_candle['sma_21'] * 1.016):\n            return True, 'signal_profit_q_pmax_bear'\n\n        if (last_candle['momdiv_sell_1h'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_1h'\n        if (last_candle['momdiv_sell'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv'\n        if (last_candle['momdiv_coh'] == True) and (current_profit > 0.02):\n            return True, 'signal_profit_q_momdiv_coh'\n\n        return False, None\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Long mode\n        if all(c in ['31', '32', '33', '34', '35', '36'] for c in buy_tags):\n            sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n            # Skip remaining sell logic for long mode\n            return None\n            \n        # Quick sell mode\n        if all(c in ['empty', '104', '105'] for c in buy_tags):\n            sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sells\n        sell, signal_name = self.sell_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Sell logic for pumped pairs\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, stoploss\n        sell, signal_name = self.sell_pump_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pivot points based sells\n        sell, signal_name = self.sell_pivot(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n        informative_pairs.extend([(pair, self.info_timeframe_15m) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_15m))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        # S/R\n        res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n        informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()\n        informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # EMAs\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24) \n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n        informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # EWO\n        informative_1h['ewo'] = ewo(informative_1h, 50, 200)\n        \n        # ROC\n        informative_1h['roc'] = ta.ROC(informative_1h, timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        informative_1h['momdiv_buy'] = mom['momdiv_buy']\n        informative_1h['momdiv_sell'] = mom['momdiv_sell']\n        informative_1h['momdiv_coh'] = mom['momdiv_coh']\n        informative_1h['momdiv_col'] = mom['momdiv_col']\n\n        # T3 Average\n        informative_1h['T3'] = T3(informative_1h)\n        \n        # S/R\n        res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n        informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)\n        informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)\n        \n        # nfi 37\n        informative_1h['hl_pct_change_5'] = self.range_percent_change(informative_1h, 'HL', 5)\n        informative_1h['low_5'] = informative_1h['low'].shift().rolling(5).min()\n        informative_1h['safe_dump_50'] = ((informative_1h['hl_pct_change_5'] < 0.66) | (informative_1h['close'] < informative_1h['low_5']) | (informative_1h['close'] > informative_1h['open']))\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = ewo(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_20'] = ta.RSI(dataframe, timeperiod=20)\n\n        # EMAs\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_21'] = ta.SMA(dataframe, timeperiod=21)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # BB 20 - STD3\n        bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std3['lower']\n        dataframe['bb20_3_mid'] = bb_20_std3['mid']\n        dataframe['bb20_3_upp'] = bb_20_std3['upper']\n\n        dataframe['bb20_width'] = ((dataframe['bb20_2_upp'] - dataframe['bb20_2_low']) / dataframe['bb20_2_mid'])\n        dataframe['bb20_delta'] = ((dataframe['bb20_2_low'] - dataframe['bb20_3_low']) / dataframe['bb20_2_low'])\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_24'] = williams_r(dataframe, period=24)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n        dataframe['cci_25'] = ta.CCI(dataframe, source='hlc3', timeperiod=25)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # RMI\n        dataframe['rmi_17'] = RMI(dataframe, length=17, mom=4)\n\n        # STOCHRSI\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # Close delta\n        dataframe['close_delta'] = (dataframe['close'] - dataframe['close'].shift(1)).abs()\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 3.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 3.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 3.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.0))\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Volume\n        dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)\n        dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)\n        dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n        \n         # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n\n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # MOMDIV\n        mom = momdiv(dataframe)\n        dataframe['momdiv_buy'] = mom['momdiv_buy']\n        dataframe['momdiv_sell'] = mom['momdiv_sell']\n        dataframe['momdiv_coh'] = mom['momdiv_coh']\n        dataframe['momdiv_col'] = mom['momdiv_col']\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_32'] = moderi(dataframe, 32)\n        dataframe['moderi_64'] = moderi(dataframe, 64)\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # Zero-Lag EMA\n        dataframe['zema_61'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_15m != 'none':\n            informative_15m = self.informative_15m_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.info_timeframe_15m, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_15m}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump_6h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params[\"safe_pump_6h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_12h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params[\"safe_pump_12h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_24h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params[\"safe_pump_24h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_36h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params[\"safe_pump_36h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_48h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params[\"safe_pump_48h_threshold\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(12).min()) / dataframe['open'].rolling(12).min()) > 0.032)\n                    item_buy_logic.append(dataframe['rsi_14'] < 36.0)\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['r_32'] < -75.0)\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 30.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 84.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -99.0)\n\n                # Condition #2 - Semi swing. Local dip.\n                elif index == 2:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < (dataframe['rsi_14_1h'] - 47.0))\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -98.0)\n                    item_buy_logic.append(dataframe['r_480'] > -95.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.82)\n\n                # Condition #3 - Semi swing. Local dip.\n                elif index == 3:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_96'] < -80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.75)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -30.0)\n\n                # Condition #4 - Semi swing. Local dip.\n                elif index == 4:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.992))\n                    item_buy_logic.append(dataframe['rsi_14'] > 30.0)\n                    item_buy_logic.append(dataframe['mfi'] > 25.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #5 - Semi swing. Local dip. Uptrend.\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo'] > 3.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.93)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #6 - Semi swing. Local dip.\n                elif index == 6:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.937)\n                    item_buy_logic.append(dataframe['crsi'] < 30.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.82)\n                    item_buy_logic.append(dataframe['cci'] < -200.0)\n\n                # Condition #7 - Semi swing. Local dip.\n                elif index == 7:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.94)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.984)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi'] > 8.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.85)\n\n                # Condition #8 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.927)\n                    item_buy_logic.append(dataframe['ewo'] > 3.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #9 - Semi swing. Local dip. Downtrend.\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.99)\n                    item_buy_logic.append(dataframe['cti'] < -0.92)\n                    item_buy_logic.append(dataframe['ewo'] < -5.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.88)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 20.0)\n\n                # Condition #10 - Semi swing. Local dip.\n                elif index == 10:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.017))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.965)\n                    item_buy_logic.append(dataframe['cti'] < -0.85)\n\n                # Condition #11 - Semi swing. Local dip.\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.932)\n                    item_buy_logic.append(dataframe['rsi_14'] < 25.0)\n\n                # Condition #12 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo'] > 0.1)\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n\n                # Condition #13 - Semi swing. Downtrend. Local dip.\n                elif index == 13:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.999)\n                    item_buy_logic.append(dataframe['ewo'] < -5.7)\n                    item_buy_logic.append(dataframe['cti'] < -0.97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 12.0)\n\n                # Condition #14 - Semi swing. Strong uptrend. Local dip.\n                elif index == 14:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.98)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['ewo'] > 7.8) # 4.0 7.8\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0) # 36.0\n                    item_buy_logic.append(dataframe['cti'] < -0.54)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #15 - Semi swing. Uptrend. Local dip.\n                elif index == 15:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.986))\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.5)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.62)\n\n                # Condition #16 - Semi swing. Cross above.\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 50.0)\n                    item_buy_logic.append(dataframe['cti'] < 0.5)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 70.0)\n\n                # Condition #17 - Semi swing. Deep buy.\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -99.0)\n                    item_buy_logic.append(dataframe['r_14'] == -100.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -95.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < 40.0)\n\n                # Condition #18 - Semi swing. Local dip. BTC not negative.\n                elif index == 18:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.982))\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #19 - Semi swing. Uptrend. Local dip.  BTC not downtrend.\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.75)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.25)\n\n                # Condition #20 - Semi swing. Uptrend. Local dip.\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.942))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n\n                # Condition #21 - Semi swing. Deep local dip. Mild uptrend.\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.941)\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.84)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -85.0)\n\n                # Condition #22 - Swing. Uptrend. Bounce from daily support level\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close_1h'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['sup_level_1d'] * 1.05)\n                    item_buy_logic.append(dataframe['low_1h'] < dataframe['sup_level_1d'] * 0.99)\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['res_level_1h'])\n                    item_buy_logic.append(dataframe['res_level_1d'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 48.0)\n\n                    # Confirm uptrend - Heikin-Ashi\n                    item_buy_logic.append(dataframe['open_sha_1d'] < dataframe['close_sha_1d'])\n                    item_buy_logic.append(dataframe['open_sha_1d'].shift(288) < dataframe['close_sha_1d'].shift(288))\n                    item_buy_logic.append(dataframe['pivot_1d'] > dataframe['pivot_1d'].shift(288) * 0.95)\n\n                # Condition #23 - Semi swing. Downtrend. Local dip.\n                elif index == 23:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'].shift(1) < -6.4)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 2.0)\n\n                # Condition #24 - Semi swing. Uptrend. 1h uptrend. Local dip.\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 2.8)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.92)\n\n                # Condition #25 - Semi swing. CMF 1h cross.\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 48.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 66.9)\n\n                # Condition #26 - Semi swing. Local deep dip.\n                elif index == 26:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.93)\n                    item_buy_logic.append(dataframe['rsi_14'] > 25.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n\n                # Condition #27 - Semi swing. Local deep. Uptrend.\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.934)\n                    item_buy_logic.append(dataframe['ewo'] > 6.4)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n\n                # Condition #28 - Semi swing. Downtrend. Local deep.\n                elif index == 28:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.96)\n                    item_buy_logic.append(dataframe['ewo'] < -8.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #29 - Semi swing. Downtrend. Local deep.\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.982))\n                    item_buy_logic.append(dataframe['ewo'] < -16.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n\n                # Condition #30 - Semi swing. Local dip. BTC not downtrend.\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))\n\n                # Condition #31 - Long mode. Local dip.\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.028))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.25))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #32 - Long mode. Local dip.\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.046))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n\n                # Condition #33 - Long mode. Local dip. Uptrend.\n                elif index == 33:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.934))\n                    item_buy_logic.append(dataframe['ewo'] > 2.5)\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 0.1)\n\n                # Condition #34 - Long mode. Local dip.\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.972))\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 18.0)\n                    \n                # ewo\n                elif index == 102:\n\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['roc_1h'] < 86)\n                    item_buy_logic.append(dataframe['bb20_width_1h'] < 0.954)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_4'] < 44)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.935)\n                    item_buy_logic.append(dataframe['ewo'] > -5.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 0.968)\n                    item_buy_logic.append(dataframe['rsi_14'] < 23)\n\n                # BB safe dump\n                elif index == 103:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rmi_17'] < 49)\n                    item_buy_logic.append(dataframe['cci_25'] <= -116)\n                    item_buy_logic.append(dataframe['srsi_fk'] < 32)\n                    item_buy_logic.append(dataframe['bb20_delta'] > 0.025)\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.095)\n                    item_buy_logic.append(dataframe['closedelta'] > dataframe['close'] * 12.148 / 1000 )\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_3_low'] * 0.999)\n\n                # NFI 33\n                elif index == 104:\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * 0.978)\n                    item_buy_logic.append(dataframe['ewo'] > 8)\n                    item_buy_logic.append(dataframe['cti'] < -0.88)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32)\n                    item_buy_logic.append(dataframe['r_14'] < -98.0)\n                    item_buy_logic.append(dataframe['volume'] < dataframe['volume_mean_4'] * 2.5)\n\n                # NFI 38\n                elif index == 105:\n\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -4.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.95)\n                    item_buy_logic.append(dataframe['r_14'] < -97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 0.5)\n\n                # reverse deadfish\n                elif index == 106:\n\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_100'] < dataframe['ema_200'] * 1.054)\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.3)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_mid'] * 1.014)\n                    item_buy_logic.append(dataframe['volume_mean_12'] > dataframe['volume_mean_24'] * 1.59)\n                    item_buy_logic.append(dataframe['cti'] < -0.115)\n                    item_buy_logic.append(dataframe['r_14'] < -44.34)\n\n                # Cofi\n                elif index == 107:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['open'] < dataframe['ema_8'] * 1.147)\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                    item_buy_logic.append(dataframe['fastk'] < 39)\n                    item_buy_logic.append(dataframe['fastd'] < 28)\n                    item_buy_logic.append(dataframe['adx'] > 13)\n                    item_buy_logic.append(dataframe['ewo'] > 8.594)\n                    item_buy_logic.append(dataframe['cti'] < -0.892)\n                    item_buy_logic.append(dataframe['r_14'] < -85.016)\n\n                # Gumbo\n                elif index == 108:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] < -9.442)\n                    item_buy_logic.append(dataframe['bb20_2_mid_1h'] >= dataframe['T3_1h'])\n                    item_buy_logic.append(dataframe['T3'] <= dataframe['ema_8'] * 1.121)\n                    item_buy_logic.append(dataframe['cti'] < -0.374)\n                    item_buy_logic.append(dataframe['r_14'] < -51.971)\n\n                # nfi7 37\n                elif index == 702:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] > 9.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 56.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.7)\n                    item_buy_logic.append(dataframe['safe_dump_50_1h'])\n\n                # Condition #25\n                elif index == 201:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_20'] < dataframe['rsi_20'].shift())\n                    item_buy_logic.append(dataframe['rsi_4'] < 30.0)\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_26_1h'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.953)\n                    item_buy_logic.append(dataframe['cti'] < -0.78)\n                    item_buy_logic.append(dataframe['cci'] < -200.0)\n\n                # Condition #5\n                elif index == 202:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * 0.84))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['rsi_14'] > 25.0)\n                    item_buy_logic.append(dataframe['mfi'] > 18.0)\n                    item_buy_logic.append(dataframe['r_14'] < -94.0)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -94.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 12.0)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 1.6))\n\n                # Condition #13\n                elif index == 203:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.99)\n                    item_buy_logic.append(dataframe['cti'] < -0.92)\n                    item_buy_logic.append(dataframe['ewo'] < -6.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.88)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n                    \n                # Condition #38 - PMAX3 buy\n                elif index == 204:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -4.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.95)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 0.5)\n\n                # Condition #35 - Long mode. Local deep dip.\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_25'] * 0.85)\n                    item_buy_logic.append(dataframe['close'] > dataframe['open'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['mfi'] < 36.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.85)\n\n                # Condition #36 - Long mode. Uptrend. Local dip.\n                elif index == 36:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.956)\n                    item_buy_logic.append(dataframe['rsi_14'] < 34.0)\n                    item_buy_logic.append(dataframe['r_64'] < -80.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -30.0)\n\n                # Condition #37 - Semi swing. Uptrend. Local dip.\n                elif index == 37:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.986))\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['r_64'] < -75.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] < 0.25)\n\n                # Condition #38 - Semi swing. Uptrend. Local dip.\n                elif index == 38:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['mfi'] < 34.5)\n                    item_buy_logic.append(dataframe['r_64'] < -65.0)\n                    item_buy_logic.append(dataframe['r_96'] < -50.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -1.0)\n\n                # Condition #39 - Semi swing. Uptrend. Local dip.\n                elif index == 39:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(48) * 1.07))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.056))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.01))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['close'] > dataframe['ema_50'] * 0.925)\n\n                # Condition #40 - Semi swing. Uptrend. Local dip.\n                elif index == 40:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.97)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_64'] < -80.0)\n\n                # Condition #41 - 15m. Semi swing. Local dip. BTC not downtrend.\n                elif index == 41:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n\n                # Condition #42 - 15m. Semi swing. Local dip. 15m uptrend.\n                elif index == 42:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 5.4)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 36.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['cci_15m'] < -160.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.5)\n\n                # Condition #43 - 15m. Semi swing. Local dip. 1h uptrend.\n                elif index == 43:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low_15m'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta_15m'].gt(dataframe['close_15m'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta_15m'].gt(dataframe['close_15m'] * 0.034))\n                    item_buy_logic.append(dataframe['tail_15m'].lt(dataframe['bb40_2_delta_15m'] * 0.18))\n                    item_buy_logic.append(dataframe['close_15m'].lt(dataframe['bb40_2_low_15m'].shift()))\n                    item_buy_logic.append(dataframe['close_15m'].le(dataframe['close_15m'].shift()))\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 30.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.85)\n                    item_buy_logic.append(dataframe['r_64_15m'] < -70.0)\n\n                # Condition #44 - 15m. Semi swing. Local deeper dip. 15m uptrend.\n                elif index == 44:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_15m'] > (dataframe['ema_200_15m'].shift(36) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_26_15m'] * 0.942)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 28.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n\n                # Condition #45 - 15m. Semi swing. Local deeper dip. 15m uptrend.\n                elif index == 45:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_15m'] > dataframe['ema_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.934)\n                    item_buy_logic.append(dataframe['ewo_15m'] > 3.6)\n                    item_buy_logic.append(dataframe['cci_15m'] < -190.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -97.0)\n                    item_buy_logic.append((dataframe['rsi_14_1h'] + dataframe['rsi_14_15m']) < 70.0)\n\n                # Condition #46 - 15m. Semi swing. 1h uptrend.\n                elif index == 46:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.027))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.982))\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #47 - 15m. Semi swing. Local dip. 1h minor dip.\n                elif index == 47:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3))\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95))\n                    item_buy_logic.append(\n                        ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h'])))\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 8.0)\n\n                # Condition #48 - 15m. Semi swing. Local deep. 15m uptrend.\n                elif index == 48:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95))\n                    item_buy_logic.append(dataframe['close_15m'] > (dataframe['open_15m'].shift(3)))\n                    item_buy_logic.append(dataframe['ewo_15m'] > 2.8)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 18.0)\n\n                # Condition #49 - 15m. Semi swing. Local deeper dip.\n                elif index == 49:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.916)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 32.5)\n                    item_buy_logic.append(dataframe['crsi_15m'] > 18.0)\n\n                # Condition #50 - 15m. Semi swing. Deep local dip. Mild 15m uptrend.\n                elif index == 50:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo_15m'] > 1.8)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n                    item_buy_logic.append(dataframe['r_96_15m'] < -75.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -97.0)\n\n                # Condition #51 - 15m. Semi swing. Downtrend. Dip.\n                elif index == 51:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944))\n                    item_buy_logic.append(dataframe['ewo_15m'] < -1.0)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] > 28.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.84)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -94.0)\n                    item_buy_logic.append(dataframe['rsi_14'] > 30.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 1.0)\n\n                # Condition #52 - 15m Semi swing. Local dip. BTC not downtrend.\n                elif index == 52:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #53 - 15m. Semi swing. BTC not negative. Local dip.\n                elif index == 53:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.7)\n\n                # Condition #54 - 15m Semi swing. Uptrend. Local dip.\n                elif index == 54:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_15m'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.4)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n                    item_buy_logic.append(dataframe['r_96_15m'] < -94.0)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n\n                # Condition #55 - 15m. Semi swing. Uptrend. Local dip.\n                elif index == 55:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.0)\n                    item_buy_logic.append(dataframe['close_15m'] > (dataframe['close_15m'].shift(3)))\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.986))\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -95.0)\n                    item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -86.0)\n\n                # Condition #56 - 15m. Semi swing. Downtrend. Local dip.\n                elif index == 56:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'].shift(3) < -14.0)\n                    item_buy_logic.append(dataframe['cti_15m'].shift(3).rolling(15).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -90.0)\n\n                # Condition #57 - 15m. Semi swing. Strong uptrend. Local dip. BTC not downtrend.\n                elif index == 57:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'].shift(3) > 6.5)\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_30_15m'].shift(3) * 0.988))\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.996))\n                    item_buy_logic.append(dataframe['rsi_14_15m'].shift(3) < 31.2)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)\n                    item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -80.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -18.0)\n\n                # Condition #58 - Semi swing. Local dip.\n                elif index == 58:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rmi_17'] < 49.0)\n                    item_buy_logic.append(dataframe['cci_25'] < -120.0)\n                    item_buy_logic.append(dataframe['srsi_fk'] < 32.0)\n                    item_buy_logic.append(dataframe['bb20_delta'] > 0.025)\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.095)\n                    item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 10.0 / 1000.0 )\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_3_low'] * 0.996))\n\n                # Condition #59 - Semi swing. Local dip.\n                elif index == 59:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_100'] < (dataframe['ema_200'] * 1.054))\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.34)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_mid'] * 1.014))\n                    item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.6))\n                    item_buy_logic.append(dataframe['cti'] < -0.115)\n                    item_buy_logic.append(dataframe['r_14'] < -45.0)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        return True\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n# Mom DIV\ndef momdiv(dataframe: DataFrame, mom_length: int = 10, bb_length: int = 20, bb_dev: float = 2.0, lookback: int = 30) -> DataFrame:\n    mom: Series = ta.MOM(dataframe, timeperiod=mom_length)\n    upperband, middleband, lowerband = ta.BBANDS(mom, timeperiod=bb_length, nbdevup=bb_dev, nbdevdn=bb_dev, matype=0)\n    buy = qtpylib.crossed_below(mom, lowerband)\n    sell = qtpylib.crossed_above(mom, upperband)\n    hh = dataframe['high'].rolling(lookback).max()\n    ll = dataframe['low'].rolling(lookback).min()\n    coh = dataframe['high'] >= hh\n    col = dataframe['low'] <= ll\n    df = DataFrame({\n            \"momdiv_mom\": mom,\n            \"momdiv_upperb\": upperband,\n            \"momdiv_lowerb\": lowerband,\n            \"momdiv_buy\": buy,\n            \"momdiv_sell\": sell,\n            \"momdiv_coh\": coh,\n            \"momdiv_col\": col,\n        }, index=dataframe['close'].index)\n    return df\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data"
  },
  {
    "path": "strategies/NostalgiaForInfinityX2/NostalgiaForInfinityX2.py",
    "content": "import logging\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce, partial\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n###########################################################################################################\n##                NostalgiaForInfinityX2 by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (USDT, ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                         ##\n##   TRC20/TRON (USDT, TRON, ...): TTAa9MX6zMLXNgWMhg7tkNormVHWCoq8Xk                                    ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##   Binance: https://accounts.binance.com/en/register?ref=EAZC47FM (5% discount on trading fees)        ##\n##   Kucoin: https://www.kucoin.com/r/QBSSSPYV (5% discount on trading fees)                             ##\n##   Gate.io: https://www.gate.io/signup/8054544 (10% discount on trading fees)                          ##\n##   OKX: https://www.okx.com/join/11749725760 (5% discount on trading fees)                             ##\n##   Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                        ##\n###########################################################################################################\n\nclass NostalgiaForInfinityX2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    def version(self) -> str:\n        return \"v0.0.1\"\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    info_timeframes = ['15m','1h','4h','1d']\n\n    # BTC informatives\n    btc_info_timeframes = ['5m','15m','1h','4h','1d']\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n    # Buy side configuration\n\n    buy_params = {\n        # Enable/Disable conditions\n        # -------------------------------------------------------\n        \"buy_condition_1_enable\": True,\n    }\n\n    buy_protection_params = {}\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_long_bull(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n\n        # Original sell signals\n        sell, signal_name = self.sell_long_bull_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        # Main sell signals\n        sell, signal_name = self.sell_long_bull_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        # Stoploss\n        if (\n                (current_profit < -0.05)\n        ):\n            return True, 'sell_long_bull_stoploss_doom'\n\n        return False, None\n\n\n    def sell_long_bull_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        # Sell signal 1\n        if (last_candle['rsi_14'] > 78.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_1_2_1'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_2_2_1'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 81.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_3_2_1'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 77.0) and (last_candle['rsi_14_1h'] > 77.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_4_2_1'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):\n            if (current_profit > 0.01):\n                return True, 'sell_long_bull_6_1'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_7_2_1'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_long_bull_8_2_1'\n\n        return False, None\n\n    def sell_long_bull_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        if (last_candle['close'] > last_candle['sma_200_1h']):\n            if 0.01 > current_profit >= 0.001:\n                if (last_candle['rsi_14'] < 26.0):\n                    return True, 'sell_long_bull_o_0'\n            elif 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 30.0):\n                    return True, 'sell_long_bull_o_1'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 32.0):\n                    return True, 'sell_long_bull_o_2'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 34.0):\n                    return True, 'sell_long_bull_o_3'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 36.0):\n                    return True, 'sell_long_bull_o_4'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 38.0):\n                    return True, 'sell_long_bull_o_5'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 40.0):\n                    return True, 'sell_long_bull_o_6'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 42.0):\n                    return True, 'sell_long_bull_o_7'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 44.0):\n                    return True, 'sell_long_bull_o_8'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 46.0):\n                    return True, 'sell_long_bull_o_9'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 48.0):\n                    return True, 'sell_long_bull_o_10'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 46.0):\n                    return True, 'sell_long_bull_o_11'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 44.0):\n                    return True, 'sell_long_bull_o_12'\n        elif (last_candle['close'] < last_candle['sma_200_1h']):\n            if 0.01 > current_profit >= 0.001:\n                if (last_candle['rsi_14'] < 28.0):\n                    return True, 'sell_long_bull_u_0'\n            elif 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 32.0):\n                    return True, 'sell_long_bull_u_1'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 34.0):\n                    return True, 'sell_long_bull_u_2'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 36.0):\n                    return True, 'sell_long_bull_u_3'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 38.0):\n                    return True, 'sell_long_bull_u_4'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 40.0):\n                    return True, 'sell_long_bull_u_5'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 42.0):\n                    return True, 'sell_long_bull_u_6'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 44.0):\n                    return True, 'sell_long_bull_u_7'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 46.0):\n                    return True, 'sell_long_bull_u_8'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 48.0):\n                    return True, 'sell_long_bull_u_9'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 50.0):\n                    return True, 'sell_long_bull_u_10'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 48.0):\n                    return True, 'sell_long_bull_u_11'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 46.0):\n                    return True, 'sell_long_bull_u_12'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if hasattr(trade, 'select_filled_orders'):\n            filled_buys = trade.select_filled_orders('buy')\n            count_of_buys = len(filled_buys)\n            if count_of_buys > 1:\n                initial_buy = filled_buys[0]\n                if (initial_buy is not None and initial_buy.average is not None):\n                    max_profit = ((trade.max_rate - initial_buy.average) / initial_buy.average)\n                    max_loss = ((initial_buy.average - trade.min_rate) / trade.min_rate)\n\n        # Long mode, bull\n        if all(c in ['1'] for c in buy_tags):\n            sell, signal_name = self.sell_long_bull(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = []\n        for info_timeframe in self.info_timeframes:\n            informative_pairs.extend([(pair, info_timeframe) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.extend([(btc_info_pair, btc_info_timeframe) for btc_info_timeframe in self.btc_info_timeframes])\n\n        return informative_pairs\n\n    def informative_1d_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        informative_1d['rsi_14'] = ta.RSI(informative_1d, timeperiod=14)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_4h_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_4h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        informative_4h['rsi_14'] = ta.RSI(informative_4h, timeperiod=14, fillna=True)\n\n        # SMA\n        informative_4h['sma_200'] = ta.SMA(informative_4h, timeperiod=200, fillna=True)\n\n        # Williams %R\n        informative_4h['r_14'] = williams_r(informative_4h, period=14)\n        informative_4h['r_480'] = williams_r(informative_4h, period=480)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_4h\n\n    def informative_1h_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SMA\n        informative_1h['sma_50'] = ta.SMA(informative_1h, timeperiod=50)\n        informative_1h['sma_100'] = ta.SMA(informative_1h, timeperiod=100)\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def informative_15m_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_15m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    # Coin Pair Base Timeframe Indicators\n    # ---------------------------------------------------------------------------------------------\n    def base_tf_5m_indicators(self,  metadata: dict, dataframe: DataFrame) -> DataFrame:\n        tik = time.perf_counter()\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_50'] = ta.SMA(dataframe, timeperiod=50)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Global protections\n        # -----------------------------------------------------------------------------------------\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_5m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    # Coin Pair Indicator Switch Case\n    # ---------------------------------------------------------------------------------------------\n    def info_switcher(self, metadata: dict, info_timeframe) -> DataFrame:\n        if info_timeframe == '1d':\n            return self.informative_1d_indicators(metadata, info_timeframe)\n        elif info_timeframe == '4h':\n            return self.informative_4h_indicators(metadata, info_timeframe)\n        elif info_timeframe == '1h':\n            return self.informative_1h_indicators(metadata, info_timeframe)\n        elif info_timeframe == '15m':\n            return self.informative_15m_indicators(metadata, info_timeframe)\n        else:\n            raise RuntimeError(f\"{info_timeframe} not supported as informative timeframe for BTC pair.\")\n\n    # BTC 1D Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_1d_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_1d = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_1d['rsi_14'] = ta.RSI(btc_info_1d, timeperiod=14)\n        #btc_info_1d['pivot'], btc_info_1d['res1'], btc_info_1d['res2'], btc_info_1d['res3'], btc_info_1d['sup1'], btc_info_1d['sup2'], btc_info_1d['sup3'] = pivot_points(btc_info_1d, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_1d.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_1d\n\n    # BTC 4h Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_4h_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_4h = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        btc_info_4h['rsi_14'] = ta.RSI(btc_info_4h, timeperiod=14)\n\n        # SMA\n        btc_info_4h['sma_200'] = ta.SMA(btc_info_4h, timeperiod=200)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_4h.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_4h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_4h\n\n    # BTC 1h Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_1h_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_1h = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        btc_info_1h['rsi_14'] = ta.RSI(btc_info_1h, timeperiod=14)\n\n        btc_info_1h['not_downtrend'] = ((btc_info_1h['close'] > btc_info_1h['close'].shift(2)) | (btc_info_1h['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_1h.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_1h\n\n    # BTC 15m Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_15m_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_15m = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_15m['rsi_14'] = ta.RSI(btc_info_15m, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_15m.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_15m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_15m\n\n    # BTC 5m Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_5m_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_5m = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_5m['rsi_14'] = ta.RSI(btc_info_5m, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_5m.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_5m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_5m\n\n    # BTC Indicator Switch Case\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_switcher(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        if btc_info_timeframe == '1d':\n            return self.btc_info_1d_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '4h':\n            return self.btc_info_4h_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '1h':\n            return self.btc_info_1h_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '15m':\n            return self.btc_info_15m_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '5m':\n            return self.btc_info_5m_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        else:\n            raise RuntimeError(f\"{btc_info_timeframe} not supported as informative timeframe for BTC pair.\")\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative indicators\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        for btc_info_timeframe in self.btc_info_timeframes:\n            btc_informative = self.btc_info_switcher(btc_info_pair, btc_info_timeframe, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_informative, self.timeframe, btc_info_timeframe, ffill=True)\n            # Customize what we drop - in case we need to maintain some BTC informative ohlcv data\n            # Default drop all\n            drop_columns = {\n                '1d':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '4h':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '1h':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '15m':  [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '5m':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n            }.get(btc_info_timeframe,[f\"{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']])\n            drop_columns.append(f\"date_{btc_info_timeframe}\")\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Indicators on informative timeframes\n        ___________________________________________________________________________________________\n        '''\n        for info_timeframe in self.info_timeframes:\n            info_indicators = self.info_switcher(metadata, info_timeframe)\n            dataframe = merge_informative_pair(dataframe, info_indicators, self.timeframe, info_timeframe, ffill=True)\n            # Customize what we drop - in case we need to maintain some informative timeframe ohlcv data\n            # Default drop all except base timeframe ohlcv data\n            drop_columns = {\n                '1d':   [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '4h':   [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '1h':   [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '15m':  [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            }.get(info_timeframe,[f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']])\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the base timeframe  (5m)\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.base_tf_5m_indicators(metadata, dataframe)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for buy_enable in self.buy_params:\n            index = int(buy_enable.split('_')[2])\n            item_buy_protection_list = [True]\n            if self.buy_params[f'{buy_enable}']:\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 -\n\n        # Long mode, bear\n        if all(c in ['11'] for c in buy_tags):\n            sell, signal_name = self.sell_long_bear(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = []\n        for info_timeframe in self.info_timeframes:\n            informative_pairs.extend([(pair, info_timeframe) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.extend([(btc_info_pair, btc_info_timeframe) for btc_info_timeframe in self.btc_info_timeframes])\n\n        return informative_pairs\n\n    def informative_1d_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        informative_1d['rsi_14'] = ta.RSI(informative_1d, timeperiod=14)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_4h_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_4h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        informative_4h['rsi_14'] = ta.RSI(informative_4h, timeperiod=14, fillna=True)\n\n        # SMA\n        informative_4h['sma_200'] = ta.SMA(informative_4h, timeperiod=200, fillna=True)\n\n        # Williams %R\n        informative_4h['r_14'] = williams_r(informative_4h, period=14)\n        informative_4h['r_480'] = williams_r(informative_4h, period=480)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_4h\n\n    def informative_1h_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # SMA\n        informative_1h['sma_50'] = ta.SMA(informative_1h, timeperiod=50)\n        informative_1h['sma_100'] = ta.SMA(informative_1h, timeperiod=100)\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def informative_15m_indicators(self, metadata: dict, info_timeframe) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_15m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    # Coin Pair Base Timeframe Indicators\n    # ---------------------------------------------------------------------------------------------\n    def base_tf_5m_indicators(self,  metadata: dict, dataframe: DataFrame) -> DataFrame:\n        tik = time.perf_counter()\n\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # EMA\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_50'] = ta.SMA(dataframe, timeperiod=50)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Global protections\n        # -----------------------------------------------------------------------------------------\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        # Performance logging\n        # -----------------------------------------------------------------------------------------\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_5m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    # Coin Pair Indicator Switch Case\n    # ---------------------------------------------------------------------------------------------\n    def info_switcher(self, metadata: dict, info_timeframe) -> DataFrame:\n        if info_timeframe == '1d':\n            return self.informative_1d_indicators(metadata, info_timeframe)\n        elif info_timeframe == '4h':\n            return self.informative_4h_indicators(metadata, info_timeframe)\n        elif info_timeframe == '1h':\n            return self.informative_1h_indicators(metadata, info_timeframe)\n        elif info_timeframe == '15m':\n            return self.informative_15m_indicators(metadata, info_timeframe)\n        else:\n            raise RuntimeError(f\"{info_timeframe} not supported as informative timeframe for BTC pair.\")\n\n    # BTC 1D Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_1d_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_1d = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_1d['rsi_14'] = ta.RSI(btc_info_1d, timeperiod=14)\n        #btc_info_1d['pivot'], btc_info_1d['res1'], btc_info_1d['res2'], btc_info_1d['res3'], btc_info_1d['sup1'], btc_info_1d['sup2'], btc_info_1d['sup3'] = pivot_points(btc_info_1d, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_1d.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_1d\n\n    # BTC 4h Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_4h_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_4h = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        # RSI\n        btc_info_4h['rsi_14'] = ta.RSI(btc_info_4h, timeperiod=14)\n\n        # SMA\n        btc_info_4h['sma_200'] = ta.SMA(btc_info_4h, timeperiod=200)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_4h.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_4h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_4h\n\n    # BTC 1h Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_1h_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_1h = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_1h['rsi_14'] = ta.RSI(btc_info_1h, timeperiod=14)\n        btc_info_1h['not_downtrend'] = ((btc_info_1h['close'] > btc_info_1h['close'].shift(2)) | (btc_info_1h['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_1h.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_1h\n\n    # BTC 15m Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_15m_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_15m = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_15m['rsi_14'] = ta.RSI(btc_info_15m, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_15m.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_15m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_15m\n\n    # BTC 5m Indicators\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_5m_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        btc_info_5m = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        btc_info_5m['rsi_14'] = ta.RSI(btc_info_5m, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date']\n        btc_info_5m.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] btc_info_5m_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return btc_info_5m\n\n    # BTC Indicator Switch Case\n    # ---------------------------------------------------------------------------------------------\n    def btc_info_switcher(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:\n        if btc_info_timeframe == '1d':\n            return self.btc_info_1d_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '4h':\n            return self.btc_info_4h_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '1h':\n            return self.btc_info_1h_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '15m':\n            return self.btc_info_15m_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        elif btc_info_timeframe == '5m':\n            return self.btc_info_5m_indicators(btc_info_pair, btc_info_timeframe, metadata)\n        else:\n            raise RuntimeError(f\"{btc_info_timeframe} not supported as informative timeframe for BTC pair.\")\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative indicators\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        for btc_info_timeframe in self.btc_info_timeframes:\n            btc_informative = self.btc_info_switcher(btc_info_pair, btc_info_timeframe, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_informative, self.timeframe, btc_info_timeframe, ffill=True)\n            # Customize what we drop - in case we need to maintain some BTC informative ohlcv data\n            # Default drop all\n            drop_columns = {\n                '1d':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '4h':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '1h':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '15m':  [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '5m':   [f\"btc_{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n            }.get(btc_info_timeframe,[f\"{s}_{btc_info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']])\n            drop_columns.append(f\"date_{btc_info_timeframe}\")\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Indicators on informative timeframes\n        ___________________________________________________________________________________________\n        '''\n        for info_timeframe in self.info_timeframes:\n            info_indicators = self.info_switcher(metadata, info_timeframe)\n            dataframe = merge_informative_pair(dataframe, info_indicators, self.timeframe, info_timeframe, ffill=True)\n            # Customize what we drop - in case we need to maintain some informative timeframe ohlcv data\n            # Default drop all except base timeframe ohlcv data\n            drop_columns = {\n                '1d':   [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '4h':   [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '1h':   [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],\n                '15m':  [f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            }.get(info_timeframe,[f\"{s}_{info_timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']])\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the base timeframe  (5m)\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.base_tf_5m_indicators(metadata, dataframe)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for buy_enable in self.buy_params:\n            index = int(buy_enable.split('_')[2])\n            item_buy_protection_list = [True]\n            if self.buy_params[f'{buy_enable}']:\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Long mode bull. Uptrend.\n                if index == 1:\n                    # Protections\n                    item_buy_logic.append(dataframe['sma_50'] > dataframe['sma_200'])\n                    item_buy_logic.append(dataframe['sma_50_1h'] > dataframe['sma_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < 30.0)\n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n                dataframe.loc[:, 'buy'] = item_buy\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,\n                            time_in_force: str, current_time: datetime, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n\n        if ((rate > dataframe['close'])):\n            slippage = ((rate / dataframe['close']) - 1.0)\n\n            if slippage < 0.038:\n                return True\n            else:\n                log.warning(\n                    \"Cancelling buy for %s due to slippage %s\",\n                    pair, slippage\n                )\n                return False\n\n        return True\n\n# +---------------------------------------------------------------------------+\n# |                              Custom Indicators                            |\n# +---------------------------------------------------------------------------+\n\n# Range midpoint acts as Support\ndef is_support(self, row_data) -> bool:\n    conditions = []\n    for row in range(len(row_data)-1):\n        if row < len(row_data)/2:\n            conditions.append(row_data[row] > row_data[row+1])\n        else:\n            conditions.append(row_data[row] < row_data[row+1])\n    return reduce(lambda x, y: x & y, conditions)\n\n# Range midpoint acts as Resistance\ndef is_resistance(self, row_data) -> bool:\n    conditions = []\n    for row in range(len(row_data)-1):\n        if row < len(row_data)/2:\n            conditions.append(row_data[row] < row_data[row+1])\n        else:\n            conditions.append(row_data[row] > row_data[row+1])\n    return reduce(lambda x, y: x & y, conditions)\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef t3_average(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe1'].fillna(0, inplace=True)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe2'].fillna(0, inplace=True)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe3'].fillna(0, inplace=True)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe4'].fillna(0, inplace=True)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe5'].fillna(0, inplace=True)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    df['xe6'].fillna(0, inplace=True)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\n# Pivot Points - 3 variants - daily recommended\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    if mode == 'simple':\n        hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n        return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n    elif mode == 'fibonacci':\n        hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n        hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n        return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n    elif mode == 'DeMark':\n        demark_pivot_lt = (dataframe['low'] * 2 + dataframe['high'] + dataframe['close'])\n        demark_pivot_eq = (dataframe['close'] * 2 + dataframe['low'] + dataframe['high'])\n        demark_pivot_gt = (dataframe['high'] * 2 + dataframe['low'] + dataframe['close'])\n        demark_pivot = np.where((dataframe['close'] < dataframe['open']), demark_pivot_lt, np.where((dataframe['close'] > dataframe['open']), demark_pivot_gt, demark_pivot_eq))\n        dm_pivot = demark_pivot / 4\n        dm_res = demark_pivot / 2 - dataframe['low']\n        dm_sup = demark_pivot / 2 - dataframe['high']\n        return dm_pivot, dm_res, dm_sup\n\n# Heikin Ashi candles\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\n# Peak Percentage Change\ndef range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n    \"\"\"\n    Rolling Percentage Change Maximum across interval.\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param method: High to Low / Open to Close\n    :param length: int The length to look back\n    \"\"\"\n    if method == 'HL':\n        return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n    elif method == 'OC':\n        return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n    else:\n        raise ValueError(f\"Method {method} not defined!\")\n\n# Percentage distance to top peak\ndef top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n    \"\"\"\n    Percentage change of the current close from the range maximum Open price\n\n    :param dataframe: DataFrame The original OHLC dataframe\n    :param length: int The length to look back\n    \"\"\"\n    if length == 0:\n        return (dataframe['open'] - dataframe['close']) / dataframe['close']\n    else:\n        return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n"
  },
  {
    "path": "strategies/NostalgiaForInfinityXw/NostalgiaForInfinityXw.py",
    "content": "import copy\nimport logging\nimport pathlib\nimport rapidjson\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport ta as ta2\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, timeframe_to_minutes, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom pandas import DataFrame, Series, concat\nfrom functools import reduce\nimport math\nfrom typing import Dict\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.util import resample_to_interval, resampled_merge\nfrom technical.indicators import RMI, zema, VIDYA, ichimoku\nimport time\n\nlog = logging.getLogger(__name__)\n#log.setLevel(logging.DEBUG)\n\n\ntry:\n    import pandas_ta as pta\nexcept ImportError:\n    log.error(\n        \"IMPORTANT - please install the pandas_ta python module which is needed for this strategy. \"\n        \"If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: \"\n        \"pip install pandas_ta\"\n    )\nelse:\n    log.info(\"pandas_ta successfully imported\")\n\n\n\n# PMAX\ndef pmax(df, period, multiplier, length, MAtype, src):\n\n    period = int(period)\n    multiplier = int(multiplier)\n    length = int(length)\n    MAtype = int(MAtype)\n    src = int(src)\n\n    mavalue = f'MA_{MAtype}_{length}'\n    atr = f'ATR_{period}'\n    pm = f'pm_{period}_{multiplier}_{length}_{MAtype}'\n    pmx = f'pmX_{period}_{multiplier}_{length}_{MAtype}'\n\n    # MAtype==1 --> EMA\n    # MAtype==2 --> DEMA\n    # MAtype==3 --> T3\n    # MAtype==4 --> SMA\n    # MAtype==5 --> VIDYA\n    # MAtype==6 --> TEMA\n    # MAtype==7 --> WMA\n    # MAtype==8 --> VWMA\n    # MAtype==9 --> zema\n    if src == 1:\n        masrc = df[\"close\"]\n    elif src == 2:\n        masrc = (df[\"high\"] + df[\"low\"]) / 2\n    elif src == 3:\n        masrc = (df[\"high\"] + df[\"low\"] + df[\"close\"] + df[\"open\"]) / 4\n\n    if MAtype == 1:\n        mavalue = ta.EMA(masrc, timeperiod=length)\n    elif MAtype == 2:\n        mavalue = ta.DEMA(masrc, timeperiod=length)\n    elif MAtype == 3:\n        mavalue = ta.T3(masrc, timeperiod=length)\n    elif MAtype == 4:\n        mavalue = ta.SMA(masrc, timeperiod=length)\n    elif MAtype == 5:\n        mavalue = VIDYA(df, length=length)\n    elif MAtype == 6:\n        mavalue = ta.TEMA(masrc, timeperiod=length)\n    elif MAtype == 7:\n        mavalue = ta.WMA(df, timeperiod=length)\n    elif MAtype == 8:\n        mavalue = vwma(df, length)\n    elif MAtype == 9:\n        mavalue = zema(df, period=length)\n\n    df[atr] = ta.ATR(df, timeperiod=period)\n    df['basic_ub'] = mavalue + ((multiplier/10) * df[atr])\n    df['basic_lb'] = mavalue - ((multiplier/10) * df[atr])\n\n\n    basic_ub = df['basic_ub'].values\n    final_ub = np.full(len(df), 0.00)\n    basic_lb = df['basic_lb'].values\n    final_lb = np.full(len(df), 0.00)\n\n    for i in range(period, len(df)):\n        final_ub[i] = basic_ub[i] if (\n            basic_ub[i] < final_ub[i - 1]\n            or mavalue[i - 1] > final_ub[i - 1]) else final_ub[i - 1]\n        final_lb[i] = basic_lb[i] if (\n            basic_lb[i] > final_lb[i - 1]\n            or mavalue[i - 1] < final_lb[i - 1]) else final_lb[i - 1]\n\n    df['final_ub'] = final_ub\n    df['final_lb'] = final_lb\n\n    pm_arr = np.full(len(df), 0.00)\n    for i in range(period, len(df)):\n        pm_arr[i] = (\n            final_ub[i] if (pm_arr[i - 1] == final_ub[i - 1]\n                                    and mavalue[i] <= final_ub[i])\n        else final_lb[i] if (\n            pm_arr[i - 1] == final_ub[i - 1]\n            and mavalue[i] > final_ub[i]) else final_lb[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] >= final_lb[i]) else final_ub[i]\n        if (pm_arr[i - 1] == final_lb[i - 1]\n            and mavalue[i] < final_lb[i]) else 0.00)\n\n    pm = Series(pm_arr)\n\n    # Mark the trend direction up/down\n    pmx = np.where((pm_arr > 0.00), np.where((mavalue < pm_arr), 'down',  'up'), np.NaN)\n\n    return pm, pmx\n\n###########################################################################################################\n##                NostalgiaForInfinityX by iterativ                                                     ##\n##           https://github.com/iterativv/NostalgiaForInfinity                                           ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               HOLD SUPPORT                                                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES ---------------------------------------------------------------------------- ##\n##   In case you want to have SOME of the trades to only be sold when on profit, add a file named        ##\n##   \"nfi-hold-trades.json\" in the user_data directory                                                   ##\n##                                                                                                       ##\n##   The contents should be similar to:                                                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": [1, 3, 7], \"profit_ratio\": 0.005}                                                     ##\n##                                                                                                       ##\n##   Or, for individual profit ratios(Notice the trade ID's as strings:                                  ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001, \"3\": -0.005, \"7\": 0.05}}                                                 ##\n##                                                                                                       ##\n##   NOTE:                                                                                               ##\n##    * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the   ##\n##      output of the telegram status command.                                                           ##\n##    * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##\n##      HOLD support logic to run                                                                        ##\n##    * This feature can be completely disabled with the holdSupportEnabled class attribute              ##\n##                                                                                                       ##\n## -------- SPECIFIC PAIRS ----------------------------------------------------------------------------- ##\n##   In case you want to have some pairs to always be on held until a specific profit, using the same    ##\n##   \"nfi-hold-trades.json\" file add something like:                                                     ##\n##                                                                                                       ##\n##   {\"trade_pairs\": {\"BTC/USDT\": 0.001, \"ETH/USDT\": -0.005}}                                            ##\n##                                                                                                       ##\n## -------- SPECIFIC TRADES AND PAIRS ------------------------------------------------------------------ ##\n##   It is also valid to include specific trades and pairs on the holds file, for example:               ##\n##                                                                                                       ##\n##   {\"trade_ids\": {\"1\": 0.001}, \"trade_pairs\": {\"BTC/USDT\": 0.001}}                                     ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (USDT, ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                         ##\n##   TRC20/TRON (USDT, TRON, ...): TTAa9MX6zMLXNgWMhg7tkNormVHWCoq8Xk                                    ##\n##                                                                                                       ##\n##               REFERRAL LINKS                                                                          ##\n##                                                                                                       ##\n##  Binance: https://accounts.binance.com/en/register?ref=EAZC47FM (5% discount on trading fees)         ##\n##  Kucoin: https://www.kucoin.com/r/QBSSSPYV (5% discount on trading fees)                              ##\n##  Gate.io: https://www.gate.io/signup/8054544 (10% discount on trading fees)                           ##\n##  OKEx: https://www.okex.com/join/11749725760 (5% discount on trading fees)                            ##\n##  Huobi: https://www.huobi.com/en-us/topic/double-reward/?invite_code=ubpt2223                         ##\n###########################################################################################################\n\n\nclass NostalgiaForInfinityXw(IStrategy):\n    INTERFACE_VERSION = 2\n\n    def version(self) -> str:\n        return \"v10.9.80\"\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 100.0,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    res_timeframe = 'none'\n    info_timeframe_1d = '1d'\n    info_timeframe_1h = '1h'\n    info_timeframe_15m = '15m'\n\n    # BTC informative\n    has_BTC_base_tf = False\n    has_BTC_info_tf = True\n    has_BTC_daily_tf = False\n\n    # Backtest Age Filter emulation\n    has_bt_agefilter = False\n    bt_min_age_days = 3\n\n    # Exchange Downtime protection\n    has_downtime_protection = False\n\n    # Do you want to use the hold feature? (with hold-trades.json)\n    holdSupportEnabled = True\n\n    # Coin Metrics\n    coin_metrics = {}\n    coin_metrics['top_traded_enabled'] = False\n    coin_metrics['top_traded_updated'] = False\n    coin_metrics['top_traded_len'] = 10\n    coin_metrics['tt_dataframe'] = DataFrame()\n    coin_metrics['top_grossing_enabled'] = False\n    coin_metrics['top_grossing_updated'] = False\n    coin_metrics['top_grossing_len'] = 20\n    coin_metrics['tg_dataframe'] = DataFrame()\n    coin_metrics['current_whitelist'] = []\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 480\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        \"buy_condition_27_enable\": True,\n        \"buy_condition_28_enable\": True,\n        \"buy_condition_29_enable\": True,\n        \"buy_condition_30_enable\": True,\n        \"buy_condition_31_enable\": True,\n        \"buy_condition_32_enable\": True,\n        \"buy_condition_33_enable\": True,\n        \"buy_condition_34_enable\": True,\n        \"buy_condition_35_enable\": True,\n        \"buy_condition_36_enable\": True,\n        \"buy_condition_37_enable\": True,\n        \"buy_condition_38_enable\": True,\n        \"buy_condition_39_enable\": True,\n        \"buy_condition_40_enable\": True,\n        \"buy_condition_41_enable\": True,\n        \"buy_condition_42_enable\": True,\n        \"buy_condition_43_enable\": True,\n        \"buy_condition_44_enable\": True,\n        \"buy_condition_45_enable\": True,\n        \"buy_condition_46_enable\": True,\n        \"buy_condition_47_enable\": True,\n        \"buy_condition_48_enable\": True,\n        \"buy_condition_49_enable\": True,\n        \"buy_condition_50_enable\": True,\n        \"buy_condition_51_enable\": True,\n        \"buy_condition_52_enable\": True,\n        \"buy_condition_53_enable\": True,\n        \"buy_condition_54_enable\": True,\n        \"buy_condition_55_enable\": True,\n        \"buy_condition_56_enable\": True,\n        \"buy_condition_57_enable\": True,\n        \"buy_condition_58_enable\": True,\n        \"buy_condition_59_enable\": True,\n        \"buy_condition_60_enable\": True,\n        \"buy_condition_61_enable\": True,\n        \"buy_condition_62_enable\": True,\n        \"buy_condition_63_enable\": True,\n        \"buy_condition_64_enable\": True,\n        \"buy_condition_65_enable\": True,\n        \"buy_condition_66_enable\": True,\n        \"buy_condition_67_enable\": True,\n        \"buy_condition_68_enable\": True,\n        \"buy_condition_69_enable\": True,\n        \"btc_uptrend\": True,\n        \"buy_cat\": \"<R\",\n        \"buy_real\": 0.3786,\n        \"close_above_ema_fast\": False,\n        \"close_above_ema_fast_len\": \"25\",\n        \"close_above_ema_slow\": True,\n        \"close_above_ema_slow_len\": \"100\",\n        \"ema_fast\": False,\n        \"ema_fast_len\": \"25\",\n        \"ema_slow\": True,\n        \"ema_slow_len\": \"12\",\n        \"ichimoku_window1\": 49,\n        \"ichimoku_window2\": 13,\n        \"safe_dips_threshold_0\": 0.79,\n        \"safe_dips_threshold_12\": 0.46,\n        \"safe_dips_threshold_144\": 0.57,\n        \"safe_dips_threshold_2\": 0.33,\n        \"safe_pump_12h_threshold\": 0.3,\n        \"safe_pump_24h_threshold\": 0.96,\n        \"safe_pump_36h_threshold\": 0.57,\n        \"safe_pump_48h_threshold\": 0.72,\n        \"safe_pump_6h_threshold\": 0.55,\n        \"sma200_1h_rising\": True,\n        \"sma200_1h_rising_val\": 81,\n        \"sma200_rising\": True,\n        \"sma200_rising_val\": 156,\n        #############\n    }\n    \n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"kst_roc1\": 32,\n        \"kst_roc2\": 47,\n        \"kst_roc3\": 49,\n        \"kst_roc4\": 43,\n        \"kst_window1\": 36,\n        \"kst_window2\": 10,\n        \"kst_window3\": 24,\n        \"kst_window4\": 24,\n        \"sell_cat\": \"=R\",\n        \"sell_real\": 0.2841,\n        #############\n    }\n    \n    optimizeBuy = True\n    optimizeSell = True\n    optimizePump = True\n    optimizeDump = True\n    \n    \n    ema_fast = CategoricalParameter(\n        [True, False], default=buy_params[\"ema_fast\"], space='buy', optimize=optimizeBuy)\n    \n    ema_fast_len = CategoricalParameter(\n        [\"8\", \"12\", \"16\", \"20\", \"25\", \"50\", \"100\", \"200\"], default=buy_params[\"ema_fast_len\"], space='buy', optimize=optimizeBuy)\n    \n    ema_slow = CategoricalParameter(\n        [True, False], default=buy_params[\"ema_slow\"], space='buy', optimize=optimizeBuy)\n    \n    ema_slow_len = CategoricalParameter(\n        [\"8\", \"12\", \"20\", \"25\", \"50\", \"100\", \"200\"], default=buy_params[\"ema_slow_len\"], space='buy', optimize=optimizeBuy)\n    \n    close_above_ema_fast = CategoricalParameter(\n        [True, False], default=buy_params[\"close_above_ema_fast\"], space='buy', optimize=optimizeBuy)\n    \n    close_above_ema_fast_len = CategoricalParameter(\n        [\"8\", \"12\", \"20\", \"25\", \"50\", \"100\", \"200\"], default=buy_params[\"close_above_ema_fast_len\"], space='buy', optimize=optimizeBuy)\n   \n    close_above_ema_slow = CategoricalParameter(\n        [True, False], default=buy_params[\"close_above_ema_slow\"], space='buy', optimize=optimizeBuy)\n    \n    close_above_ema_slow_len = CategoricalParameter(\n        [\"8\", \"12\", \"20\", \"25\", \"50\", \"100\", \"200\"], default=20, space='buy', optimize=optimizeBuy)\n    \n    sma200_rising = CategoricalParameter(\n        [True, False], default=buy_params[\"sma200_rising\"], space='buy', optimize=optimizeBuy)\n    \n    sma200_rising_val = IntParameter(\n        10, 400, default=buy_params[\"sma200_rising_val\"], space='buy', optimize=optimizeBuy)\n    \n    sma200_1h_rising = CategoricalParameter(\n        [True, False], default=buy_params[\"sma200_1h_rising\"], space='buy', optimize=optimizeBuy)\n    \n    sma200_1h_rising_val = IntParameter(\n        10, 400, default=buy_params[\"sma200_1h_rising_val\"], space='buy', optimize=optimizeBuy)\n    \n    \n    btc_uptrend = CategoricalParameter(\n        [True, False], default=buy_params[\"btc_uptrend\"], space='buy', optimize=optimizeBuy)\n    \n    \n    buy_real = DecimalParameter(\n        0.001, 0.999, decimals=4, default=buy_params[\"buy_real\"], space='buy', optimize=optimizeBuy)\n    \n    buy_cat = CategoricalParameter(\n        [\">R\", \"=R\", \"<R\"], default=buy_params[\"buy_cat\"], space='buy', optimize=optimizeBuy)\n    \n    \n    ichimoku_window1 = IntParameter(\n        10, 50, default=buy_params[\"ichimoku_window1\"], space='buy', optimize=optimizeBuy)\n    \n    ichimoku_window2 = IntParameter(\n        10, 50, default=buy_params[\"ichimoku_window2\"], space='buy', optimize=optimizeBuy)\n    \n    sell_real = DecimalParameter(\n        0.001, 0.999, decimals=4, default=sell_params[\"sell_real\"], space='sell', optimize=optimizeSell)\n    sell_cat = CategoricalParameter(\n        [\">R\", \"=R\", \"<R\"], default=sell_params[\"sell_cat\"], space='sell', optimize=optimizeSell)\n    \n    kst_window1 = IntParameter(\n        10, 50, default=sell_params[\"kst_window1\"], space='sell', optimize=optimizeSell)\n    \n    kst_window2 = IntParameter(\n        10, 50, default=sell_params[\"kst_window2\"], space='sell', optimize=optimizeSell)\n    \n    kst_window3 = IntParameter(\n        10, 50, default=sell_params[\"kst_window3\"], space='sell', optimize=optimizeSell)\n    \n    kst_window4 = IntParameter(\n        10, 50, default=sell_params[\"kst_window4\"], space='sell', optimize=optimizeSell)\n    \n    kst_roc1 = IntParameter(\n        10, 50, default=sell_params[\"kst_roc1\"], space='sell', optimize=optimizeSell)\n    \n    kst_roc2 = IntParameter(\n        10, 50, default=sell_params[\"kst_roc2\"], space='sell', optimize=optimizeSell)\n    \n    kst_roc3 = IntParameter(\n        10, 50, default=sell_params[\"kst_roc3\"], space='sell', optimize=optimizeSell)\n    \n    kst_roc4 = IntParameter(\n        10, 50, default=sell_params[\"kst_roc4\"], space='sell', optimize=optimizeSell)\n    \n    safe_dips_threshold_0 = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_dips_threshold_0\"], space='buy', optimize=optimizeDump)\n    \n    safe_dips_threshold_2 = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_dips_threshold_2\"], space='buy', optimize=optimizeDump)\n    \n    safe_dips_threshold_12 = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_dips_threshold_12\"], space='buy', optimize=optimizeDump)\n    \n    safe_dips_threshold_144 = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_dips_threshold_144\"], space='buy', optimize=optimizeDump)\n    \n    safe_pump_6h_threshold = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_pump_6h_threshold\"], space='buy', optimize=optimizePump)\n    \n    safe_pump_12h_threshold = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_pump_12h_threshold\"], space='buy', optimize=optimizePump)\n    \n    safe_pump_24h_threshold = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_pump_24h_threshold\"], space='buy', optimize=optimizePump)\n    \n    safe_pump_36h_threshold = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_pump_36h_threshold\"], space='buy', optimize=optimizePump)\n    \n    safe_pump_48h_threshold = DecimalParameter(\n        0.01, 1.0, decimals=2, default=buy_params[\"safe_pump_48h_threshold\"], space='buy', optimize=optimizePump)\n    \n    \n\n    #############################################################\n    buy_protection_params = {\n        1: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.24,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.36,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 1.2,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 2.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        2: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.32,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.75,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        3: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"20\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.06,\n            \"safe_dips_threshold_12\"    : 0.2,\n            \"safe_dips_threshold_144\"   : 0.25,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.5,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.9,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        4: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.54,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.7,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        5: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.68,\n            \"safe_pump_36h_threshold\"   : 0.74,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        6: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.78,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.3,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"pivot\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        7: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.022,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        8: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.74,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.98,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.6\n        },\n        9: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"28\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 1.2,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        10: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        11: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.14,\n            \"safe_dips_threshold_144\"   : 0.24,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.88,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.06,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        12: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.13,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : 0.5,\n            \"safe_pump_24h_threshold\"   : 0.75,\n            \"safe_pump_36h_threshold\"   : 1.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        13: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"26\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : 0.52,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        14: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"44\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"72\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        15: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.48,\n            \"safe_dips_threshold_144\"   : 0.9,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        16: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.02,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        17: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.25,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.25,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        18: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.14,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.65,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        19: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"100\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.026,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.35,\n            \"safe_pump_12h_threshold\"   : 0.45,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        20: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : 0.35,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        21: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : None,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        22: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.6,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        23: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.2,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        24: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.4,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.1\n        },\n        25: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"36\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        26: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        27: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : 0.5,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        28: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.9,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        29: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        30: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.28,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        31: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.44,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        32: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.26,\n            \"safe_dips_threshold_144\"   : 0.3,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.78,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        33: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.8,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.07\n        },\n        34: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        35: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.028,\n            \"safe_dips_threshold_2\"     : 0.066,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        36: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"16\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.14,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.6,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.45\n        },\n        37: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.14,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.2\n        },\n        38: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"16\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.13,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.45,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 2.0,\n            \"safe_pump_36h_threshold\"   : 2.0,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.8\n        },\n        39: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : 0.54,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.25\n        },\n        40: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"30\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : 0.3,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.55,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.67,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        41: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.08,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 3.2,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        42: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.4,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        43: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : 0.9,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.99,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        44: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : True,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 1.2,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        45: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.4,\n            \"safe_dips_threshold_144\"   : 0.8,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.35,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        46: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"24\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.32,\n            \"safe_dips_threshold_144\"   : 0.34,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.6,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        47: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : True,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.9,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        48: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.8,\n            \"safe_pump_36h_threshold\"   : 1.3,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.2\n        },\n        49: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : True,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.6,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        50: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.56,\n            \"safe_pump_36h_threshold\"   : 1.0,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        51: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.03,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.3,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : 0.58,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n        },\n        52: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.25,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.62,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 0.95,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        53: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.16,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.7,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        54: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.24,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.95,\n            \"safe_pump_48h_threshold\"   : 1.05,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        55: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : 0.7,\n            \"safe_pump_48h_threshold\"   : 0.7,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        56: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : 0.3,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        57: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.28,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.1,\n            \"btc_1h_not_downtrend\"      : True,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        58: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.024,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.14,\n            \"safe_dips_threshold_144\"   : 0.24,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        59: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.36,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.52,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.0,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.75,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        60: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.8,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"sup2\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 0.96,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        62: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"50\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"50\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"42\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"50\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.23,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.6,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        63: {\n            \"ema_fast\"                  : True,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.13,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.5,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"res3\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.2\n         },\n        64: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.75,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : 1.0,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : 1.0\n         },\n        65: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : None,\n            \"safe_dips_threshold_2\"     : None,\n            \"safe_dips_threshold_12\"    : None,\n            \"safe_dips_threshold_144\"   : None,\n            \"safe_pump_6h_threshold\"    : None,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : None,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : None,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : None,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : None\n         },\n        66: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.75,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : None,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : None\n        },\n        67: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.75,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : None,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : None\n        },\n        68: {\n            \"ema_fast\"                  : False,\n            \"ema_fast_len\"              : \"12\",\n            \"ema_slow\"                  : False,\n            \"ema_slow_len\"              : \"12\",\n            \"close_above_ema_fast\"      : False,\n            \"close_above_ema_fast_len\"  : \"200\",\n            \"close_above_ema_slow\"      : False,\n            \"close_above_ema_slow_len\"  : \"200\",\n            \"sma200_rising\"             : False,\n            \"sma200_rising_val\"         : \"24\",\n            \"sma200_1h_rising\"          : False,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : 0.032,\n            \"safe_dips_threshold_2\"     : 0.09,\n            \"safe_dips_threshold_12\"    : 0.18,\n            \"safe_dips_threshold_144\"   : 0.26,\n            \"safe_pump_6h_threshold\"    : 0.5,\n            \"safe_pump_12h_threshold\"   : None,\n            \"safe_pump_24h_threshold\"   : 0.75,\n            \"safe_pump_36h_threshold\"   : None,\n            \"safe_pump_48h_threshold\"   : 1.4,\n            \"btc_1h_not_downtrend\"      : False,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : None,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : None\n        },\n        69: {\n            \"ema_fast\"                  : ema_fast.value,\n            \"ema_fast_len\"              : ema_fast_len.value,\n            \"ema_slow\"                  : ema_slow.value,\n            \"ema_slow_len\"              : ema_slow_len.value,\n            \"close_above_ema_fast\"      : close_above_ema_fast.value,\n            \"close_above_ema_fast_len\"  : close_above_ema_fast_len.value,\n            \"close_above_ema_slow\"      : close_above_ema_slow.value,\n            \"close_above_ema_slow_len\"  : close_above_ema_slow_len.value,\n            \"sma200_rising\"             : sma200_rising.value,\n            \"sma200_rising_val\"         : sma200_rising_val.value,\n            \"sma200_1h_rising\"          : sma200_1h_rising.value,\n            \"sma200_1h_rising_val\"      : \"48\",\n            \"safe_dips_threshold_0\"     : safe_dips_threshold_0.value,\n            \"safe_dips_threshold_2\"     : safe_dips_threshold_2.value,\n            \"safe_dips_threshold_12\"    : safe_dips_threshold_12.value,\n            \"safe_dips_threshold_144\"   : safe_dips_threshold_144.value,\n            \"safe_pump_6h_threshold\"    : safe_pump_6h_threshold.value,\n            \"safe_pump_12h_threshold\"   : safe_pump_12h_threshold.value,\n            \"safe_pump_24h_threshold\"   : safe_pump_24h_threshold.value,\n            \"safe_pump_36h_threshold\"   : safe_pump_36h_threshold.value,\n            \"safe_pump_48h_threshold\"   : safe_pump_48h_threshold.value,\n            \"btc_1h_not_downtrend\"      : btc_uptrend.value,\n            \"close_over_pivot_type\"     : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_over_pivot_offset\"   : None,\n            \"close_under_pivot_type\"    : \"none\", # pivot, sup1, sup2, sup3, res1, res2, res3\n            \"close_under_pivot_offset\"  : None\n        }\n    }\n\n    # Sell\n    sell_condition_1_enable = True\n\n    #############################################################\n    # CACHES\n\n    hold_trades_cache = None\n    target_profit_cache = None\n    #############################################################\n\n    def __init__(self, config: dict) -> None:\n        super().__init__(config)\n        if self.target_profit_cache is None:\n            self.target_profit_cache = Cache(\n                self.config[\"user_data_dir\"] / \"data-nfi-profit_target_by_pair.json\"\n            )\n\n        # If the cached data hasn't changed, it's a no-op\n        self.target_profit_cache.save()\n\n    def get_hold_trades_config_file(self):\n        proper_holds_file_path = self.config[\"user_data_dir\"].resolve() / \"nfi-hold-trades.json\"\n        if proper_holds_file_path.is_file():\n            return proper_holds_file_path\n\n        strat_file_path = pathlib.Path(__file__)\n        hold_trades_config_file_resolve = strat_file_path.resolve().parent / \"hold-trades.json\"\n        if hold_trades_config_file_resolve.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_resolve,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_resolve\n\n        # The resolved path does not exist, is it a symlink?\n        hold_trades_config_file_absolute = strat_file_path.absolute().parent / \"hold-trades.json\"\n        if hold_trades_config_file_absolute.is_file():\n            log.warning(\n                \"Please move %s to %s which is now the expected path for the holds file\",\n                hold_trades_config_file_absolute,\n                proper_holds_file_path,\n            )\n            return hold_trades_config_file_absolute\n\n    def load_hold_trades_config(self):\n        if self.hold_trades_cache is None:\n            hold_trades_config_file = self.get_hold_trades_config_file()\n            if hold_trades_config_file:\n                log.warning(\"Loading hold support data from %s\", hold_trades_config_file)\n                self.hold_trades_cache = HoldsCache(hold_trades_config_file)\n\n        if self.hold_trades_cache:\n            self.hold_trades_cache.load()\n\n    def whitelist_tracker(self):\n        if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):\n            log.info(\"Whitelist has changed...\")\n            self.coin_metrics['top_traded_updated'] = False\n            self.coin_metrics['top_grossing_updated'] = False\n\n            # Update pairlist\n            self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()\n\n            # Move up BTC for largest data footprint\n            self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f\"BTC/{self.config['stake_currency']}\")))\n\n    def top_traded_list(self):\n        log.info(\"Updating top traded pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tt_dataframe'] = DataFrame()\n\n        # Build traded volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tt_dataframe'] once\n            if not 'date' in self.coin_metrics['tt_dataframe']:\n                self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tt_dataframe'].set_index('date')\n\n            # Calculate daily traded volume\n            pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tt_dataframe']['date']\n        self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top traded coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n        self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tt_dataframe'].set_index('date')\n        self.coin_metrics['top_traded_updated'] = True\n        log.info(\"Updated top traded pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tt_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top traded pairlist took {tok - tik:0.4f} seconds...\")\n\n    def top_grossing_list(self):\n        log.info(\"Updating top grossing pairlist...\")\n        tik = time.perf_counter()\n\n        self.coin_metrics['tg_dataframe'] = DataFrame()\n\n        # Build grossing volume dataframe\n        for coin_pair in self.coin_metrics['current_whitelist']:\n            coin = coin_pair.split('/')[0]\n\n            # Get the volume for the daily informative timeframe and name the column for the coin\n            pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)\n            pair_dataframe.set_index('date')\n\n            if self.config['runmode'].value in ('live', 'dry_run'):\n                pair_dataframe = pair_dataframe.iloc[-7:,:]\n\n            # Set the date index of the self.coin_metrics['tg_dataframe'] once\n            if not 'date' in self.coin_metrics['tg_dataframe']:\n                self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']\n                self.coin_metrics['tg_dataframe'].set_index('date')\n\n            # Calculate daily grossing rate\n            pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100\n\n            # Drop the columns we don't need\n            pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)\n\n            # Merge it in on the date key\n            self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')\n\n        # Forward fill empty cells (due to different df shapes)\n        self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)\n\n        # Store and drop date column for value sorting\n        pair_dates = self.coin_metrics['tg_dataframe']['date']\n        self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)\n\n        # Build columns and top grossing coins\n        column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n        self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')\n        self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)\n\n        # Re-add stored date column\n        self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)\n        self.coin_metrics['tg_dataframe'].set_index('date')\n        self.coin_metrics['top_grossing_updated'] = True\n        log.info(\"Updated top grossing pairlist (tail-5):\")\n        log.info(f\"\\n{self.coin_metrics['tg_dataframe'].tail(5)}\")\n\n        tok = time.perf_counter()\n        log.info(f\"Updating top grossing pairlist took {tok - tik:0.4f} seconds...\")\n\n    def is_top_coin(self, coin_pair, row_data, top_length) -> bool:\n        return coin_pair.split('/')[0] in row_data.loc['Coin #1':f\"Coin #{top_length}\"].values\n\n    def is_support(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] > row_data[row+1])\n            else:\n                conditions.append(row_data[row] < row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def is_resistance(self, row_data) -> bool:\n        conditions = []\n        for row in range(len(row_data)-1):\n            if row < len(row_data)/2:\n                conditions.append(row_data[row] < row_data[row+1])\n            else:\n                conditions.append(row_data[row] > row_data[row+1])\n        return reduce(lambda x, y: x & y, conditions)\n\n    def bot_loop_start(self, **kwargs) -> None:\n        \"\"\"\n        Called at the start of the bot iteration (one loop).\n        Might be used to perform pair-independent tasks\n        (e.g. gather some remote resource for comparison)\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        \"\"\"\n\n        # Coin metrics mechanism\n        if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:\n            self.whitelist_tracker()\n        if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:\n            self.top_traded_list()\n        if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:\n            self.top_grossing_list()\n\n        if self.config[\"runmode\"].value not in (\"live\", \"dry_run\"):\n            return super().bot_loop_start(**kwargs)\n\n        if self.holdSupportEnabled:\n            self.load_hold_trades_config()\n\n        return super().bot_loop_start(**kwargs)\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        \n        \n        IND = 'trend_kst_diff'\n        REAL = self.sell_real.value\n        OPR = self.sell_cat.value\n        DFIND = last_candle[IND]\n        #print(buy_tag)\n        if OPR == \">R\" and DFIND > REAL:\n            return True, 'sell_signal_Wieger_1'\n        elif OPR == \"=R\" and np.isclose(DFIND, REAL):\n            return True, 'sell_signal_Wieger_2'\n        elif OPR == \"<R\" and DFIND < REAL:\n            return True, 'sell_signal_Wieger_3'\n        \n        \n        # Sell signal 1\n        if (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_1_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_1_2_2'\n\n        # Sell signal 2\n        elif (last_candle['rsi_14'] > 80.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_2_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_2_2_2'\n\n        # Sell signal 3\n        elif (last_candle['rsi_14'] > 83.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_3_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_3_2_2'\n\n        # Sell signal 4\n        elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_4_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_4_2_2'\n\n        # Sell signal 6\n        elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):\n            if (current_profit > 0.01):\n                return True, 'sell_signal_6_1'\n            # elif (current_profit < -0.05) and (max_loss > 0.12):\n            #     return True, 'sell_signal_6_2'\n\n        # Sell signal 7\n        elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_7_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_7_2_2'\n\n        # Sell signal 8\n        elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):\n            if (last_candle['close'] > last_candle['ema_200']):\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_1_1'\n            else:\n                if (current_profit > 0.01):\n                    return True, 'sell_signal_8_2_1'\n                # elif (current_profit < -0.05) and (max_loss > 0.12):\n                #     return True, 'sell_signal_8_2_2'\n\n        return False, None\n\n    def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (\n                (current_profit < -0.0)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_20_15m'])\n                and (last_candle['sma_200_dec_20_1h'])\n                and (last_candle['ema_vwma_osc_32'] < -0.0)\n                and (last_candle['ema_vwma_osc_64'] < -0.0)\n                and (last_candle['ema_vwma_osc_96'] < -0.0)\n                and (last_candle['cmf'] < -0.0)\n                and (last_candle['cmf_15m'] < -0.0)\n                and (last_candle['cmf_1h'] < -0.0)\n                and (current_time - timedelta(minutes=7200) > trade.open_date_utc)\n        ):\n            if (-0.12 <= current_profit < -0.08):\n                if (last_candle['close'] < last_candle['atr_high_thresh_1']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_1']):\n                    return True, 'sell_stoploss_atr_1'\n            elif (-0.16 <= current_profit < -0.12):\n                if (last_candle['close'] < last_candle['atr_high_thresh_2']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_2']):\n                    return True, 'sell_stoploss_atr_2'\n            elif (-0.2 <= current_profit < -0.16):\n                if (last_candle['close'] < last_candle['atr_high_thresh_3']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_3']):\n                    return True, 'sell_stoploss_atr_3'\n            elif (current_profit < -0.2):\n                if (last_candle['close'] < last_candle['atr_high_thresh_4']) and (previous_candle_1['close'] > previous_candle_1['atr_high_thresh_4']):\n                    return True, 'sell_stoploss_atr_4'\n\n        # Under & near EMA200, local uptrend move\n        if (\n                (current_profit < -0.025)\n                and (last_candle['close'] < last_candle['ema_200'])\n                and (last_candle['cmf'] < -0.0)\n                and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < 0.004)\n                and last_candle['rsi_14'] > previous_candle_1['rsi_14']\n                and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + 20.0))\n                and (last_candle['sma_200_dec_20'])\n                and (last_candle['sma_200_dec_24'])\n                and (current_time - timedelta(minutes=7200) > trade.open_date_utc)\n                # temporary\n                and (trade.open_date_utc + timedelta(minutes=12000) > current_time )\n        ):\n            return True, 'sell_stoploss_u_e_1'\n\n        return False, None\n\n    def sell_over_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] > last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96']):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_o_bull_12_1'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_12_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_12_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_12_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_12_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bull_11_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_11_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_11_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_11_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_11_6'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bull_10_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_10_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_10_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_10_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_10_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_10_6'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_9_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_9_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_9_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_9_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_9_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_o_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_8_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_8_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_8_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_8_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_o_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_7_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_7_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_7_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_7_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_o_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_6_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_6_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_6_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_6_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_o_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_5_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_5_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_5_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_5_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_o_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_4_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_4_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_4_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_4_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_o_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_3_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_3_3'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_3_4'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_3_5'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_2_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_2_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_2_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_o_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_1_2'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_1_3'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bull_1_4'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bull_1_5'\n                    elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bull_1_6'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_o_bear_12_1'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_12_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_12_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_12_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_12_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bear_11_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_11_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_11_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_11_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_11_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bear_10_1'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_10_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_10_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_10_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_10_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_9_1'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_9_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_9_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_9_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_9_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_o_bear_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_8_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_8_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_8_4'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_8_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_o_bear_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_7_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_7_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_7_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_7_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_o_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_6_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_6_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_6_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_6_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_o_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_5_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_5_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_5_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_5_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_o_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_4_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_4_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_4_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_4_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_o_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_3_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_3_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_3_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_3_5'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_o_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_2_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_2_3'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_2_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_o_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bear_1_2'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_1_3'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_o_bear_1_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_o_bear_1_5'\n                    elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_o_bear_1_6'\n\n        return False, None\n\n    def sell_under_main(self, current_profit: float, last_candle) -> tuple:\n        if last_candle['close'] < last_candle['ema_200']:\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_u_bull_12_1'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_12_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_12_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_12_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_12_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_11_1'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_o_bull_11_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_11_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_11_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_11_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_u_bull_10_1'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_10_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_10_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_10_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_10_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bull_9_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_9_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_9_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_9_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_9_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_u_bull_8_1'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_8_2'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_8_3'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_8_4'\n                    elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_8_5'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_u_bull_7_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_7_2'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_7_3'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_7_4'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_7_5'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_u_bull_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_6_2'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_6_3'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_6_4'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_6_5'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_u_bull_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_5_2'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_5_3'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_5_4'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_5_5'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_u_bull_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_4_2'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_4_3'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_4_4'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_4_5'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_3_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bull_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_3_2'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_3_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_3_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_3_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_u_bull_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_2_2'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_2_3'\n                    elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_2_4'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_2_5'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_u_bull_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bull_1_2'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_1_3'\n                    elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bull_1_4'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bull_1_5'\n                    elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bull_1_6'\n            else:\n                if current_profit >= 0.20:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_u_bear_12_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_12_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_12_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_12_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_12_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_12_6'\n                elif 0.20 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_11_1'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_11_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_11_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_11_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_11_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_11_6'\n                elif 0.12 > current_profit >= 0.10:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_u_bear_10_1'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_10_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_10_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_10_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_10_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_10_6'\n                elif 0.10 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_9_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_9_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_9_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_9_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_9_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_9_6'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_u_bear_8_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_8_2'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_8_3'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_8_4'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_8_5'\n                    elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_8_6'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_u_bear_7_1'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_7_2'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_7_3'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_7_4'\n                    elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_7_5'\n                    elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_7_6'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_u_bear_6_1'\n                    elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_6_2'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_6_3'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_6_4'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_6_5'\n                    elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_6_6'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_u_bear_5_1'\n                    elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_5_2'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_5_3'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_5_4'\n                    elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_5_5'\n                    elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_5_6'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_u_bear_4_1'\n                    elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_4_2'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_4_3'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_4_4'\n                    elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_4_5'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_4_6'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_u_bear_3_1'\n                    elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_3_2'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_3_3'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_3_4'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_3_5'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_3_6'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_u_bear_2_1'\n                    elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_2_2'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_2_3'\n                    elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_2_4'\n                    elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_2_5'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_2_6'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_u_bear_1_1'\n                    elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):\n                        return True, 'sell_profit_u_bear_1_2'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_1_3'\n                    elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_u_bear_1_4'\n                    elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                        return True, 'sell_profit_u_bear_1_5'\n                    elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):\n                        return True, 'sell_profit_u_bear_1_6'\n\n        return False, None\n\n    def sell_r(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.01 > current_profit > 0.001:\n            if (last_candle['r_96'] < -90.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.2):\n                return True, 'sell_profit_w_0_1'\n            elif (last_candle['rsi_14'] < 30.0) and (last_candle['r_96'] < -90.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.3) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_0_2'\n            elif (last_candle['rsi_14'] < 28.0) and (last_candle['cmf'] < -0.5) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_0_3'\n            elif (last_candle['r_480'] < -80.0) and (last_candle['rsi_14'] > 80.0):\n                return True, 'sell_profit_w_0_4'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -90.0):\n                return True, 'sell_profit_w_0_5'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 82.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_0_6'\n        elif 0.02 > current_profit >= 0.01:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_1_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_1_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_1_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_1_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_1_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_1_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_1_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_1_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_1_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_1_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_1_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_1_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_1_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_1_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_1_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_1_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_1_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_1_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_1_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_1_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_1_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_1_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_1_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_1_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_1_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_1_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_48'\n            elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_1_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_1_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_1_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_1_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_1_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_1_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_1_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_1_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_1_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_1_63'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_1_65'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_1_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_1_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_68'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_1_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_1_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_1_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_1_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_1_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_1_76'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_78'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_1_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_1_83'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_1_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_1_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_1_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_1_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_1_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_1_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_1_91'\n        elif 0.03 > current_profit >= 0.02:\n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_2_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_2_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_2_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_2_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 350.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_2_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_2_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_2_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_2_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_2_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_2_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_2_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_2_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_2_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_2_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_2_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_2_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_2_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_2_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_2_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_2_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_2_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_2_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_2_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_2_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_2_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_2_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_48'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_2_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_2_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_2_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_2_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_2_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_2_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_2_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_2_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_2_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_2_63'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_2_65'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_2_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_2_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_68'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_2_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_2_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_2_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_2_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_2_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_2_76'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_78'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_2_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_2_83'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_2_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_2_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_2_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_2_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_2_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_2_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_2_91'\n        elif 0.04 > current_profit >= 0.03:\n            if (last_candle['r_480'] > -0.6):\n                return True, 'sell_profit_w_3_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_3_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_3_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_3_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_3_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_3_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_3_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_3_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_3_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_3_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_3_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_3_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_3_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_3_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_3_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_3_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_3_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_3_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_3_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_3_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_3_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_3_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_3_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_3_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_3_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_48'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_3_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_3_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_3_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_3_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_3_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_3_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_3_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_3_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 71.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_3_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_3_63'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_3_65'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_3_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_3_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_68'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_3_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_3_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_3_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_3_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_3_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_3_76'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_78'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_3_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_3_83'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_3_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_3_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_3_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_3_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_3_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_3_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_3_91'\n        elif 0.05 > current_profit >= 0.04:\n            if (last_candle['r_480'] > -0.7):\n                return True, 'sell_profit_w_4_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_4_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_4_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_4_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_6'\n            elif (last_candle['rsi_14'] < 49.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_4_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_4_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_4_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0):\n                return True, 'sell_profit_w_4_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_4_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_4_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_4_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_4_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_4_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_4_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_4_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_4_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_4_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_4_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_4_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_4_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_4_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_4_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_4_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_4_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_4_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_48'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_4_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_4_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_4_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_4_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_4_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_4_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_4_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_4_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 70.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_4_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_4_63'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_4_65'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_4_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_4_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_68'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_4_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_4_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_4_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_4_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_4_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_4_76'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_78'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_4_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_4_83'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_4_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_4_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_4_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_4_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_4_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_4_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_4_91'\n        elif 0.06 > current_profit >= 0.05:\n            if (last_candle['r_480'] > -0.8):\n                return True, 'sell_profit_w_5_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 54.0):\n                return True, 'sell_profit_w_5_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_5_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_5_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_6'\n            elif (last_candle['rsi_14'] < 50.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 64.0):\n                return True, 'sell_profit_w_5_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_5_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_5_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_5_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_5_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_5_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_5_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_5_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_5_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_5_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_5_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_5_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 200.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_5_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_5_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_5_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_5_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_5_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_5_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_5_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_5_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_5_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_48'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_5_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_5_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_5_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_5_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_5_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_5_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_5_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_5_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 69.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_5_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_5_63'\n            elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_5_65'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_5_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_5_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_68'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_5_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_5_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_5_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_5_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_5_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_5_76'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_78'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_5_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_5_83'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_5_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_5_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_5_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_5_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_5_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_5_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_5_91'\n        elif 0.07 > current_profit >= 0.06:\n            if (last_candle['r_480'] > -0.9):\n                return True, 'sell_profit_w_6_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 52.0):\n                return True, 'sell_profit_w_6_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_6_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_6_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_6'\n            elif (last_candle['rsi_14'] < 49.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):\n                return True, 'sell_profit_w_6_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_6_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_6_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0):\n                return True, 'sell_profit_w_6_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_6_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_6_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_6_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_6_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_6_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_6_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_6_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_6_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_6_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_6_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_6_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_6_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_6_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_6_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_6_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_6_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_6_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_48'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_6_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_6_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_6_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_6_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_6_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_6_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_6_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_6_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 70.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_6_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_6_63'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_6_65'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_6_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_6_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_68'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_6_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_6_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_6_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_6_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_6_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_6_76'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_78'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_6_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_6_83'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_6_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_6_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_6_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_6_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_6_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_6_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_6_91'\n        elif 0.08 > current_profit >= 0.07:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_7_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):\n                return True, 'sell_profit_w_7_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_7_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_7_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_6'\n            elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_7_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_7_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 270.0):\n                return True, 'sell_profit_w_7_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):\n                return True, 'sell_profit_w_7_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_7_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_7_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_7_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_7_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_7_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_7_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_7_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_7_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_7_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_7_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_7_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_7_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_7_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_7_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_7_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_7_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_7_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_48'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_7_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_7_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_7_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_7_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_7_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_7_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_7_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_7_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 71.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_7_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_7_63'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_7_65'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_7_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_7_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_68'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_7_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_7_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_7_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_7_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_7_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_7_76'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_78'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_7_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_7_83'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_7_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_7_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_7_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_7_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_7_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_7_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_7_91'\n        elif 0.09 > current_profit >= 0.08:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_8_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_w_8_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_8_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_8_5'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_6'\n            elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_8_9'\n            elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_8_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_8_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):\n                return True, 'sell_profit_w_8_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_8_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_8_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_8_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_8_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_8_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_8_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_8_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_8_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_8_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_8_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_8_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_8_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_8_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_8_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_8_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_8_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_48'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_8_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_8_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_8_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_8_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_8_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_8_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_8_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_8_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_8_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_8_63'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_8_65'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_8_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_8_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_68'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_8_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_8_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_8_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_8_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_8_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_8_76'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_78'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_8_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_8_83'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_8_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_8_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_8_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_8_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_8_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_8_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_8_91'\n        elif 0.1 > current_profit >= 0.09:\n            if (last_candle['r_480'] > -1.2):\n                return True, 'sell_profit_w_9_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_w_9_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_9_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):\n                return True, 'sell_profit_w_9_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_6'\n            elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):\n                return True, 'sell_profit_w_9_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):\n                return True, 'sell_profit_w_9_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 290.0):\n                return True, 'sell_profit_w_9_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):\n                return True, 'sell_profit_w_9_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_9_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_9_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_9_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_9_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_9_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_9_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_9_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_9_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_9_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_9_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_9_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_9_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_9_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_9_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_9_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_9_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_9_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_48'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_9_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_9_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_9_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_9_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_9_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_9_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_9_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_9_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_9_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_9_63'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_9_65'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_9_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_9_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_68'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_9_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_9_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_9_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_9_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_9_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_9_76'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_78'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_9_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_9_83'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_9_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_9_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_9_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_9_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_9_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_9_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_9_91'\n        elif 0.12 > current_profit >= 0.1:\n            if (last_candle['r_480'] > -1.0):\n                return True, 'sell_profit_w_10_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_w_10_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_10_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_10_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_6'\n            elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_10_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):\n                return True, 'sell_profit_w_10_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 240.0):\n                return True, 'sell_profit_w_10_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 300.0):\n                return True, 'sell_profit_w_10_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_10_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_10_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_10_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_10_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_10_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_10_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_10_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_10_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 300.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_10_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_10_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_10_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_10_37'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_10_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_10_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_10_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_10_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_10_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_48'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_10_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_10_51'\n            elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_10_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_10_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_10_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_10_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_10_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_10_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 74.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_10_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_10_63'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_10_65'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_10_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_10_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_68'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_10_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_10_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_10_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_10_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_10_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_10_76'\n            elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_78'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_10_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_10_83'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_10_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_10_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_10_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_10_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_10_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_10_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_10_91'\n        elif 0.2 > current_profit >= 0.12:\n            \n            if (last_candle['r_480'] > -0.5):\n                return True, 'sell_profit_w_11_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_w_11_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_11_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_11_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_6'\n            elif (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_11_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 75.0):\n                return True, 'sell_profit_w_11_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 260.0):\n                return True, 'sell_profit_w_11_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 310.0):\n                return True, 'sell_profit_w_11_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_11_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_11_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_11_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_11_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_11_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_11_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_11_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_11_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_11_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_32'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_11_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_11_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_11_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_11_37'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):\n                return True, 'sell_profit_w_11_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_11_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_11_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_11_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_11_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_48'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_11_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_11_51'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_11_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_11_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_11_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_11_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_11_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_11_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 75.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_11_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_11_63'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_11_65'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_11_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_11_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_68'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_11_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_11_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_11_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_11_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_11_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_11_76'\n            elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_78'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_11_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_11_83'\n            elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_11_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_11_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_11_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_11_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_11_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_11_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_11_91'\n        elif current_profit >= 0.2:\n            if (last_candle['r_480'] > -0.4):\n                return True, 'sell_profit_w_12_1'\n            elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_2'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_w_12_3'\n            elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 77.0):\n                return True, 'sell_profit_w_12_4'\n            elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_12_5'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_6'\n            elif (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_7'\n            elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):\n                return True, 'sell_profit_w_12_8'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 76.0):\n                return True, 'sell_profit_w_12_9'\n            elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 280.0):\n                return True, 'sell_profit_w_12_10'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):\n                return True, 'sell_profit_w_12_11'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_12'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_13'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):\n                return True, 'sell_profit_w_12_14'\n            elif (last_candle['r_14'] > -0.1)  and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_12_15'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_12_16'\n            elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] < -75.0):\n                return True, 'sell_profit_w_12_17'\n            elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_12_18'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_19'\n            elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_20'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['btc_not_downtrend_1h'] == False)  and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_21'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_22'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_23'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_12_24'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 38.0):\n                return True, 'sell_profit_w_12_25'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_26'\n            elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_27'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 78.0):\n                return True, 'sell_profit_w_12_28'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_29'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):\n                return True, 'sell_profit_w_12_30'\n            elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 340.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_31'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_32'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_33'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -3.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_12_34'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] > -15.0):\n                return True, 'sell_profit_w_12_35'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_12_36'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20']):\n                return True, 'sell_profit_w_12_37'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -5.0):\n                return True, 'sell_profit_w_12_38'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.25) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_39'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_40'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_12_41'\n            elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):\n                return True, 'sell_profit_w_12_42'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_12_43'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] < last_candle['ema_200']):\n                return True, 'sell_profit_w_12_44'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_45'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_46'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_47'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_48'\n            elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):\n                return True, 'sell_profit_w_12_49'\n            elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.2) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_50'\n            elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_12_51'\n            elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_12_52'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_53'\n            elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_54'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -20.0):\n                return True, 'sell_profit_w_12_55'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_w_12_56'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):\n                return True, 'sell_profit_w_12_57'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_12_58'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_59'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):\n                return True, 'sell_profit_w_12_60'\n            elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_61'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 76.0)  and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_12_62'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):\n                return True, 'sell_profit_w_12_63'\n            elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_64'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):\n                return True, 'sell_profit_w_12_65'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_12_66'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):\n                return True, 'sell_profit_w_12_67'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_68'\n            elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):\n                return True, 'sell_profit_w_12_69'\n            elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):\n                return True, 'sell_profit_w_12_70'\n            elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_12_71'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):\n                return True, 'sell_profit_w_12_72'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_73'\n            elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_74'\n            elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                return True, 'sell_profit_w_12_75'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_12_76'\n            elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_77'\n            elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_78'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_79'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_80'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_w_12_81'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_82'\n            elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):\n                return True, 'sell_profit_w_12_83'\n            elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):\n                return True, 'sell_profit_w_12_84'\n            elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_85'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):\n                return True, 'sell_profit_w_12_86'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_w_12_87'\n            elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_w_12_88'\n            elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                return True, 'sell_profit_w_12_89'\n            elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):\n                return True, 'sell_profit_w_12_90'\n            elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.25):\n                return True, 'sell_profit_w_12_91'\n\n        return False, None\n\n    def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if 0.012 > current_profit >= 0.0:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 46.0):\n                return True, 'sell_profit_t_0_1'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 32.0):\n                return True, 'sell_profit_t_0_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 48.0):\n                return True, 'sell_profit_t_0_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_0_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_5'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 36.0) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_6'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['sma_200_dec_20_15m']):\n                return True, 'sell_profit_t_0_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 49.0):\n                return True, 'sell_profit_t_0_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_0_10'\n        elif 0.02 > current_profit >= 0.012:\n            if (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_1_1'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_2'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_1_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_5'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_6'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_1_7'\n            elif (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_1_8'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_1_9'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_1_10'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_1_11'\n            elif (max_profit > (current_profit + 0.01)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_1_12'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_13'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_1_14'\n        elif 0.03 > current_profit >= 0.02:\n            if (max_profit > (current_profit + 0.015)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_1'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_2'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_3'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_2_4'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_6'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_2_7'\n            elif (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_2_8'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_2_9'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_2_10'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_2_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_2_12'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_13'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_2_14'\n        elif 0.04 > current_profit >= 0.03:\n            if (max_profit > (current_profit + 0.02)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_3_1'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_2'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_3'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_3_4'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_6'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_3_7'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_3_8'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_3_9'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_3_10'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_3_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_3_12'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_13'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_3_14'\n        elif 0.05 > current_profit >= 0.04:\n            if (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_4_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_2'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_3'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_4_4'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_6'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_4_7'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_4_8'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_4_9'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_4_10'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_4_11'\n            elif (max_profit > (current_profit + 0.025)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_4_12'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_13'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_4_14'\n        elif 0.06 > current_profit >= 0.05:\n            if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_5_1'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_2'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_3'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_5_4'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_5_7'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_5_8'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_5_9'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_5_10'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0):\n                return True, 'sell_profit_t_5_11'\n            elif (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_5_12'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_13'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_5_14'\n        elif 0.07 > current_profit >= 0.06:\n            if (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 44.0):\n                return True, 'sell_profit_t_6_1'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_2'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_3'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_6_4'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_6_7'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_6_8'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_6_9'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_6_10'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_6_11'\n            elif (max_profit > (current_profit + 0.035)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_6_12'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_13'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_6_14'\n        elif 0.08 > current_profit >= 0.07:\n            if (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 43.0):\n                return True, 'sell_profit_t_7_1'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_2'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_3'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_7_4'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_7_7'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_7_8'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_7_9'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_7_10'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_7_11'\n            elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_7_12'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_13'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_7_14'\n        elif 0.09 > current_profit >= 0.08:\n            if (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 42.0):\n                return True, 'sell_profit_t_8_1'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_2'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_3'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_8_4'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_8_7'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_8_8'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_8_9'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_8_10'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_8_11'\n            elif (max_profit > (current_profit + 0.045)) and (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_8_12'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_13'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_8_14'\n        elif 0.1 > current_profit >= 0.09:\n            if (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 41.0):\n                return True, 'sell_profit_t_9_1'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_2'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_3'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_9_4'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 42.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_9_7'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_9_8'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_9_9'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_9_10'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 36.0):\n                return True, 'sell_profit_t_9_11'\n            elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_9_12'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_13'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_9_14'\n        elif 0.12 > current_profit >= 0.1:\n            if (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 40.0):\n                return True, 'sell_profit_t_10_1'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_2'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_3'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_10_4'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 41.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_10_7'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_10_8'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_10_9'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_10_10'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 35.0):\n                return True, 'sell_profit_t_10_11'\n            elif (max_profit > (current_profit + 0.055)) and (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_10_12'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_13'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_10_14'\n        elif 0.2 > current_profit >= 0.12:\n            if (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 39.0):\n                return True, 'sell_profit_t_11_1'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_2'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_3'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_11_4'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 40.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_11_7'\n            elif (max_profit > (current_profit + 0.065)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_11_8'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_11_9'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_11_10'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14'] < 34.0):\n                return True, 'sell_profit_t_11_11'\n            elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_11_12'\n            elif (max_profit > (current_profit + 0.075)) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_13'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_11_14'\n        elif current_profit >= 0.2:\n            if (max_profit > (current_profit + 0.7)) and (last_candle['rsi_14'] < 38.0):\n                return True, 'sell_profit_t_12_1'\n            elif (max_profit > (current_profit + 0.9)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_2'\n            elif (max_profit > (current_profit + 0.09)) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_3'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cti_1h'] > 0.8):\n                return True, 'sell_profit_t_12_4'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 39.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_6'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0):\n                return True, 'sell_profit_t_12_7'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['cmf'] < -0.0) and (last_candle['sma_200_dec_20_1h']):\n                return True, 'sell_profit_t_12_8'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0):\n                return True, 'sell_profit_t_12_9'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] > -20.0):\n                return True, 'sell_profit_t_12_10'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14'] < 33.0):\n                return True, 'sell_profit_t_12_11'\n            elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.25):\n                return True, 'sell_profit_t_12_12'\n            elif (max_profit > (current_profit + 0.08)) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_13'\n            elif (max_profit > (current_profit + 0.085)) and (last_candle['rsi_14_15m'] < 36.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                return True, 'sell_profit_t_12_14'\n\n        return False, None\n\n    def sell_dec_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['close'] > last_candle['ema_200']):\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):\n                    return True, 'sell_profit_d_o_1_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_1_4'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_1_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_7'\n                elif (last_candle['rsi_14'] > 70.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_1_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_1_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_1_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_1_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_1_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_1_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_1_14'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_1_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_1_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_1_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_1_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_1_19'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_1_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_1_21'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_1_22'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):\n                    return True, 'sell_profit_d_o_1_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_1_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_1_25'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_1_26'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_1_27'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_1_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_1_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_1_30'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_1_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_1_32'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_1_33'\n                elif (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_1_34'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_1_35'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_1_36'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_1_37'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_2_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_2_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_2_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_2_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_2_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_2_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_2_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_2_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_2_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_2_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_2_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_2_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_2_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_2_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_2_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_2_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_2_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_2_22'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):\n                    return True, 'sell_profit_d_o_2_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_2_25'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_2_26'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_2_27'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_2_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_2_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_2_30'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_2_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_2_32'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_2_33'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_2_34'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_2_35'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_36'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_2_37'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_3_1'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_3_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_3_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_3_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_3_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_3_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_3_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_3_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_3_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_3_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_3_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_3_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_3_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_3_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_3_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_3_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_3_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_3_22'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_3_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_3_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_3_25'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_3_26'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_3_27'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_3_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_3_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_3_30'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_3_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_3_32'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_3_33'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_3_34'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_3_35'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_3_36'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_3_37'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):\n                    return True, 'sell_profit_d_o_4_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_4_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_4_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_4_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_4_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_4_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_4_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_4_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_4_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_4_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_4_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_4_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_4_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_4_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_4_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_4_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_4_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_4_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_4_22'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_4_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_4_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_4_25'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_4_26'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_4_27'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_4_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_4_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_4_30'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_4_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_4_32'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_4_33'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_4_34'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_4_35'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_4_36'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_4_37'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):\n                    return True, 'sell_profit_d_o_5_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_o_5_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_3'\n                elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_5_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_5_5'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_6'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_5_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_5_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_5_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_5_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_5_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_5_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_5_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_5_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_5_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_5_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_5_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_5_19'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_5_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_5_21'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_5_22'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_5_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_5_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_5_25'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_5_26'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_5_27'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_5_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_5_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_5_30'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_5_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_5_32'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_5_33'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_5_34'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_5_35'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_5_36'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_5_37'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_6_1'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_o_6_2'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_6_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_6_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_6_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_6_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_6_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_6_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_6_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_6_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_6_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_6_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_6_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_6_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_6_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_6_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_6_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_6_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_6_22'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_6_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_6_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_6_25'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_6_26'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_6_27'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_6_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_6_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_6_30'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_6_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_6_32'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_6_33'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_6_34'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_6_35'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_6_36'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_6_37'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_7_1'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_o_7_2'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_7_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_7_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_7_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_7_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_7_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_7_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_7_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_7_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_7_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_7_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_7_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_7_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_7_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_7_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_7_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_7_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_7_22'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_7_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_7_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_7_25'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_7_26'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_7_27'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_7_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_7_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_7_30'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_7_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_7_32'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_7_33'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_7_34'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_7_35'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_7_36'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_7_37'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):\n                    return True, 'sell_profit_d_o_8_1'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_2'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_8_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_8_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_8_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_8_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_8_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_8_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_8_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_8_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_8_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_8_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_8_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_8_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_8_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_8_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_8_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_8_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_8_22'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_8_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_8_25'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_8_26'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_8_27'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_8_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_8_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_8_30'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_8_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_8_32'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_8_33'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_8_34'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_8_35'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_36'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_8_37'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_9_1'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_2'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_9_4'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_9_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_7'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_9_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_9_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_9_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_9_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_9_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_9_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_9_14'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_9_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_9_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_9_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_9_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_9_19'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_9_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_9_21'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_9_22'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_9_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_9_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_9_25'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_9_26'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_9_27'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_9_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_9_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_9_30'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_9_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_9_32'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_9_33'\n                elif (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_9_34'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_9_35'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_9_36'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_9_37'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_10_1'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_o_10_2'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_10_4'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_10_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_6'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_7'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_10_8'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_10_9'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_10_10'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_10_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_10_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_10_13'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_10_14'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_10_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_10_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_10_17'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_10_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_10_19'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_10_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_10_21'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_10_22'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_10_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_10_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_10_25'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_10_26'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_10_27'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_10_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_10_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_10_30'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_10_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_10_32'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_10_33'\n                elif (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_10_34'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_10_35'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_10_36'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_10_37'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_11_1'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):\n                    return True, 'sell_profit_d_o_11_2'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_11_4'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_11_5'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_6'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_7'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_11_8'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_11_9'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_11_10'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_11_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_11_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_11_13'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_11_14'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_11_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_11_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_11_17'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_11_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_11_19'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_11_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_11_21'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_11_22'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_11_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_11_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_11_25'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_11_26'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_11_27'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_11_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_11_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_11_30'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_11_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_11_32'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_11_33'\n                elif (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_11_34'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_11_35'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_11_36'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_11_37'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):\n                    return True, 'sell_profit_d_o_12_1'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_o_12_2'\n                elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_o_12_4'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_o_12_5'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_6'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_7'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_o_12_8'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_o_12_9'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_o_12_10'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_o_12_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_o_12_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_o_12_13'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_12_14'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_12_15'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_12_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_o_12_17'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_o_12_18'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_o_12_19'\n                elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_12_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_12_21'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_12_22'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_o_12_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_12_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_o_12_25'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_12_26'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_o_12_27'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_o_12_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_o_12_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_o_12_30'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_o_12_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_o_12_32'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_o_12_33'\n                elif (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_o_12_34'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_o_12_35'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_12_36'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_o_12_37'\n        else:\n            if 0.02 > current_profit >= 0.01:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_1_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_1_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_1_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_1_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_7'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_1_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_1_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_1_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_1_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_1_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_1_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_1_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_1_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_1_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_1_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_1_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_1_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_1_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_1_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_1_22'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):\n                    return True, 'sell_profit_d_u_1_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_1_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_1_25'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_1_26'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_1_27'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_1_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_1_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_1_30'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_1_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_1_32'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_1_33'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_1_34'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_1_35'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_1_36'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_1_37'\n            elif 0.03 > current_profit >= 0.02:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_2_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_2_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_2_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_2_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_2_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_2_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_2_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_2_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_2_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_2_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_2_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_2_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_2_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_2_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_2_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_2_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_2_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_2_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_2_22'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):\n                    return True, 'sell_profit_d_u_2_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_2_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_2_25'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_2_26'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_2_27'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_2_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_2_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_2_30'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_2_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_2_32'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_2_33'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_2_34'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_2_35'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_2_36'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_2_37'\n            elif 0.04 > current_profit >= 0.03:\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_3_1'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_3_2'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_3_4'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_3_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_7'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_3_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_3_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_3_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_3_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_3_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_3_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_3_14'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_3_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_3_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_3_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_3_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_3_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_3_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_3_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_3_22'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_u_3_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_3_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_3_25'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_3_26'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_3_27'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_3_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_3_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_3_30'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_3_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_3_32'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_3_33'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_3_34'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_3_35'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_3_36'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_3_37'\n            elif 0.05 > current_profit >= 0.04:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_4_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_4_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_3'\n                elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_4_4'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_4_5'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_7'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_4_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_4_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_4_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_4_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_4_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_4_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_4_14'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_4_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_4_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_4_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_4_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_4_19'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_4_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_4_21'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_4_22'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):\n                    return True, 'sell_profit_d_u_4_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_4_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_4_25'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_4_26'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_4_27'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_4_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_4_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_4_30'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_4_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_4_32'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_4_33'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_4_34'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_4_35'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_4_36'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_4_37'\n            elif 0.06 > current_profit >= 0.05:\n                if (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_5_1'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):\n                    return True, 'sell_profit_d_u_5_2'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_3'\n                elif (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_5_4'\n                elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_5_5'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_6'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_7'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_5_8'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_5_9'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_5_10'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_5_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 55.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_5_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_5_13'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_5_14'\n                elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_5_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_5_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_5_17'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_5_18'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_5_19'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_5_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_5_21'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_5_22'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_5_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_5_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_5_25'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_5_26'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_5_27'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_5_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_5_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_5_30'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_5_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_5_32'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_5_33'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_5_34'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_5_35'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_5_36'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_5_37'\n            elif 0.07 > current_profit >= 0.06:\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_6_1'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):\n                    return True, 'sell_profit_d_u_6_2'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_3'\n                elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_6_4'\n                elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_6_5'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_6'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_7'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_6_8'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_6_9'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_6_10'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_6_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_6_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_6_13'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_6_14'\n                elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_6_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_6_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_6_17'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_6_18'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_6_19'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_6_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_6_21'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_6_22'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_6_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_6_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_6_25'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_6_26'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_6_27'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_6_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_6_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_6_30'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_6_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_6_32'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_6_33'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_6_34'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_6_35'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_6_36'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_6_37'\n            elif 0.08 > current_profit >= 0.07:\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_7_1'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):\n                    return True, 'sell_profit_d_u_7_2'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_3'\n                elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_7_4'\n                elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_7_5'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_6'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_7'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_7_8'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_7_9'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_7_10'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_7_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_7_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_7_13'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_7_14'\n                elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_7_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_7_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_7_17'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_7_18'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_7_19'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_7_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_7_21'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_7_22'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_7_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_7_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_7_25'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_7_26'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_7_27'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_7_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_7_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_7_30'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_7_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_7_32'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_7_33'\n                elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_7_34'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_7_35'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_7_36'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_7_37'\n            elif 0.09 > current_profit >= 0.08:\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_8_1'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):\n                    return True, 'sell_profit_d_u_8_2'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_3'\n                elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_8_4'\n                elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_8_5'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_6'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_7'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_8_8'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_8_9'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_8_10'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_8_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_8_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_8_13'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_8_14'\n                elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_8_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_8_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_8_17'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_8_18'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_8_19'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_8_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_8_21'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_8_22'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_8_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_8_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_8_25'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_8_26'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_8_27'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_8_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_8_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_8_30'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_8_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_8_32'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_8_33'\n                elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_8_34'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_8_35'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_8_36'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_8_37'\n            elif 0.1 > current_profit >= 0.09:\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_9_1'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):\n                    return True, 'sell_profit_d_u_9_2'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_3'\n                elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_9_4'\n                elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_9_5'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_6'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_7'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_9_8'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_9_9'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_9_10'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_9_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_9_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_9_13'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_9_14'\n                elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_9_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_9_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_9_17'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_9_18'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_9_19'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_9_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_9_21'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_9_22'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_9_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_9_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_9_25'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_9_26'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_9_27'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_9_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_9_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_9_30'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_9_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_9_32'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_9_33'\n                elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_9_34'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_9_35'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_9_36'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_9_37'\n            elif 0.12 > current_profit >= 0.1:\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_10_1'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_2'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_3'\n                elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_10_4'\n                elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_10_5'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_6'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_7'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_10_8'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_10_9'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_10_10'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_10_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_10_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_10_13'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_10_14'\n                elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_10_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_10_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_10_17'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_10_18'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_10_19'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_10_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_10_21'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_10_22'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_10_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_10_25'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_10_26'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_10_27'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_10_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_10_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_10_30'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_10_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_10_32'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_10_33'\n                elif (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_10_34'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_10_35'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_36'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_10_37'\n            elif 0.2 > current_profit >= 0.12:\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_11_1'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_2'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_3'\n                elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_11_4'\n                elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_11_5'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_6'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_7'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_11_8'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_11_9'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_11_10'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_11_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_11_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_11_13'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_11_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_11_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_11_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_11_17'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_11_18'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_11_19'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_11_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_11_21'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_11_22'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_11_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_11_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_11_25'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_11_26'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_11_27'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_11_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_11_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_11_30'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_11_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_11_32'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_11_33'\n                elif (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_11_34'\n                elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_11_35'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_11_36'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_11_37'\n            elif current_profit >= 0.2:\n                if (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):\n                    return True, 'sell_profit_d_u_12_1'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):\n                    return True, 'sell_profit_d_u_12_2'\n                elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_3'\n                elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):\n                    return True, 'sell_profit_d_u_12_4'\n                elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):\n                    return True, 'sell_profit_d_u_12_5'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_6'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_7'\n                elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):\n                    return True, 'sell_profit_d_u_12_8'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):\n                    return True, 'sell_profit_d_u_12_9'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):\n                    return True, 'sell_profit_d_u_12_10'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):\n                    return True, 'sell_profit_d_u_12_11'\n                elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):\n                    return True, 'sell_profit_d_u_12_12'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):\n                    return True, 'sell_profit_d_u_12_13'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_12_14'\n                elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_12_15'\n                elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_12_16'\n                elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):\n                    return True, 'sell_profit_d_u_12_17'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):\n                    return True, 'sell_profit_d_u_12_18'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):\n                    return True, 'sell_profit_d_u_12_19'\n                elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_12_20'\n                elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_12_21'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_12_22'\n                elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):\n                    return True, 'sell_profit_d_u_12_23'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_12_24'\n                elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):\n                    return True, 'sell_profit_d_u_12_25'\n                elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_12_26'\n                elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):\n                    return True, 'sell_profit_d_u_12_27'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):\n                    return True, 'sell_profit_d_u_12_28'\n                elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):\n                    return True, 'sell_profit_d_u_12_29'\n                elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):\n                    return True, 'sell_profit_d_u_12_30'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):\n                    return True, 'sell_profit_d_u_12_31'\n                elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):\n                    return True, 'sell_profit_d_u_12_32'\n                elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):\n                    return True, 'sell_profit_d_u_12_33'\n                elif (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):\n                    return True, 'sell_profit_d_u_12_34'\n                elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                    return True, 'sell_profit_d_u_12_35'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_12_36'\n                elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):\n                    return True, 'sell_profit_d_u_12_37'\n\n        return False, None\n\n    def sell_pump_main(self, current_profit: float, last_candle) -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.9):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bull_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_48_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_48_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_48_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_48_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_48_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_48_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_48_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_48_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_48_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_48_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_48_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bear_48_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_48_1_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.8):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_2_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_2_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_2_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1):\n                        return True, 'sell_profit_p_bear_48_2_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.15):\n                        return True, 'sell_profit_p_bear_48_2_1_1'\n\n        if (last_candle['hl_pct_change_48_1h'] > 0.5):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bull_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bull_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bull_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bull_48_3_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):\n                        return True, 'sell_profit_p_bear_48_3_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):\n                        return True, 'sell_profit_p_bear_48_3_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):\n                        return True, 'sell_profit_p_bear_48_3_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):\n                        return True, 'sell_profit_p_bear_48_3_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.72):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 32.0):\n                        return True, 'sell_profit_p_bull_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bull_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bull_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bull_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bull_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bull_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bull_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bull_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 34.0):\n                        return True, 'sell_profit_p_bull_36_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 33.0):\n                        return True, 'sell_profit_p_bear_36_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_36_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bear_36_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bear_36_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_36_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bear_36_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_36_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bear_36_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bear_36_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bear_36_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bear_36_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bear_36_1_1_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.68):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 51.0):\n                        return True, 'sell_profit_p_bull_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 49.0):\n                        return True, 'sell_profit_p_bull_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 47.0):\n                        return True, 'sell_profit_p_bull_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 45.0):\n                        return True, 'sell_profit_p_bull_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 43.0):\n                        return True, 'sell_profit_p_bull_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 41.0):\n                        return True, 'sell_profit_p_bull_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 39.0):\n                        return True, 'sell_profit_p_bull_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 37.0):\n                        return True, 'sell_profit_p_bull_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 35.0):\n                        return True, 'sell_profit_p_bull_24_1_1_1'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_24_1_12_1'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_24_1_11_1'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_24_1_10_1'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['rsi_14'] < 52.0):\n                        return True, 'sell_profit_p_bear_24_1_9_1'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['rsi_14'] < 50.0):\n                        return True, 'sell_profit_p_bear_24_1_8_1'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['rsi_14'] < 48.0):\n                        return True, 'sell_profit_p_bear_24_1_7_1'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['rsi_14'] < 46.0):\n                        return True, 'sell_profit_p_bear_24_1_6_1'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['rsi_14'] < 44.0):\n                        return True, 'sell_profit_p_bear_24_1_5_1'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['rsi_14'] < 42.0):\n                        return True, 'sell_profit_p_bear_24_1_4_1'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['rsi_14'] < 40.0):\n                        return True, 'sell_profit_p_bear_24_1_3_1'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['rsi_14'] < 38.0):\n                        return True, 'sell_profit_p_bear_24_1_2_1'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['rsi_14'] < 36.0):\n                        return True, 'sell_profit_p_bear_24_1_1_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.5):\n            if (last_candle['ema_vwma_osc_96'] > 0.0):\n                if current_profit >= 0.2:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_12_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_12_2'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_11_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_10_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_9_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_8_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_7_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_6_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_5_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_4_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_3_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_2_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bull_24_2_1_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bull_24_2_1_2'\n            else:\n                if current_profit >= 0.2:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_12_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_12_2'\n                elif 0.2 > current_profit >= 0.12:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_11_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_11_2'\n                elif 0.12 > current_profit >= 0.1:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_10_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_10_2'\n                elif 0.1 > current_profit >= 0.09:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_9_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_9_2'\n                elif 0.09 > current_profit >= 0.08:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_8_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_8_2'\n                elif 0.08 > current_profit >= 0.07:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_7_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_7_2'\n                elif 0.07 > current_profit >= 0.06:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_6_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_6_2'\n                elif 0.06 > current_profit >= 0.05:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_5_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_5_2'\n                elif 0.05 > current_profit >= 0.04:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_4_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_4_2'\n                elif 0.04 > current_profit >= 0.03:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_3_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_3_2'\n                elif 0.03 > current_profit >= 0.02:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_2_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_2_2'\n                elif 0.02 > current_profit >= 0.01:\n                    if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):\n                        return True, 'sell_profit_p_bear_24_2_1_1'\n                    elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):\n                        return True, 'sell_profit_p_bear_24_2_1_2'\n\n        return False, None\n\n    def sell_pump_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['hl_pct_change_48_1h'] > 0.95):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.005)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_1'\n            elif (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_profit < 0.01)\n                    and (max_loss < 0.08)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_48_1_2'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.7):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_36_1_1'\n\n        if (last_candle['hl_pct_change_36_1h'] > 0.5):\n            if (\n                    (-0.05 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit > (current_profit + 0.1))\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n                    and (last_candle['rsi_14'] < 40.0)\n            ):\n                return True, 'sell_stoploss_p_36_2_1'\n\n        if (last_candle['hl_pct_change_24_1h'] > 0.6):\n            if (\n                    (-0.04 > current_profit > -0.08)\n                    and (max_loss < 0.08)\n                    and (max_profit < 0.01)\n                    and (last_candle['close'] < last_candle['ema_200'])\n                    and (last_candle['sma_200_dec_20'])\n                    and (last_candle['sma_200_dec_20_1h'])\n                    and (last_candle['ema_vwma_osc_32'] < 0.0)\n                    and (last_candle['ema_vwma_osc_64'] < 0.0)\n                    and (last_candle['ema_vwma_osc_96'] < 0.0)\n                    and (last_candle['cmf'] < -0.25)\n                    and (last_candle['cmf_15m'] < -0.25)\n                    and (last_candle['cmf_1h'] < -0.0)\n            ):\n                return True, 'sell_stoploss_p_24_1_1'\n\n\n        return False, None\n\n    def sell_pivot(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.2)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):\n                    return True, 'sell_profit_pv_1_12_1'\n\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.1)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_1_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_1_2'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_2_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_2_2'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_3_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_3_2'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_4_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_4_2'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_5_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_5_2'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_6_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_6_2'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_7_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_7_2'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_8_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_8_2'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_9_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_9_2'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_10_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_10_2'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_11_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_11_2'\n            elif (current_profit >= 0.2):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_12_1'\n                elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_2_12_2'\n\n        if (last_candle['close'] > (last_candle['res1_1d'] * 1.0)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['rsi_14'] < 36.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['rsi_14'] < 35.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['rsi_14'] < 34.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):\n                    return True, 'sell_profit_pv_3_12_1'\n\n        if (last_candle['close'] > (last_candle['res3_1d'] * 1.8)):\n            if (0.02 > current_profit >= 0.01):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_1_1'\n            elif (0.03 > current_profit >= 0.02):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_2_1'\n            elif (0.04 > current_profit >= 0.03):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_3_1'\n            elif (0.05 > current_profit >= 0.04):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_4_1'\n            elif (0.06 > current_profit >= 0.05):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_5_1'\n            elif (0.07 > current_profit >= 0.06):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_6_1'\n            elif (0.08 > current_profit >= 0.07):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_7_1'\n            elif (0.09 > current_profit >= 0.08):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_8_1'\n            elif (0.1 > current_profit >= 0.09):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_9_1'\n            elif (0.12 > current_profit >= 0.1):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_10_1'\n            elif (0.2 > current_profit >= 0.12):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_11_1'\n            elif (current_profit >= 0.2):\n                if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):\n                    return True, 'sell_profit_pv_4_12_1'\n\n        return False, None\n\n    def sell_long_mode(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:\n        \n        # wieger hack\n        \n        #if(np.isclose(last_candle[self.sell_cat.value], self.sell_val0.value)):\n        #    return True, 'sell_long_yolo'\n        \n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return True, signal_name\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return True, signal_name\n        \n        IND = 'trend_kst_diff'\n        REAL = self.sell_real.value\n        OPR = self.sell_cat.value\n        DFIND = last_candle[IND]\n        # print(DFIND.mean())\n\n        if OPR == \">R\" and DFIND > REAL:\n            return True, 'sell_profit_w_12_long_Wieger_1'\n        elif OPR == \"=R\" and np.isclose(DFIND, REAL):\n            return True, 'sell_profit_w_12_long_Wieger_2'\n        elif OPR == \"<R\" and DFIND < REAL:\n            return True, 'sell_profit_w_12_long_Wieger_Final'\n        \n        #if (last_candle[self.sell_cat.value] > self.sell_val0.value):\n        #        return True, 'sell_profit_w_12_long_Wieger'\n        \n        #if(np.isclose(last_candle[self.sell_cat.value], 0.9455)):\n        #    return True, 'sell_long_yolo'\n\n        return False, None\n\n        if (0.0 < current_profit <= 0.02) and (max_profit - current_profit > 0.025) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_0'\n        elif (0.02 < current_profit <= 0.04) and (max_profit - current_profit > 0.03) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_1'\n        elif (0.04 < current_profit <= 0.06) and (max_profit - current_profit > 0.035) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_2'\n        elif (0.06 < current_profit <= 0.08) and (max_profit - current_profit > 0.04) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_3'\n        elif (0.08 < current_profit <= 0.1) and (max_profit - current_profit > 0.045) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_4'\n        elif (0.1 < current_profit <= 0.12) and (max_profit - current_profit > 0.05) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_5'\n        elif (0.12 < current_profit <= 0.14) and (max_profit - current_profit > 0.055) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_6'\n        elif (0.14 < current_profit <= 0.16) and (max_profit - current_profit > 0.06) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_7'\n        elif (0.16 < current_profit <= 0.18) and (max_profit - current_profit > 0.065) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.18 < current_profit <= 0.2) and (max_profit - current_profit > 0.07) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_8'\n        elif (0.2 < current_profit <= 0.3) and (max_profit - current_profit > 0.075) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_9'\n        elif (0.3 < current_profit <= 0.4) and (max_profit - current_profit > 0.08) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_10'\n        elif (0.4 < current_profit <= 0.5) and (max_profit - current_profit > 0.085) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_11'\n        elif (0.5 < current_profit <= 1.0) and (max_profit - current_profit > 0.09) and (last_candle['cmf'] < 0.0):\n            return True, 'sell_long_t_12'\n\n        return False, None\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n        previous_candle_2 = dataframe.iloc[-3]\n        previous_candle_3 = dataframe.iloc[-4]\n        previous_candle_4 = dataframe.iloc[-5]\n        previous_candle_5 = dataframe.iloc[-6]\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        # Long mode\n        if all(c in ['31', '32', '33', '34', '35', '36', '69'] for c in buy_tags):\n            sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n            if sell and (signal_name is not None):\n                return f\"{signal_name} ( {buy_tag})\"\n            # Skip remaining sell logic for long mode\n            return None\n\n        # Original sell signals\n        sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, buy_tag)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Stoplosses\n        sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Over EMA200, main profit targets\n        sell, signal_name = self.sell_over_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Under EMA200, main profit targets\n        sell, signal_name = self.sell_under_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Williams %R based sells\n        sell, signal_name = self.sell_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Trailing\n        sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is descending\n        sell, signal_name = self.sell_dec_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Sell logic for pumped pairs\n        sell, signal_name = self.sell_pump_main(current_profit, last_candle)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # The pair is pumped, stoploss\n        sell, signal_name = self.sell_pump_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        # Pivot points based sells\n        sell, signal_name = self.sell_pivot(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)\n        if sell and (signal_name is not None):\n            return f\"{signal_name} ( {buy_tag})\"\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        if method == 'HL':\n            return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()\n        elif method == 'OC':\n            return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]\n        informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])\n        informative_pairs.extend([(pair, self.info_timeframe_15m) for pair in pairs])\n\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        informative_pairs.append((btc_info_pair, self.timeframe))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1d))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_1h))\n        informative_pairs.append((btc_info_pair, self.info_timeframe_15m))\n        return informative_pairs\n\n    def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)\n\n        # Top traded coins\n        if self.coin_metrics['top_traded_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')\n            informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n        # Top grossing coins\n        if self.coin_metrics['top_grossing_enabled']:\n            informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')\n            informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)\n            column_names = [f\"Coin #{i}\" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]\n            informative_1d.drop(columns = column_names, inplace=True)\n\n        # Pivots\n        informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')\n\n        # Smoothed Heikin-Ashi\n        informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)\n\n        # S/R\n        res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n        informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()\n        informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1d\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)\n        \n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative_1h)\n        informative_1h['ha_close'] = inf_heikinashi['close']\n        informative_1h['rocr'] = ta.ROCR(informative_1h['ha_close'], timeperiod=168)\n\n        # RSI\n        informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)\n        \n        informative_1h['rmi_length_17'] = RMI(dataframe, length=17, mom=4)\n        informative_1h['cci_length_25'] = ta.CCI(dataframe, 25)\n\n        # EMAs\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n        informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])\n\n        # CMF\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # CTI\n        informative_1h['cti'] = pta.cti(informative_1h[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_1h['crsi'] =  (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3\n\n        # Williams %R\n        informative_1h['r_14'] = williams_r(informative_1h, period=14)\n        informative_1h['r_480'] = williams_r(informative_1h, period=480)\n\n        # EWO\n        informative_1h['ewo'] = ewo(informative_1h, 50, 200)\n\n        # ROC\n        informative_1h['roc_9'] = ta.ROC(informative_1h, timeperiod=9)\n\n        # T3 Average\n        informative_1h['t3_avg'] = t3_average(informative_1h)\n\n        # S/R\n        res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: self.is_resistance(row), raw=True).shift(2)\n        sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: self.is_support(row), raw=True).shift(2)\n        informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n        informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()\n        informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n        informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)\n        informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_1h\n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)\n\n        # RSI\n        informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)\n\n        # EMAs\n        informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)\n        informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)\n        informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)\n        informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=25)\n        informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)\n        informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)\n        informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)\n\n        # SMA\n        informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)\n        informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)\n        informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)\n\n        informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)\n        informative_15m['bb20_2_low'] = bollinger['lower']\n        informative_15m['bb20_2_mid'] = bollinger['mid']\n        informative_15m['bb20_2_upp'] = bollinger['upper']\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)\n        informative_15m['bb40_2_low'] = bb_40_std2['lower']\n        informative_15m['bb40_2_mid'] = bb_40_std2['mid']\n        informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()\n        informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()\n        informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()\n\n        # CMF\n        informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)\n\n        # CTI\n        informative_15m['cti'] = pta.cti(informative_15m[\"close\"], length=20)\n\n        # Williams %R\n        informative_15m['r_14'] = williams_r(informative_15m, period=14)\n        informative_15m['r_64'] = williams_r(informative_15m, period=64)\n        informative_15m['r_96'] = williams_r(informative_15m, period=96)\n\n        # EWO\n        informative_15m['ewo'] = ewo(informative_15m, 50, 200)\n\n        # CCI\n        informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        informative_15m['crsi'] =  (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return informative_15m\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n\n        # RSI\n        dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        \n        dataframe['rmi_length_17'] = RMI(dataframe, length=17, mom=4)\n        dataframe['cci_length_25'] = ta.CCI(dataframe, 25)\n\n        # EMAs\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)\n        dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        \n        dataframe['trend_ichimoku_base'] = ta2.trend.ichimoku_base_line(\n            dataframe['high'],\n            dataframe['low'],\n            window1=self.ichimoku_window1.value,\n            window2=self.ichimoku_window2.value,\n            visual=False,\n            fillna=False\n        )\n        KST = ta2.trend.KSTIndicator(\n            close=dataframe['close'],\n            roc1=self.kst_roc1.value,\n            roc2=self.kst_roc2.value,\n            roc3=self.kst_roc3.value,\n            roc4=self.kst_roc4.value,\n            window1=self.kst_window1.value,\n            window2=self.kst_window2.value,\n            window3=self.kst_window3.value,\n            window4=self.kst_window4.value,\n            nsig=9,\n            fillna=False\n        )\n        \n        dataframe['trend_kst_diff'] = KST.kst_diff()\n        \n        # Normalisation\n        tib = dataframe['trend_ichimoku_base']\n        dataframe['trend_ichimoku_base'] = (\n            tib-tib.min())/(tib.max()-tib.min())\n        \n        tkd = dataframe['trend_kst_diff']\n        dataframe['trend_kst_diff'] = (tkd-tkd.min())/(tkd.max()-tkd.min())\n        \n        # SMA\n        dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)\n        dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low'] = bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n        \n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # BB 20 - STD3\n        bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb20_3_low'] = bb_20_std3['lower']\n        dataframe['bb20_3_mid'] = bb_20_std3['mid']\n        dataframe['bb20_3_upp'] = bb_20_std3['upper']\n\n        dataframe['bb20_width'] = ((dataframe['bb20_2_upp'] - dataframe['bb20_2_low']) / dataframe['bb20_2_mid'])\n        dataframe['bb20_delta'] = ((dataframe['bb20_2_low'] - dataframe['bb20_3_low']) / dataframe['bb20_2_low'])\n\n        # CMF\n        dataframe['cmf'] = chaikin_money_flow(dataframe, 20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n        dataframe['r_24'] = williams_r(dataframe, period=24)\n        dataframe['r_32'] = williams_r(dataframe, period=32)\n        dataframe['r_64'] = williams_r(dataframe, period=64)\n        dataframe['r_96'] = williams_r(dataframe, period=96)\n        dataframe['r_480'] = williams_r(dataframe, period=480)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # CRSI (3, 2, 100)\n        crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)\n        crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))\n        dataframe['crsi'] =  (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3\n\n        # EMA of VWMA Oscillator\n        dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)\n        dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)\n        dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)\n\n        # EWO\n        dataframe['ewo'] = ewo(dataframe, 50, 200)\n\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)\n        dataframe['cci_25'] = ta.CCI(dataframe, source='hlc3', timeperiod=25)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # RMI\n        dataframe['rmi_17'] = RMI(dataframe, length=17, mom=4)\n\n        # Stochastic fast\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # STOCHRSI\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        # Close delta\n        dataframe['close_delta'] = (dataframe['close'] - dataframe['close'].shift(1)).abs()\n\n        # T3 Average\n        dataframe['t3_avg'] = t3_average(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['ha_tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        \n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n        \n        # Profit Maximizer - PMAX\n        dataframe['pm'], dataframe['pmx'] = pmax(heikinashi, MAtype=1, length=9, multiplier=27, period=10, src=3)\n        dataframe['source'] = (dataframe['high'] + dataframe['low'] + dataframe['open'] + dataframe['close'])/4\n        dataframe['pmax_thresh'] = ta.EMA(dataframe['source'], timeperiod=9)\n\n        # True range\n        dataframe['trange'] = ta.TRANGE(dataframe)\n        \n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb40_2_mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n\n        # KC\n        dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)\n        dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']\n        dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']\n\n        # Linreg\n        dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)\n        dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)\n        dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2.0\n        dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)\n        dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2.0\n        dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)\n\n        # ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high_thresh_1'] = (dataframe['high'] - (dataframe['atr'] * 5.4))\n        dataframe['atr_high_thresh_2'] = (dataframe['high'] - (dataframe['atr'] * 5.2))\n        dataframe['atr_high_thresh_3'] = (dataframe['high'] - (dataframe['atr'] * 5.0))\n        dataframe['atr_high_thresh_4'] = (dataframe['high'] - (dataframe['atr'] * 2.6))\n\n        # For sell checks\n        dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])\n\n        # Volume\n        dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)\n        dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)\n        dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)\n        dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        if not self.config['runmode'].value in ('live', 'dry_run'):\n            # Backtest age filter\n            dataframe['bt_agefilter_ok'] = False\n            dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True\n        else:\n            # Exchange downtime protection\n            dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        # Indicators\n        # -----------------------------------------------------------------------------------------\n        dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')\n\n        # Add prefix\n        # -----------------------------------------------------------------------------------------\n        ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']\n        dataframe.rename(columns=lambda s: f\"btc_{s}\" if s not in ignore_columns else s, inplace=True)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        '''\n        --> BTC informative (5m/1h)\n        ___________________________________________________________________________________________\n        '''\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        if self.has_BTC_daily_tf:\n            btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')\n            btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)\n            drop_columns = [f\"{s}_1d\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_info_tf:\n            btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)\n            btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.has_BTC_base_tf:\n            btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)\n            btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)\n            dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)\n            drop_columns = [f\"{s}_{self.timeframe}\" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Informative timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.info_timeframe_1d != 'none':\n            informative_1d = self.informative_1d_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1d}\" for s in ['date','open', 'high', 'low', 'close', 'volume']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_1h != 'none':\n            informative_1h = self.informative_1h_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_1h}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        if self.info_timeframe_15m != 'none':\n            informative_15m = self.informative_15m_indicators(dataframe, metadata)\n            dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.info_timeframe_15m, ffill=True)\n            drop_columns = [f\"{s}_{self.info_timeframe_15m}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> Resampled to another timeframe\n        ___________________________________________________________________________________________\n        '''\n        if self.res_timeframe != 'none':\n            resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))\n            resampled = self.resampled_tf_indicators(resampled, metadata)\n            # Merge resampled info dataframe\n            dataframe = resampled_merge(dataframe, resampled, fill_na=True)\n            dataframe.rename(columns=lambda s: f\"{s}_{self.res_timeframe}\" if \"resample_\" in s else s, inplace=True)\n            dataframe.rename(columns=lambda s: s.replace(\"resample_{}_\".format(self.res_timeframe.replace(\"m\",\"\")), \"\"), inplace=True)\n            drop_columns = [f\"{s}_{self.res_timeframe}\" for s in ['date']]\n            dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n\n        '''\n        --> The indicators for the normal (5m) timeframe\n        ___________________________________________________________________________________________\n        '''\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        tok = time.perf_counter()\n        log.debug(f\"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.\")\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        for index in self.buy_protection_params:\n            item_buy_protection_list = [True]\n            global_buy_protection_params = self.buy_protection_params[index]\n\n            if self.buy_params[f\"buy_condition_{index}_enable\"]:\n                # Standard protections - Common to every condition\n                # -----------------------------------------------------------------------------------------\n                if global_buy_protection_params[\"ema_fast\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_fast_len']}\"] > dataframe['ema_200'])\n                if global_buy_protection_params[\"ema_slow\"]:\n                    item_buy_protection_list.append(dataframe[f\"ema_{global_buy_protection_params['ema_slow_len']}_1h\"] > dataframe['ema_200_1h'])\n                if global_buy_protection_params[\"close_above_ema_fast\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_fast_len']}\"])\n                if global_buy_protection_params[\"close_above_ema_slow\"]:\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h\"])\n                if global_buy_protection_params[\"sma200_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))\n                if global_buy_protection_params[\"sma200_1h_rising\"]:\n                    item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))\n                if global_buy_protection_params[\"safe_dips_threshold_0\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params[\"safe_dips_threshold_0\"])\n                if global_buy_protection_params[\"safe_dips_threshold_2\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params[\"safe_dips_threshold_2\"])\n                if global_buy_protection_params[\"safe_dips_threshold_12\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params[\"safe_dips_threshold_12\"])\n                if global_buy_protection_params[\"safe_dips_threshold_144\"] is not None:\n                    item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params[\"safe_dips_threshold_144\"])\n                if global_buy_protection_params[\"safe_pump_6h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params[\"safe_pump_6h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_12h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params[\"safe_pump_12h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_24h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params[\"safe_pump_24h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_36h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params[\"safe_pump_36h_threshold\"])\n                if global_buy_protection_params[\"safe_pump_48h_threshold\"] is not None:\n                    item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params[\"safe_pump_48h_threshold\"])\n                if global_buy_protection_params['btc_1h_not_downtrend']:\n                    item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])\n                if global_buy_protection_params['close_over_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] > dataframe[f\"{global_buy_protection_params['close_over_pivot_type']}_1d\"] * global_buy_protection_params['close_over_pivot_offset'])\n                if global_buy_protection_params['close_under_pivot_type'] != 'none':\n                    item_buy_protection_list.append(dataframe['close'] < dataframe[f\"{global_buy_protection_params['close_under_pivot_type']}_1d\"] * global_buy_protection_params['close_under_pivot_offset'])\n                if not self.config['runmode'].value in ('live', 'dry_run'):\n                    if self.has_bt_agefilter:\n                        item_buy_protection_list.append(dataframe['bt_agefilter_ok'])\n                else:\n                    if self.has_downtime_protection:\n                        item_buy_protection_list.append(dataframe['live_data_ok'])\n\n                # Buy conditions\n                # -----------------------------------------------------------------------------------------\n                item_buy_logic = []\n                item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))\n\n                # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.\n                if index == 1:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(12).min()) / dataframe['open'].rolling(12).min()) > 0.027)\n                    item_buy_logic.append(dataframe['rsi_14'] < 35.0)\n                    item_buy_logic.append(dataframe['r_32'] < -80.0)\n                    item_buy_logic.append(dataframe['mfi'] < 31.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 30.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 84.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] > -99.0)\n\n                # Condition #2 - Semi swing. Local dip.\n                elif index == 2:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14'] < (dataframe['rsi_14_1h'] - 51.0))\n                    item_buy_logic.append(dataframe['mfi'] < 46.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -80.0)\n                    item_buy_logic.append(dataframe['r_480'] > -95.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.88)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 1.0))\n\n                # Condition #3 - Semi swing. Local dip.\n                elif index == 3:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.96))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.05))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.022))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.24))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.83)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 15.0)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 1.75))\n                    item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))\n\n                # Condition #4 - Semi swing. Local dip.\n                elif index == 4:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.93))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.992))\n                    item_buy_logic.append(dataframe['mfi'] > 18.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.82)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #5 - Semi swing. Local dip. Uptrend.\n                elif index == 5:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo'] > 3.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.93)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #6 - Semi swing. Local dip.\n                elif index == 6:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.93))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.937)\n                    item_buy_logic.append(dataframe['crsi'] < 30.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.78)\n                    item_buy_logic.append(dataframe['cci'] < -200.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -12.0)\n\n                # Condition #7 - Semi swing. Local dip.\n                elif index == 7:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.94)\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.995)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -95.0)\n\n                # Condition #8 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 8:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.927)\n                    item_buy_logic.append(dataframe['ewo'] > 3.2)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n\n                # Condition #9 - Semi swing. Local dip. Downtrend.\n                elif index == 9:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.99)\n                    item_buy_logic.append(dataframe['cti'] < -0.92)\n                    item_buy_logic.append(dataframe['ewo'] < -4.8)\n                    item_buy_logic.append(dataframe['cti_1h'] < -0.88)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 18.0)\n\n                # Condition #10 - Semi swing. Local dip.\n                elif index == 10:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.017))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.965)\n                    item_buy_logic.append(dataframe['cti'] < -0.87)\n\n                # Condition #11 - Semi swing. Local dip.\n                elif index == 11:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.027))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.938)\n                    item_buy_logic.append(dataframe['rsi_14'] < 25.0)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 5.0))\n\n                # Condition #12 - Semi swing. Local deeper dip. Uptrend.\n                elif index == 12:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo'] > 0.1)\n                    item_buy_logic.append(dataframe['rsi_14'] < 40.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 2.8))\n\n                # Condition #13 - Semi swing. Downtrend. Local dip.\n                elif index == 13:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.999)\n                    item_buy_logic.append(dataframe['ewo'] < -5.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 12.0)\n\n                # Condition #14 - Semi swing. Strong uptrend. Local dip.\n                elif index == 14:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.98)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.984))\n                    item_buy_logic.append(dataframe['ewo'] > 7.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.7)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.5)\n\n                # Condition #15 - Semi swing. Uptrend. Local dip.\n                elif index == 15:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))\n                    item_buy_logic.append(dataframe['ewo'] > 2.2)\n                    item_buy_logic.append(dataframe['rsi_14'] < 28.5)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.4)\n\n                # Condition #16 - Semi swing. Cross above.\n                elif index == 16:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 50.0)\n                    item_buy_logic.append(dataframe['cti'] < 0.5)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 67.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.25)\n\n                # Condition #17 - Semi swing. Deep buy.\n                elif index == 17:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['r_480'] < -90.0)\n                    item_buy_logic.append(dataframe['r_14'] < -99.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -93.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < 33.0)\n\n                # Condition #18 - Semi swing. Local dip. BTC not negative.\n                elif index == 18:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.982))\n\n                # Condition #19 - Semi swing. Uptrend. Local dip.  BTC not downtrend.\n                elif index == 19:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.28))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.75)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.25)\n\n                # Condition #20 - Semi swing. Uptrend. Local dip.\n                elif index == 20:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.942))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['ewo'] > 4.8)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n\n                # Condition #21 - Semi swing. Deep local dip. Mild uptrend.\n                elif index == 21:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.941)\n                    item_buy_logic.append(dataframe['ewo'] > 2.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.84)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -87.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.8)\n\n                # Condition #22 - Swing. Uptrend. Bounce from daily support level\n                elif index == 22:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close_1h'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['sup_level_1d'] * 1.05)\n                    item_buy_logic.append(dataframe['low_1h'] < dataframe['sup_level_1d'] * 0.99)\n                    item_buy_logic.append(dataframe['close_1h'] < dataframe['res_level_1h'])\n                    item_buy_logic.append(dataframe['res_level_1d'] > dataframe['sup_level_1d'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 39.8)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] > 48.0)\n\n                    # Confirm uptrend - Heikin-Ashi\n                    item_buy_logic.append(dataframe['open_sha_1d'] < dataframe['close_sha_1d'])\n                    item_buy_logic.append(dataframe['open_sha_1d'].shift(288) < dataframe['close_sha_1d'].shift(288))\n                    item_buy_logic.append(dataframe['pivot_1d'] > dataframe['pivot_1d'].shift(288) * 0.95)\n\n                # Condition #23 - Semi swing. Downtrend. Local dip.\n                elif index == 23:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'].shift(1) < -6.4)\n                    item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)\n                    item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 2.0)\n\n                # Condition #24 - Semi swing. Uptrend. 1h uptrend. Local dip.\n                elif index == 24:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] > 5.4)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['r_96'] < -90.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 2.8)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.92)\n\n                # Condition #25 - Semi swing. CMF 1h cross.\n                elif index == 25:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n                    item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)\n                    item_buy_logic.append(dataframe['cmf_1h'] > 0.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 33.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.0)\n\n                # Condition #26 - Semi swing. Local deep dip.\n                elif index == 26:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.93)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -94.0)\n\n                # Condition #27 - Semi swing. Local deep. Uptrend.\n                elif index == 27:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.934)\n                    item_buy_logic.append(dataframe['ewo'] > 6.4)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n\n                # Condition #28 - Semi swing. Downtrend. Local deep.\n                elif index == 28:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.96)\n                    item_buy_logic.append(dataframe['ewo'] < -8.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #29 - Semi swing. Downtrend. Local deep.\n                elif index == 29:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.982))\n                    item_buy_logic.append(dataframe['ewo'] < -16.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n\n                # Condition #30 - Semi swing. Local dip. BTC not downtrend.\n                elif index == 30:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))\n\n                # Condition #31 - Long mode. Local dip.\n                elif index == 31:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.028))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.25))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #32 - Long mode. Local dip.\n                elif index == 32:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.046))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n\n                # Condition #33 - Long mode. Local dip. Uptrend.\n                elif index == 33:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.934))\n                    item_buy_logic.append(dataframe['ewo'] > 2.5)\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['ewo_1h'] > 0.1)\n\n                # Condition #34 - Long mode. Local dip.\n                elif index == 34:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.972))\n                    item_buy_logic.append(dataframe['cti'] < -0.8)\n                    item_buy_logic.append(dataframe['rsi_14'] < 18.0)\n\n                # Condition #35 - Long mode. Local deep dip.\n                elif index == 35:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_25'] * 0.85)\n                    item_buy_logic.append(dataframe['close'] > dataframe['open'])\n                    item_buy_logic.append(dataframe['rsi_14'] < 46.0)\n                    item_buy_logic.append(dataframe['mfi'] < 36.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.85)\n\n                # Condition #36 - Long mode. Uptrend. Local dip.\n                elif index == 36:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.97)\n                    item_buy_logic.append(dataframe['rsi_14'] < 34.0)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_64'] < -80.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))\n                    item_buy_logic.append(dataframe['r_480_1h'] < -30.0)\n\n                # Condition #37 - Semi swing. Uptrend. Local dip.\n                elif index == 37:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))\n                    item_buy_logic.append(dataframe['r_14'] < -94.0)\n                    item_buy_logic.append(dataframe['r_64'] < -75.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -20.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)\n\n                # Condition #38 - Semi swing. Uptrend. Local dip.\n                elif index == 38:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n                    item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))\n                    item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n                    item_buy_logic.append(dataframe['r_64'] < -66.0)\n                    item_buy_logic.append(dataframe['r_96'] < -50.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -1.0)\n\n                # Condition #39 - Semi swing. Uptrend. Local dip.\n                elif index == 39:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.0114))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.05))\n                    item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.01))\n                    item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5))\n                    item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n                    item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n                    item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.0))\n\n                # Condition #40 - Semi swing. Uptrend. Local dip.\n                elif index == 40:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.97)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['r_14'] < -90.0)\n                    item_buy_logic.append(dataframe['r_64'] < -80.0)\n                    item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)\n\n                # Condition #41 - 15m. Semi swing. Local dip. BTC not downtrend.\n                elif index == 41:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998))\n                    item_buy_logic.append(dataframe['cti'] < -0.75)\n\n                # Condition #42 - 15m. Semi swing. Local dip. 15m uptrend.\n                elif index == 42:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.92))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.8)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 36.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n                    item_buy_logic.append(dataframe['mfi'] > 24.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -5.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n\n                # Condition #43 - 15m. Semi swing. Local dip. 1h uptrend.\n                elif index == 43:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_low_15m'].shift().gt(0))\n                    item_buy_logic.append(dataframe['bb40_2_delta_15m'].gt(dataframe['close_15m'] * 0.045))\n                    item_buy_logic.append(dataframe['closedelta_15m'].gt(dataframe['close_15m'] * 0.034))\n                    item_buy_logic.append(dataframe['tail_15m'].lt(dataframe['bb40_2_delta_15m'] * 0.18))\n                    item_buy_logic.append(dataframe['close_15m'].lt(dataframe['bb40_2_low_15m'].shift()))\n                    item_buy_logic.append(dataframe['close_15m'].le(dataframe['close_15m'].shift()))\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 30.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.85)\n                    item_buy_logic.append(dataframe['r_64_15m'] < -70.0)\n\n                # Condition #44 - 15m. Semi swing. Local deeper dip. 15m uptrend.\n                elif index == 44:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_200_15m'] > (dataframe['ema_200_15m'].shift(36) * 1.01))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_26_15m'] * 0.99)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 26.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))\n\n                # Condition #45 - 15m. Semi swing. Local deeper dip. 15m uptrend.\n                elif index == 45:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_50_15m'] > dataframe['ema_200_1h'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.934)\n                    item_buy_logic.append(dataframe['ewo_15m'] > 3.6)\n                    item_buy_logic.append(dataframe['cci_15m'] < -190.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -97.0)\n                    item_buy_logic.append((dataframe['rsi_14_1h'] + dataframe['rsi_14_15m']) < 70.0)\n\n                # Condition #46 - 15m. Semi swing. 1h uptrend.\n                elif index == 46:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.027))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.982))\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 14.0)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 5.0))\n\n                # Condition #47 - 15m. Semi swing. Local dip. 1h minor dip.\n                elif index == 47:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3))\n                    item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95))\n                    item_buy_logic.append(\n                        ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |\n                        ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h'])))\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -90.0)\n                    item_buy_logic.append(dataframe['r_14'] < -97.0)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 8.0)\n\n                # Condition #48 - 15m. Semi swing. Local deep. 15m uptrend.\n                elif index == 48:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95))\n                    item_buy_logic.append(dataframe['close_15m'] > (dataframe['open_15m'].shift(3)))\n                    item_buy_logic.append(dataframe['ewo_15m'] > 5.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.75)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)\n                    item_buy_logic.append(dataframe['cti'] < -0.5)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.1)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 18.0)\n\n                # Condition #49 - 15m. Semi swing. Local deeper dip.\n                elif index == 49:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.928)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] < 28.0)\n                    item_buy_logic.append(dataframe['crsi_15m'] > 18.0)\n\n                # Condition #50 - 15m. Semi swing. Deep local dip. Mild 15m uptrend.\n                elif index == 50:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.932)\n                    item_buy_logic.append(dataframe['ewo_15m'] > 1.8)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n                    item_buy_logic.append(dataframe['r_96_15m'] < -75.0)\n                    item_buy_logic.append(dataframe['rsi_14'] < 32.0)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -97.0)\n\n                # Condition #51 - 15m. Semi swing. Downtrend. Dip.\n                elif index == 51:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.942))\n                    item_buy_logic.append(dataframe['ewo_15m'] < -1.0)\n                    item_buy_logic.append(dataframe['rsi_14_15m'] > 29.0)\n                    item_buy_logic.append(dataframe['cti_15m'] < -0.84)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -94.0)\n                    item_buy_logic.append(dataframe['rsi_14'] > 30.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 1.0)\n\n                # Condition #52 - 15m Semi swing. Local dip. BTC not downtrend.\n                elif index == 52:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998))\n                    item_buy_logic.append(dataframe['crsi_1h'] > 10.0)\n\n                # Condition #53 - 15m. Semi swing. BTC not negative. Local dip.\n                elif index == 53:\n                    # Non-Standard protections (add below)\n                    item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))\n                    item_buy_logic.append(dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])\n                    item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))\n                    item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))\n                    item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))\n                    item_buy_logic.append(dataframe['r_14'] < -75.0)\n                    item_buy_logic.append(dataframe['cti_1h'] > -0.7)\n\n                # Condition #54 - 15m Semi swing. Uptrend. Local dip.\n                elif index == 54:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_15m'])\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.4)\n                    item_buy_logic.append(dataframe['r_14_15m'] < -96.0)\n                    item_buy_logic.append(dataframe['r_96_15m'] < -94.0)\n                    item_buy_logic.append(dataframe['r_14'] < -96.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 12.0)\n\n                # Condition #55 - 15m. Semi swing. Uptrend. Local dip.\n                elif index == 55:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'] > 7.0)\n                    item_buy_logic.append(dataframe['close_15m'] > (dataframe['close_15m'].shift(3)))\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.992))\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -95.0)\n                    item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -86.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['open'])\n\n                # Condition #56 - 15m. Semi swing. Downtrend. Local dip.\n                elif index == 56:\n                    # Non-Standard protections (add below)\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'].shift(3) < -14.8)\n                    item_buy_logic.append(dataframe['cti_15m'].shift(3).rolling(15).max() < -0.9)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -90.0)\n                    item_buy_logic.append(dataframe['r_14'] < -50.0)\n\n                # Condition #57 - 15m. Semi swing. Strong uptrend. Local dip. BTC not downtrend.\n                elif index == 57:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.92))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo_15m'].shift(3) > 6.5)\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_30_15m'].shift(3) * 0.988))\n                    item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.996))\n                    item_buy_logic.append(dataframe['rsi_14_15m'].shift(3) < 31.2)\n                    item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)\n                    item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -80.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['open'])\n\n                # Condition #58 - Semi swing. Local dip.\n                elif index == 58:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rmi_17'] < 49.0)\n                    item_buy_logic.append(dataframe['cci_25'] < -120.0)\n                    item_buy_logic.append(dataframe['srsi_fk'] < 32.0)\n                    item_buy_logic.append(dataframe['bb20_delta'] > 0.026)\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.095)\n                    item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 10.0 / 1000.0 )\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_3_low'] * 0.995))\n\n                # Condition #59 - Semi swing. Local dip.\n                elif index == 59:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ema_100'] < (dataframe['ema_200'] * 1.054))\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.34)\n                    item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_mid'] * 1.014))\n                    item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.78))\n                    item_buy_logic.append(dataframe['cti'] < -0.115)\n                    item_buy_logic.append(dataframe['r_14'] < -45.0)\n\n                # Condition #60 - Semi swing. Local dip.\n                elif index == 60:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['roc_9_1h'] < 86.0)\n                    item_buy_logic.append(dataframe['bb20_width_1h'] < 0.954)\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.75))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['rsi_4'] < 44.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.935)\n                    item_buy_logic.append(dataframe['ewo'] > -5.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 0.968)\n                    item_buy_logic.append(dataframe['rsi_14'] < 22.0)\n\n                # Condition #61 - Semi swing. Local dip. Stochastic fast cross.\n                elif index == 61:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['open'] < dataframe['ema_8'] * 1.147)\n                    item_buy_logic.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                    item_buy_logic.append(dataframe['fastk'] < 39.0)\n                    item_buy_logic.append(dataframe['fastd'] < 28.0)\n                    item_buy_logic.append(dataframe['adx'] > 13.0)\n                    item_buy_logic.append(dataframe['ewo'] > 3.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['cti_1h'] < 0.0)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -25.0)\n\n                # Condition #62 - Semi swing. Local dip. Downtrend.\n                elif index == 62:\n                    # Non-Standard protections\n\n                    # Logic\n                    item_buy_logic.append(dataframe['ewo'] < -8.2)\n\n                    item_buy_logic.append(dataframe['bb20_2_mid_1h'] >= dataframe['t3_avg_1h'])\n                    item_buy_logic.append(dataframe['t3_avg'] <= dataframe['ema_8'] * 1.121)\n                    item_buy_logic.append(dataframe['cti'] < -0.9)\n                    item_buy_logic.append(dataframe['r_14'] < -78.0)\n\n                # Condition #63 - Semi swing. Local dip. ClucHA.\n                elif index == 63:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))\n                    item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * 0.7))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb40_2_delta'] > dataframe['ha_close'] * 0.054)\n                    item_buy_logic.append(dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.017)\n                    item_buy_logic.append(dataframe['ha_tail'] < dataframe['bb40_2_delta'] * 1.14)\n                    item_buy_logic.append(dataframe['ha_close'] < dataframe['bb40_2_low'].shift())\n                    item_buy_logic.append(dataframe['ha_close'] < dataframe['ha_close'].shift())\n                    item_buy_logic.append(dataframe['roc_9_1h'] > 0.526)\n                    item_buy_logic.append(dataframe['r_480_1h'] < -12.0)\n                    item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 1.25))\n\n                # Condition #64 - Semi swing. Squeeze momentum.\n                elif index == 64:\n                    # Non-Standard protections\n                    item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.93))\n\n                    # Logic\n                    item_buy_logic.append(dataframe['bb20_2_low'] < dataframe['kc_lowerband_28_1'])\n                    item_buy_logic.append(dataframe['bb20_2_upp'] > dataframe['kc_upperband_28_1'])\n                    item_buy_logic.append(dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1))\n                    item_buy_logic.append(dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20'])\n                    item_buy_logic.append(dataframe['linreg_val_20'] < 0.0)\n                    item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * 0.981)\n                    item_buy_logic.append(dataframe['ewo'] < -4.0)\n                    item_buy_logic.append(dataframe['r_14'] < -46.0)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 20.0)\n                \n                elif index == 65:\n                    \n                    item_buy_logic.append(dataframe['rocr_1h'] > 0.04401)\n                    item_buy_logic.append(dataframe['bb40_2_low'].shift() > 0)\n                    item_buy_logic.append(dataframe['bb_delta_cluc'] > dataframe['ha_close'] * 0.02206)\n                    item_buy_logic.append(dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.04401)\n                    item_buy_logic.append(dataframe['tail'] < dataframe['bb_delta_cluc'] * 1.02515)\n                    item_buy_logic.append(dataframe['ha_close'] < dataframe['bb40_2_low'].shift())\n                    item_buy_logic.append(dataframe['ha_close'] < dataframe['ha_close'].shift())\n                \n                elif index == 66:\n                    item_buy_logic.append(dataframe['rmi_length_17'] < 49)\n                    item_buy_logic.append(dataframe['cci_length_25'] <= -116)\n                    item_buy_logic.append(dataframe['srsi_fk'] < 32)\n                    item_buy_logic.append(dataframe['bb20_delta'] > 0.025)\n                    item_buy_logic.append(dataframe['bb20_width'] > 0.095)\n                    item_buy_logic.append(dataframe['closedelta'] > dataframe['close'] * 17.922 / 1000 )\n                    item_buy_logic.append(dataframe['close'] < dataframe['bb20_3_low'] * 0.999)\n                \n                elif index == 67: # Improvement on signal 62\n                    item_buy_logic.append(dataframe['ewo'] < -9.442)\n                    item_buy_logic.append(dataframe['bb20_2_mid_1h'] >= dataframe['t3_avg_1h'])\n                    item_buy_logic.append(dataframe['t3_avg'] <= dataframe['ema_8'] * 1.121)\n                    item_buy_logic.append(dataframe['cti'] < -0.374)\n                    item_buy_logic.append(dataframe['r_14'] < -51.971)\n                \n                elif index == 68:\n                    item_buy_logic.append(dataframe['pm'] > dataframe['pmax_thresh'])\n                    item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.98)\n                    item_buy_logic.append(dataframe['ewo'] < -4.4)\n                    item_buy_logic.append(dataframe['cti'] < -0.95)\n                    item_buy_logic.append(dataframe['r_14'] < -97)\n                    item_buy_logic.append(dataframe['crsi_1h'] > 0.5)\n                \n                elif index == 69:\n                    \n                    IND = 'trend_ichimoku_base'\n                    REAL = self.buy_real.value\n                    OPR = self.buy_cat.value\n                    DFIND = dataframe[IND]\n                    # print(DFIND.mean())\n                    \n                    if OPR == \">R\":\n                        item_buy_logic.append(DFIND > REAL)\n                    elif OPR == \"=R\":\n                        item_buy_logic.append(np.isclose(DFIND, REAL))\n                    elif OPR == \"<R\":\n                        item_buy_logic.append(DFIND < REAL)\n                    \n\n                item_buy_logic.append(dataframe['volume'] > 0)\n                item_buy = reduce(lambda x, y: x & y, item_buy_logic)\n                dataframe.loc[item_buy, 'buy_tag'] += f\"{index} \"\n                conditions.append(item_buy)\n\n        if conditions:\n            dataframe.loc[:, 'buy'] = reduce(lambda x, y: x | y, conditions)\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[:, 'sell'] = 0\n\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,\n                            time_in_force: str, current_time: datetime, **kwargs) -> bool:\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n\n        if ((rate > dataframe['close'])):\n            slippage = ((rate / dataframe['close']) - 1.0)\n\n            if slippage < 0.038:\n                return True\n            else:\n                return False\n\n        return True\n\n    def confirm_trade_exit(self, pair: str, trade: \"Trade\", order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        \"\"\"\n        Called right before placing a regular sell order.\n        Timing for this function is critical, so avoid doing heavy computations or\n        network requests in this method.\n\n        For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/\n\n        When not implemented by a strategy, returns True (always confirming).\n\n        :param pair: Pair that's about to be sold.\n        :param trade: trade object.\n        :param order_type: Order type (as configured in order_types). usually limit or market.\n        :param amount: Amount in quote currency.\n        :param rate: Rate that's going to be used when using limit orders\n        :param time_in_force: Time in force. Defaults to GTC (Good-til-cancelled).\n        :param sell_reason: Sell reason.\n            Can be any of ['roi', 'stop_loss', 'stoploss_on_exchange', 'trailing_stop_loss',\n                           'sell_signal', 'force_sell', 'emergency_sell']\n        :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.\n        :return bool: When True is returned, then the sell-order is placed on the exchange.\n            False aborts the process\n        \"\"\"\n        if self._should_hold_trade(trade, rate, sell_reason):\n            return False\n        if (sell_reason == 'stop_loss'):\n            return False\n        return True\n\n    def _should_hold_trade(self, trade: \"Trade\", rate: float, sell_reason: str) -> bool:\n        if self.config['runmode'].value not in ('live', 'dry_run'):\n            return False\n\n        if not self.holdSupportEnabled:\n            return False\n\n        # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop\n        self.load_hold_trades_config()\n\n        if not self.hold_trades_cache:\n            # Cache hasn't been setup, likely because the corresponding file does not exist, sell\n            return False\n\n        if not self.hold_trades_cache.data:\n            # We have no pairs we want to hold until profit, sell\n            return False\n\n        # By default, no hold should be done\n        hold_trade = False\n\n        trade_ids: dict = self.hold_trades_cache.data.get(\"trade_ids\")\n        if trade_ids and trade.id in trade_ids:\n            trade_profit_ratio = trade_ids[trade.id]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        trade_pairs: dict = self.hold_trades_cache.data.get(\"trade_pairs\")\n        if trade_pairs and trade.pair in trade_pairs:\n            trade_profit_ratio = trade_pairs[trade.pair]\n            current_profit_ratio = trade.calc_profit_ratio(rate)\n            if sell_reason == \"force_sell\":\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Force selling %s even though the current profit of %s < %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n            elif current_profit_ratio >= trade_profit_ratio:\n                # This pair is on the list to hold, and we reached minimum profit, sell\n                formatted_profit_ratio = f\"{trade_profit_ratio * 100}%\"\n                formatted_current_profit_ratio = f\"{current_profit_ratio * 100}%\"\n                log.warning(\n                    \"Selling %s because the current profit of %s >= %s\",\n                    trade, formatted_current_profit_ratio, formatted_profit_ratio\n                )\n                return False\n\n            # This pair is on the list to hold, and we haven't reached minimum profit, hold\n            hold_trade = True\n\n        return hold_trade\n\n# Elliot Wave Oscillator\ndef ewo(dataframe, sma1_length=5, sma2_length=35):\n    sma1 = ta.EMA(dataframe, timeperiod=sma1_length)\n    sma2 = ta.EMA(dataframe, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / dataframe['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= dataframe['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / dataframe['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    vwma = vwma.fillna(0, inplace=True)\n    return vwma\n\n# Exponential moving average of a volume weighted simple moving average\ndef ema_vwma_osc(dataframe, len_slow_ma):\n    slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))\n    return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100\n\ndef t3_average(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe1'].fillna(0, inplace=True)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe2'].fillna(0, inplace=True)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe3'].fillna(0, inplace=True)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe4'].fillna(0, inplace=True)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe5'].fillna(0, inplace=True)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    df['xe6'].fillna(0, inplace=True)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n\ndef pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:\n    hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3\n    hl_range = (dataframe['high'] - dataframe['low']).shift(1)\n    if mode == 'simple':\n        res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)\n        sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)\n        res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()\n        sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()\n        res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()\n        sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()\n    elif mode == 'fibonacci':\n        res1 = hlc3_pivot + 0.382 * hl_range\n        sup1 = hlc3_pivot - 0.382 * hl_range\n        res2 = hlc3_pivot + 0.618 * hl_range\n        sup2 = hlc3_pivot - 0.618 * hl_range\n        res3 = hlc3_pivot + 1 * hl_range\n        sup3 = hlc3_pivot - 1 * hl_range\n\n    return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3\n\ndef heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):\n    df = dataframe[['open','close','high','low']].copy().fillna(0)\n    if smooth_inputs:\n        df['open_s']  = ta.EMA(df['open'], timeframe = length)\n        df['high_s']  = ta.EMA(df['high'], timeframe = length)\n        df['low_s']   = ta.EMA(df['low'],  timeframe = length)\n        df['close_s'] = ta.EMA(df['close'],timeframe = length)\n\n        open_ha  = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)\n        low_ha   = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)\n        close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4\n    else:\n        open_ha  = (df['open'].shift(1) + df['close'].shift(1)) / 2\n        high_ha  = df.loc[:, ['high', 'open', 'close']].max(axis=1)\n        low_ha   = df.loc[:, ['low', 'open', 'close']].min(axis=1)\n        close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    open_ha = open_ha.fillna(0)\n    high_ha = high_ha.fillna(0)\n    low_ha  = low_ha.fillna(0)\n    close_ha = close_ha.fillna(0)\n\n    if smooth_outputs:\n        open_sha  = ta.EMA(open_ha, timeframe = length)\n        high_sha  = ta.EMA(high_ha, timeframe = length)\n        low_sha   = ta.EMA(low_ha, timeframe = length)\n        close_sha = ta.EMA(close_ha, timeframe = length)\n\n        return open_sha, close_sha, low_sha\n    else:\n        return open_ha, close_ha, low_ha\n\nclass Cache:\n\n    def __init__(self, path):\n        self.path = path\n        self.data = {}\n        self._mtime = None\n        self._previous_data = {}\n        try:\n            self.load()\n        except FileNotFoundError:\n            pass\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\"number_mode\": rapidjson.NM_NATIVE}\n\n    def load(self):\n        if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:\n            self._load()\n\n    def save(self):\n        if self.data != self._previous_data:\n            self._save()\n\n    def process_loaded_data(self, data):\n        return data\n\n    def _load(self):\n        # This method only exists to simplify unit testing\n        with self.path.open(\"r\") as rfh:\n            try:\n                data = rapidjson.load(\n                    rfh,\n                    **self.rapidjson_load_kwargs()\n                )\n            except rapidjson.JSONDecodeError as exc:\n                log.error(\"Failed to load JSON from %s: %s\", self.path, exc)\n            else:\n                self.data = self.process_loaded_data(data)\n                self._previous_data = copy.deepcopy(self.data)\n                self._mtime = self.path.stat().st_mtime_ns\n\n    def _save(self):\n        # This method only exists to simplify unit testing\n        rapidjson.dump(\n            self.data,\n            self.path.open(\"w\"),\n            **self.rapidjson_dump_kwargs()\n        )\n        self._mtime = self.path.stat().st_mtime\n        self._previous_data = copy.deepcopy(self.data)\n\n\nclass HoldsCache(Cache):\n\n    @staticmethod\n    def rapidjson_load_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"object_hook\": HoldsCache._object_hook,\n        }\n\n    @staticmethod\n    def rapidjson_dump_kwargs():\n        return {\n            \"number_mode\": rapidjson.NM_NATIVE,\n            \"mapping_mode\": rapidjson.MM_COERCE_KEYS_TO_STRINGS,\n        }\n\n    def save(self):\n        raise RuntimeError(\"The holds cache does not allow programatical save\")\n\n    def process_loaded_data(self, data):\n        trade_ids = data.get(\"trade_ids\")\n        trade_pairs = data.get(\"trade_pairs\")\n\n        if not trade_ids and not trade_pairs:\n            return data\n\n        open_trades = {}\n        for trade in Trade.get_trades_proxy(is_open=True):\n            open_trades[trade.id] = open_trades[trade.pair] = trade\n\n        r_trade_ids = {}\n        if trade_ids:\n            if isinstance(trade_ids, dict):\n                # New syntax\n                for trade_id, profit_ratio in trade_ids.items():\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float\",\n                            profit_ratio,\n                            trade_id,\n                            self.path\n                        )\n                    if trade_id in open_trades:\n                        formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n            else:\n                # Initial Syntax\n                profit_ratio = data.get(\"profit_ratio\")\n                if profit_ratio:\n                    if not isinstance(profit_ratio, float):\n                        log.error(\n                            \"The 'profit_ratio' config value(%s) in %s is not a float\",\n                            profit_ratio,\n                            self.path\n                        )\n                else:\n                    profit_ratio = 0.005\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                for trade_id in trade_ids:\n                    if not isinstance(trade_id, int):\n                        log.error(\n                            \"The trade_id(%s) defined under 'trade_ids' in %s is not an integer\",\n                            trade_id, self.path\n                        )\n                        continue\n                    if trade_id in open_trades:\n                        log.warning(\n                            \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                            open_trades[trade_id],\n                            formatted_profit_ratio\n                        )\n                        r_trade_ids[trade_id] = profit_ratio\n                    else:\n                        log.warning(\n                            \"The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s\",\n                            trade_id,\n                            self.path\n                        )\n\n        r_trade_pairs = {}\n        if trade_pairs:\n            for trade_pair, profit_ratio in trade_pairs.items():\n                if not isinstance(trade_pair, str):\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s is not a string\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if \"/\" not in trade_pair:\n                    log.error(\n                        \"The trade_pair(%s) defined under 'trade_pairs' in %s does not look like \"\n                        \"a valid '<TOKEN_NAME>/<STAKE_CURRENCY>' formatted pair.\",\n                        trade_pair, self.path\n                    )\n                    continue\n                if not isinstance(profit_ratio, float):\n                    log.error(\n                        \"The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float\",\n                        profit_ratio,\n                        trade_pair,\n                        self.path\n                    )\n                formatted_profit_ratio = f\"{profit_ratio * 100}%\"\n                if trade_pair in open_trades:\n                    log.warning(\n                        \"The trade %s is configured to HOLD until the profit ratio of %s is met\",\n                        open_trades[trade_pair],\n                        formatted_profit_ratio\n                    )\n                else:\n                    log.warning(\n                        \"The trade pair %s is configured to HOLD until the profit ratio of %s is met\",\n                        trade_pair,\n                        formatted_profit_ratio\n                    )\n                r_trade_pairs[trade_pair] = profit_ratio\n\n        r_data = {}\n        if r_trade_ids:\n            r_data[\"trade_ids\"] = r_trade_ids\n        if r_trade_pairs:\n            r_data[\"trade_pairs\"] = r_trade_pairs\n        return r_data\n\n    @staticmethod\n    def _object_hook(data):\n        _data = {}\n        for key, value in data.items():\n            try:\n                key = int(key)\n            except ValueError:\n                pass\n            _data[key] = value\n        return _data\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffSetStrategy_V2/NotAnotherSMAOffSetStrategy_V2.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_high_2\": -2.327,\n      \"ewo_low\": -20.988,\n      \"low_offset\": 0.975,\n      \"low_offset_2\": 0.955,\n      \"rsi_buy\": 69\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.998,\n      \"high_offset_2\": 1\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NotAnotherSMAOffSetStrategy_V2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.35\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)        \n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)       \n    \n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.025\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50'] > last_candle['ema_100']) and (last_candle['rsi'] < 45): #*1.2\n                    return False\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951): #*1.2\n                    return False\n\n        return True\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)          \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n        dataframe['vol_7_max'] = dataframe['volume'].rolling(window=20).max()\n        dataframe['vol_14_max'] = dataframe['volume'].rolling(window=14).max()\n        dataframe['vol_7_min'] = dataframe['volume'].rolling(window=20).min()\n        dataframe['vol_14_min'] = dataframe['volume'].rolling(window=14).min()\n        dataframe['roll_7'] = 100*((dataframe['volume']-dataframe['vol_7_max'])/(dataframe['vol_7_max']-dataframe['vol_7_min']))\n        dataframe['vol_base']=ta.SMA(dataframe['roll_7'], timeperiod=5)\n        dataframe['vol_ma_26'] = ta.SMA(dataframe['volume'], timeperiod=26)\n        dataframe['vol_ma_200'] = ta.SMA(dataframe['volume'], timeperiod=100)\n      \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    \n        dataframe.loc[\n        (\n                (dataframe['vol_base']>-96)&    \n                (dataframe['vol_base']<-77)&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo1')\n                \n        dataframe.loc[\n        (\n                (dataframe['vol_base']>-96)&\n                (dataframe['vol_base']> -20)&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo3')\n\n\n        dataframe.loc[\n        (       (dataframe['vol_base']>-96)&\n                (dataframe['vol_base']<-77)&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo2')\n\n    \n        dataframe.loc[\n        (\n                (dataframe['vol_base']>-96)&\n                (dataframe['vol_base']<-77)&\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['close']>dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])       \n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategy/NotAnotherSMAOffsetStrategy.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_high_2\": -2.327,\n      \"ewo_low\": -20.988,\n      \"low_offset\": 0.975,\n      \"low_offset_2\": 0.955,\n      \"rsi_buy\": 69\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\n\nclass NotAnotherSMAOffsetStrategy(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.35\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)        \n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)       \n    \n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951): #*1.2\n                    return False\n        return True\n    \n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)          \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    \n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo1')\n\n\n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo2')\n\n    \n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['close']>dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])       \n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategyHO/NotAnotherSMAOffsetStrategyHO.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 14,\n#     \"ewo_high\": 2.327,\n#     \"ewo_high_2\": -2.327,\n#     \"ewo_low\": -20.988,\n#     \"low_offset\": 0.975,\n#     \"low_offset_2\": 0.955,\n#     \"rsi_buy\": 69\n# }\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 18,\n#     \"ewo_high\": 3.422,\n#     \"ewo_high_2\": -3.436,\n#     \"ewo_low\": -8.562,\n#     \"low_offset\": 0.966,\n#     \"low_offset_2\": 0.959,\n#     \"rsi_buy\": 66,\n# }\n\n# # # Sell hyperspace params:\n# # sell_params = {\n# #     \"base_nb_candles_sell\": 17,\n# #     \"high_offset\": 0.997,\n# #     \"high_offset_2\": 1.01,\n# # }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 7,\n#     \"high_offset\": 1.014,\n#     \"high_offset_2\": 0.995,\n# }\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"ewo_high_2\": -5.642,\n#     \"low_offset_2\": 0.951,\n#     \"rsi_buy\": 54,\n#     \"base_nb_candles_buy\": 16,  # value loaded from strategy\n#     \"ewo_high\": 3.422,  # value loaded from strategy\n#     \"ewo_low\": -8.562,  # value loaded from strategy\n#     \"low_offset\": 0.966,  # value loaded from strategy\n# }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 8,\n#     \"high_offset_2\": 1.002,\n#     \"high_offset\": 1.014,  # value loaded from strategy\n# }\n\n# Buy hyperspace params:\nbuy_params = {\n    \"ewo_high_2\": -4.58,\n    \"low_offset_2\": 0.951,\n    \"rsi_buy\": 52,\n    \"base_nb_candles_buy\": 16,  # value loaded from strategy\n    \"ewo_high\": 3.422,  # value loaded from strategy\n    \"ewo_low\": -8.562,  # value loaded from strategy\n    \"low_offset\": 0.966,  # value loaded from strategy\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 10,\n    \"high_offset_2\": 1.002,\n    \"high_offset\": 1.014,  # value loaded from strategy\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NotAnotherSMAOffsetStrategyHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.289,\n        \"25\": 0.105,\n        \"80\": 0.038,\n        \"140\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.35\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=False)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=False)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=False)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=False)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=False)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\n\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    buy_signals = {}\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategyHOv3/NotAnotherSMAOffsetStrategyHOv3.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 14,\n#     \"ewo_high\": 2.327,\n#     \"ewo_high_2\": -2.327,\n#     \"ewo_low\": -20.988,\n#     \"low_offset\": 0.975,\n#     \"low_offset_2\": 0.955,\n#     \"rsi_buy\": 69\n# }\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 18,\n#     \"ewo_high\": 3.422,\n#     \"ewo_high_2\": -3.436,\n#     \"ewo_low\": -8.562,\n#     \"low_offset\": 0.966,\n#     \"low_offset_2\": 0.959,\n#     \"rsi_buy\": 66,\n# }\n\n# # # Sell hyperspace params:\n# # sell_params = {\n# #     \"base_nb_candles_sell\": 17,\n# #     \"high_offset\": 0.997,\n# #     \"high_offset_2\": 1.01,\n# # }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 7,\n#     \"high_offset\": 1.014,\n#     \"high_offset_2\": 0.995,\n# }\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"ewo_high_2\": -5.642,\n#     \"low_offset_2\": 0.951,\n#     \"rsi_buy\": 54,\n#     \"base_nb_candles_buy\": 16,  # value loaded from strategy\n#     \"ewo_high\": 3.422,  # value loaded from strategy\n#     \"ewo_low\": -8.562,  # value loaded from strategy\n#     \"low_offset\": 0.966,  # value loaded from strategy\n# }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 8,\n#     \"high_offset_2\": 1.002,\n#     \"high_offset\": 1.014,  # value loaded from strategy\n# }\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 8,\n    \"ewo_high\": 4.179,\n    \"ewo_low\": -16.917,\n    \"ewo_high_2\": -2.609,  # value loaded from strategy\n    \"low_offset\": 0.986,  # value loaded from strategy\n    \"low_offset_2\": 0.944,  # value loaded from strategy\n    \"rsi_buy\": 58,  # value loaded from strategy\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 16,\n    \"high_offset\": 1.054,\n    \"high_offset_2\": 1.018,  # value loaded from strategy\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NotAnotherSMAOffsetStrategyHOv3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        # \"0\": 0.283,\n        # \"40\": 0.086,\n        # \"99\": 0.036,\n        \"0\": 10\n    }\n\n    # Stoploss:\n    stoploss = -0.3\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        2, 20, default=buy_params['base_nb_candles_buy'], space='buy', optimize=False)\n    base_nb_candles_sell = IntParameter(\n        10, 40, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=False)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=False)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=False)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=False)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=False)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=False)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=False)\n\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.025\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n    use_custom_stoploss = False\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    buy_signals = {}\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo1')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['rsi'] < 25)\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n            (\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            ),\n            ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategyLite/NotAnotherSMAOffsetStrategyLite.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, DecimalParameter, IntParameter, CategoricalParameter\n\n# @Rallipanos\n\n\ndef ewo(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass NotAnotherSMAOffsetStrategyLite(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        'base_nb_candles_buy': 14,\n        'low_offset': 0.975,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'base_nb_candles_sell': 24,\n        'high_offset': 0.991,\n    }\n\n    minimal_roi = {'0': 0.025}\n    stoploss = -0.1\n    # use_custom_stoploss = True\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n    order_time_in_force = {'buy': 'gtc', 'sell': 'ioc'}\n    timeframe = '5m'\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n        if current_profit < -0.05 and current_time - timedelta(minutes=720) > trade.open_date_utc:\n            return -0.01\n        return 1\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        for length in set(list(self.base_nb_candles_buy.range) + list(self.base_nb_candles_sell.range)):\n            dataframe[f'ema_{length}'] = ta.EMA(dataframe, timeperiod=length)\n        dataframe['ewo'] = ewo(dataframe, self.fast_ewo, self.slow_ewo)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[(\n            (dataframe['close'] < (dataframe[f'ema_{self.base_nb_candles_buy.value}'] * self.low_offset.value))\n            &\n            (dataframe['ewo'] > 0)\n            &\n            (dataframe['volume'] > 0)\n        ), 'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[(\n            (dataframe['close'] > (dataframe[f'ema_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            &\n            (dataframe['volume'] > 0)\n        ), 'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategyModHO/NotAnotherSMAOffsetStrategyModHO.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_prev_date, timeframe_to_seconds\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 7,\n#     \"ewo_high\": 3.004,\n#     \"ewo_low\": -9.551,\n#     \"low_offset\": 0.984,\n#     \"rsi_buy\": 56,\n# }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 19,\n#     \"high_offset\": 1.0,\n#     \"high_offset_2\": 0.998,\n# }\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 12,\n#     \"ewo_high\": 2.38,\n#     \"ewo_low\": -9.496,\n#     \"low_offset\": 0.986,\n#     \"rsi_buy\": 65,\n# }\n\n# Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 11,\n#     \"high_offset\": 1.0,\n#     \"high_offset_2\": 0.995,\n# }\n\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 12,\n#     \"ewo_high\": 2.303,\n#     \"ewo_low\": -8.114,\n#     \"low_offset\": 0.986,\n#     \"rsi_buy\": 68,\n# }\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 10,\n#     \"ewo_high\": 3.751,\n#     \"ewo_low\": -9.735,\n#     \"low_offset\": 0.984,\n#     \"rsi_buy\": 68,\n# }\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 10,\n#     \"ewo_high\": 3.734,\n#     \"ewo_low\": -9.551,\n#     \"low_offset\": 0.984,\n#     \"rsi_buy\": 65,\n# }\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 10,\n    \"ewo_high\": 3.206,\n    \"ewo_low\": -10.69,\n    \"low_offset\": 0.984,\n    \"rsi_buy\": 63,\n}\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 6,\n    \"high_offset\": 1.002,\n    \"high_offset_2\": 1.0,\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NotAnotherSMAOffsetStrategyModHO(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.214,\n        # \"20\": 0.09,\n        # \"40\": 0.029,\n        # \"90\": 0\n    }\n    # minimal_roi = {\n    #     \"0\": 0.99,\n    # }\n\n    # Stoploss:\n    stoploss = -0.32\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.0075\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    use_custom_stoploss = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        if (last_candle is not None):\n            #            if (sell_reason in ['roi','sell_signal','trailing_stop_loss']):\n            if (sell_reason in ['sell_signal']):\n                if last_candle['block_trade_exit']:\n                    return False\n                if last_candle['di_up'] and (last_candle['adx'] > previous_candle_1['adx']):\n                    return False\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        stoploss = self.stoploss\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        if last_candle is None:\n            return stoploss\n\n        trade_date = timeframe_to_prev_date(\n            self.timeframe, trade.open_date_utc - timedelta(seconds=timeframe_to_seconds(self.timeframe)))\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n        if trade_candle.empty:\n            return stoploss\n\n        trade_candle = trade_candle.squeeze()\n\n        dur_minutes = (current_time - trade.open_date_utc).seconds // 60\n\n        slippage_ratio = trade.open_rate / trade_candle['close'] - 1\n        slippage_ratio = slippage_ratio if slippage_ratio > 0 else 0\n        current_profit_comp = current_profit + slippage_ratio\n\n        if current_profit_comp >= self.trailing_stop_positive_offset:\n            return self.trailing_stop_positive\n\n        for x in self.minimal_roi:\n            dur = int(x)\n            roi = self.minimal_roi[x]\n            if dur_minutes >= dur and current_profit_comp >= roi:\n                return 0.001\n\n        return stoploss\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # confirm_trade_exit\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=2)\n        dataframe['di_up'] = ta.PLUS_DI(\n            dataframe, timeperiod=2) > ta.MINUS_DI(dataframe, timeperiod=2)\n        rsi2 = ta.RSI(dataframe, timeperiod=2)\n        rsi4 = ta.RSI(dataframe, timeperiod=4)\n        dataframe['block_trade_exit'] = rsi2 > rsi4\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n\n\n            )\n        )\n\n        conditions.append(\n            (\n\n\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategyModHO_LamineDz_20210901/NotAnotherSMAOffsetStrategyModHO_LamineDz_20210901.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_prev_date, timeframe_to_seconds\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 7,\n#     \"ewo_high\": 3.004,\n#     \"ewo_low\": -9.551,\n#     \"low_offset\": 0.984,\n#     \"rsi_buy\": 56,\n# }\n\n# # Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 19,\n#     \"high_offset\": 1.0,\n#     \"high_offset_2\": 0.998,\n# }\n\n# # Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 12,\n#     \"ewo_high\": 2.38,\n#     \"ewo_low\": -9.496,\n#     \"low_offset\": 0.986,\n#     \"rsi_buy\": 65,\n# }\n\n# Sell hyperspace params:\n# sell_params = {\n#     \"base_nb_candles_sell\": 11,\n#     \"high_offset\": 1.0,\n#     \"high_offset_2\": 0.995,\n# }\n\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 12,\n#     \"ewo_high\": 2.303,\n#     \"ewo_low\": -8.114,\n#     \"low_offset\": 0.986,\n#     \"rsi_buy\": 68,\n# }\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 10,\n#     \"ewo_high\": 3.751,\n#     \"ewo_low\": -9.735,\n#     \"low_offset\": 0.984,\n#     \"rsi_buy\": 68,\n# }\n# Buy hyperspace params:\n# buy_params = {\n#     \"base_nb_candles_buy\": 10,\n#     \"ewo_high\": 3.734,\n#     \"ewo_low\": -9.551,\n#     \"low_offset\": 0.984,\n#     \"rsi_buy\": 65,\n# }\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 10,\n    \"ewo_high\": 3.206,\n    \"ewo_low\": -10.69,\n    \"low_offset\": 0.984,\n    \"rsi_buy\": 63,\n}\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 6,\n    \"high_offset\": 1.002,\n    \"high_offset_2\": 1.0,\n}\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\nclass NotAnotherSMAOffsetStrategyModHO_LamineDz_20210901(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.214,\n        # \"20\": 0.09,\n        # \"40\": 0.029,\n        # \"90\": 0\n    }\n    # minimal_roi = {\n    #     \"0\": 0.99,\n    # }\n\n    # Stoploss:\n    stoploss = -0.9\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.0075\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    use_custom_stoploss = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        if (last_candle is not None):\n            #            if (sell_reason in ['roi','sell_signal','trailing_stop_loss']):\n            if (sell_reason in ['sell_signal']):\n                if last_candle['block_trade_exit']:\n                    return False\n                if last_candle['di_up'] and (last_candle['adx'] > previous_candle_1['adx']):\n                    return False\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        stoploss = self.stoploss\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        if last_candle is None:\n            return stoploss\n\n        trade_date = timeframe_to_prev_date(\n            self.timeframe, trade.open_date_utc - timedelta(seconds=timeframe_to_seconds(self.timeframe)))\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n        if trade_candle.empty:\n            return stoploss\n\n        trade_candle = trade_candle.squeeze()\n\n        dur_minutes = (current_time - trade.open_date_utc).seconds // 60\n\n        slippage_ratio = trade.open_rate / trade_candle['close'] - 1\n        slippage_ratio = slippage_ratio if slippage_ratio > 0 else 0\n        current_profit_comp = current_profit + slippage_ratio\n\n        if current_profit_comp >= self.trailing_stop_positive_offset:\n            return self.trailing_stop_positive\n\n        for x in self.minimal_roi:\n            dur = int(x)\n            roi = self.minimal_roi[x]\n            if dur_minutes >= dur and current_profit_comp >= roi:\n                return 0.001\n\n        return stoploss\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # confirm_trade_exit\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=2)\n        dataframe['di_up'] = ta.PLUS_DI(\n            dataframe, timeperiod=2) > ta.MINUS_DI(dataframe, timeperiod=2)\n        rsi2 = ta.RSI(dataframe, timeperiod=2)\n        rsi4 = ta.RSI(dataframe, timeperiod=4)\n        dataframe['block_trade_exit'] = rsi2 > rsi4\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n\n\n            )\n        )\n\n        conditions.append(\n            (\n\n\n                (dataframe['rsi_fast'] < 35) &\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (\n                    dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            ((dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n             )\n            |\n            (\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategyX1/NotAnotherSMAOffsetStrategyX1.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\nimport pandas_ta as pta\n\n# @Rallipanos\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    # emadif = (ema1 - ema2) / df['low'] * 100\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\n\nclass NotAnotherSMAOffsetStrategyX1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 14,\n        \"ewo_high\": 2.327,\n        \"ewo_high_2\": -2.327,\n        \"ewo_low\": -19.988,\n        \"low_offset\": 0.975,\n        \"low_offset_2\": 0.955,\n        \"rsi_buy\": 69,\n    }\n    \n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 24,\n        \"high_offset\": 0.991,\n        \"high_offset_2\": 0.997,\n        \"pHSL\": -0.99,\n        \"pPF_1\": 0.022,\n        \"pSL_1\": 0.021,\n        \"pPF_2\": 0.08,\n        \"pSL_2\": 0.04,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.35\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)        \n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)       \n    \n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # trailing stoploss hyperopt parameters\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', optimize=False, load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', optimize=True, load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', optimize=True, load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', optimize=True, load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', optimize=True, load=True)\n\n    protections = [\n        #   {\n        #       \"method\": \"StoplossGuard\",\n        #       \"lookback_period_candles\": 12,\n        #       \"trade_limit\": 1,\n        #       \"stop_duration_candles\": 6,\n        #       \"only_per_pair\": True\n        #   },\n        #   {\n        #       \"method\": \"StoplossGuard\",\n        #       \"lookback_period_candles\": 12,\n        #       \"trade_limit\": 2,\n        #       \"stop_duration_candles\": 6,\n        #       \"only_per_pair\": False\n        #   },\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"CooldownPeriod\",\n            \"stop_duration_candles\": 2\n        }\n    ]\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    \n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951): #*1.2\n                    return False\n        return True\n    \n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        # dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['hma_50'] = pta.hma(dataframe['close'], 50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)          \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value \n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1)*(SL_2 - SL_1)/(PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n        \n        return stoploss_from_open(sl_profit, current_profit)\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n    \n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo1')\n\n\n        \"\"\"\n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo2')\n        \"\"\"\n    \n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewolow')\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   \n                (dataframe['close']>dataframe['hma_50'])&\n                #(dataframe['close']>dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )\n            |\n            (\n                (dataframe['close']<dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])       \n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategy_uzi/NotAnotherSMAOffsetStrategy_uzi.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import  DecimalParameter, IntParameter\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_low\": -20.988,\n      \"low_offset\": 0.975,\n      \"rsi_buy\": 69\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\norder_types = {\n    'buy': 'limit',\n    'sell': 'market',\n    'stoploss': 'market',\n    'stoploss_on_exchange': False\n    }    \n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\n\nclass NotAnotherSMAOffsetStrategy_uzi(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.07\n\n    # SMAOffset\n    base_nb_candles_buy  = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset           = DecimalParameter(0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset          = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low  = DecimalParameter(-20.0, -8.0,default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy  = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.005\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951): #*1.2\n                    return False\n        return True\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)          \n\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        \n        conditions.append(\n            (   \n\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (   \n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)                                \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50)&\n                (dataframe['volume'] > 0)&                \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005 )) &\n                (dataframe['close'] < dataframe['hma_50'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/NotAnotherSMAOffsetStrategy_uzi3/NotAnotherSMAOffsetStrategy_uzi3.py",
    "content": "# --- Do not remove these libs ---\nfrom typing import DefaultDict\nfrom freqtrade.strategy.interface import IStrategy\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import  DecimalParameter, IntParameter\n\n\n# @Rallipanos mod. Uzirox\n\n\ndef zlema2(dataframe, fast):\n    df = dataframe.copy()\n    zema1=ta.EMA(df['close'], fast)\n    zema2=ta.EMA(zema1, fast)\n    d1=zema1-zema2\n    df['zlema2']=zema1+d1\n    return df['zlema2']\n\n\norder_types = {\n    'buy': 'limit',\n    'sell': 'market',\n    'stoploss': 'market',\n    'stoploss_on_exchange': False\n    }    \n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\n\nclass NotAnotherSMAOffsetStrategy_uzi3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n       # \"201\": 0\n    }\n\n\n    # Stoploss:\n    stoploss = -0.1\n\n\n    # Protection\n    fast_ewo   = 50\n    slow_ewo   = 200\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.025\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.005\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    slippage_protection = {\n            'retries': 3,\n            'max_slippage': -0.02\n        }\n\n    buy_signals = {}\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951):  # *1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if(((dataframe['close'].iloc[-1] - dataframe['close'].iloc[-2])/dataframe['close'].iloc[-2])*100) < -2:\n            # si scende pesante         \n            \n            self.stoploss = -0.3 #stoploss\n\n            # buy params\n            self.trailing_stop_positive_offset = 0.03\n            self.base_nb_candles_buy  = IntParameter(5, 80, default=14, space='buy', optimize=False)\n            self.low_offset           = DecimalParameter(0.9, 0.99, default=0.975, space='buy', optimize=False)\n            self.low_offset_2         = DecimalParameter(0.9, 0.99, default=0.955, space='buy', optimize=False)  \n            self.ewo_low              = DecimalParameter(-20.0, -8.0,default=-20.988, space='buy', optimize=False)\n            self.ewo_high             = DecimalParameter(2.0, 12.0, default=2.327, space='buy', optimize=False)\n            self.ewo_high_2           = DecimalParameter(-6.0, 12.0, default=-2.327, space='buy', optimize=False)\n            self.rsi_buy              = IntParameter(30, 70, default=69, space='buy', optimize=False)\n\n            # sell params\n            self.base_nb_candles_sell = IntParameter(5, 80, default=16, space='sell', optimize=True)\n            self.high_offset          = DecimalParameter(0.95, 1.1, default=0.991, space='sell', optimize=True)\n            self.high_offset_2        = DecimalParameter(0.99, 1.5, default=0.997, space='sell', optimize=True)     \n\n\n        else:\n            # normale - si sale\n\n            # buy params\n            self.base_nb_candles_buy  = IntParameter(5, 80, default=14, space='buy', optimize=False)\n            self.low_offset           = DecimalParameter(0.9, 0.99, default=0.986, space='buy', optimize=False)\n            self.low_offset_2         = DecimalParameter(0.9, 0.99, default=0.944, space='buy', optimize=False)  \n            self.ewo_low              = DecimalParameter(-20.0, -8.0,default=-16.917, space='buy', optimize=False)\n            self.ewo_high             = DecimalParameter(2.0, 12.0, default=4.179, space='buy', optimize=False)\n            self.ewo_high_2           = DecimalParameter(-6.0, 12.0, default=-2.609, space='buy', optimize=False)\n            self.rsi_buy              = IntParameter(30, 70, default=58, space='buy', optimize=False)\n\n            # sell params\n            self.base_nb_candles_sell = IntParameter(5, 80, default=16, space='sell', optimize=True)\n            self.high_offset          = DecimalParameter(0.95, 1.1, default=1.054, space='sell', optimize=True)\n            self.high_offset_2        = DecimalParameter(0.99, 1.5, default=1.018, space='sell', optimize=True)     \n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n\n        # *MAs\n        dataframe['hma_50']  = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod = 100)      \n        dataframe['ema_10']  = zlema2(dataframe, 10)\n        dataframe['sma_9']   = ta.SMA(dataframe, timeperiod = 9)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n         # strategy BinHV45\n        bb_40 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['lower'] = bb_40['lower']\n        dataframe['mid'] = bb_40['mid']\n        dataframe['bbdelta'] = (bb_40['mid'] - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['low']).abs()\n\n        # strategy ClucMay72018\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo1')\n\n\n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewo2')\n\n        dataframe.loc[\n        (\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n        ),\n        ['buy', 'buy_tag']] = (1, 'ewolow')\n\n\n        # buy in bull market\n        dataframe.loc[\n        (  \n                (dataframe['ema_10'].rolling(10).mean() > dataframe['ema_100'].rolling(10).mean()) &\n                (dataframe['lower'].shift().gt(0)) &\n                (dataframe['bbdelta'].gt(dataframe['close'] * 0.031)) &\n                (dataframe['closedelta'].gt(dataframe['close'] * 0.018)) &\n                (dataframe['tail'].lt(dataframe['bbdelta'] * 0.233)) &\n                (dataframe['close'].lt(dataframe['lower'].shift())) &\n                (dataframe['close'].le(dataframe['close'].shift())) &\n                (dataframe['volume'] > 0) \n        )\n        |\n        (\n                (dataframe['ema_10'].rolling(10).mean() > dataframe['ema_100'].rolling(10).mean()) &\n                (dataframe['close']  > dataframe['ema_100']) &\n                (dataframe['close']  < dataframe['ema_slow']) &\n                (dataframe['close']  < 0.993 * dataframe['bb_lowerband']) &\n                (dataframe['volume'] < (dataframe['volume_mean_slow'].shift(1) * 21)) &\n                (dataframe['volume'] > 0)\n        ),\n        ['buy', 'buy_tag']] = (1, 'bb_bull')    \n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi']>50) &\n                (dataframe['volume'] > 0) & \n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (                                \n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1)*0.005)) &\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )\n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n    \n    plot_config = {\n        'main_plot':{\n            'ema_100':{},\n            'ema_10':{},\n            'sma_9':{}\n        }     \n    }  "
  },
  {
    "path": "strategies/NowoIchimoku1hV1/NowoIchimoku1hV1.py",
    "content": "# This version of the strategy is broken!\n\n# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport math\nfrom typing import Callable\n\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy import IntParameter\nfrom pandas import Series\nfrom numpy.typing import ArrayLike\nfrom datetime import datetime, timedelta\nimport technical.indicators as indicators\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom finta import TA\n\n\ndef wma(series: Series, length: int) -> Series:\n    norm = 0\n    sum = 0\n\n    for i in range(1, length - 1):\n        weight = (length - i) * length\n        norm = norm + weight\n        sum = sum + series.shift(i) * weight\n\n    return sum / norm\n\n\ndef hma(series: Series, length: int) -> Series:\n    h = 2 * wma(series, math.floor(length / 2)) - wma(series, length)\n    hma = wma(h, math.floor(math.sqrt(length)))\n    return hma\n\n\ndef bollinger_bands(series: Series, moving_average='sma', length=20, mult=2.0) -> DataFrame:\n    basis = None\n    if moving_average == 'sma':\n        basis = ta.SMA(series, length)\n    elif moving_average == 'hma':\n        basis = hma(series, length)\n    else:\n        raise Exception(\"moving_average has to be sma or hma\")\n\n    dev = mult * ta.STDDEV(series, length)\n\n    return DataFrame({\n        'upper': basis + dev\n    })\n\n\nclass NowoIchimoku1hV1(IStrategy):\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    startup_candle_count = 100\n\n    use_sell_signal = False\n\n    use_custom_stoploss = True\n\n    minimal_roi = {\n        \"0\": 999\n    }\n\n    stoploss = -0.08\n\n    plot_config = {\n        'main_plot': {\n            # 'lead_1': {\n            #     'color': 'green',\n            #     'fill_to': 'lead_2',\n            #     'fill_label': 'Ichimoku Cloud',\n            #     'fill_color': 'rgba(0,0,0,0.2)',\n            # },\n            # 'lead_2': {\n            #     'color': 'red',\n            # },\n            # 'conversion_line': {'color': 'blue'},\n            # 'base_line': {'color': 'orange'},\n        },\n    }\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        # In dry/live runs trade open date will not match candle open date therefore it must be\n        # rounded.\n        trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n        # Look up trade candle.\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n\n        # trade_candle may be empty for trades that just opened as it is still incomplete.\n        if not trade_candle.empty:\n            trade_candle = trade_candle.squeeze()\n\n            if last_candle['srsi_k'] > 80 & current_profit > 1.1:\n                return 'srsi_k above 80 with profit above 10%'\n\n            if current_rate > last_candle['upper'] & current_profit > 1.01:\n                return 'current rate above upper band with profit above 1%'\n\n            limit = trade_candle['close'] + ((trade_candle['close'] - trade_candle['shifted_lower_cloud']) * 2)\n\n            if current_rate > limit:\n                return 'current rate above limit'\n\n            if current_rate < trade_candle['shifted_lower_cloud']:\n                return 'current rate below stop'\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        return 1\n\n    # def informative_pairs(self):\n    #     return []\n\n    def populate_indicators(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['upper'] = bollinger_bands(df['close'], moving_average='hma', length=20, mult=2.5)['upper']\n\n        ichi = indicators.ichimoku(df)\n\n        df['conversion_line'] = ichi['tenkan_sen']\n        df['base_line'] = ichi['kijun_sen']\n\n        df['lead_1'] = ichi['leading_senkou_span_a']\n        df['lead_2'] = ichi['leading_senkou_span_b']\n\n        df['cloud_green'] = ichi['cloud_green']\n\n        df['upper_cloud'] = df['lead_1'].where(df['lead_1'] > df['lead_2'], df['lead_2'])\n        df['lower_cloud'] = df['lead_1'].where(df['lead_1'] < df['lead_2'], df['lead_2'])\n\n        df['shifted_upper_cloud'] = df['upper_cloud'].shift(25)\n        df['shifted_lower_cloud'] = df['lower_cloud'].shift(25)\n\n        smoothK = 3\n        smoothD = 3\n        lengthRSI = 14\n        lengthStoch = 14\n\n        df['rsi'] = ta.RSI(df, timeperiod=lengthRSI)\n\n        stochrsi = (df['rsi'] - df['rsi'].rolling(lengthStoch).min()) / (\n                df['rsi'].rolling(lengthStoch).max() - df['rsi'].rolling(lengthStoch).min())\n\n        df['srsi_k'] = stochrsi.rolling(smoothK).mean() * 100\n        df['srsi_d'] = df['srsi_k'].rolling(smoothD).mean()\n\n        # df['srsi_top'] = 80\n        # df['srsi_bottom'] = 20\n\n        return df\n\n    def populate_buy_trend(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['is_cloud_green'] = df['lead_1'] > df['lead_2']\n\n        double_shifted_upper_cloud = df['upper_cloud'].shift(50)\n\n        close_above_shifted_upper_cloud = df['close'] > df['shifted_upper_cloud'] * 1.04\n        close_above_shifted_lower_cloud = df['close'] > df['shifted_lower_cloud']\n        close_above_double_shifted_upper_cloud = df['close'] > double_shifted_upper_cloud\n\n        conversion_line_above_base_line = df['conversion_line'] > df['base_line']\n        close_above_shifted_conversion_line = df['close'] > df['conversion_line'].shift(25)\n\n        df['should_buy'] = (df['close'] > df['open']) & \\\n                           close_above_shifted_upper_cloud & \\\n                           close_above_shifted_lower_cloud & \\\n                           df['is_cloud_green'] & \\\n                           conversion_line_above_base_line & \\\n                           close_above_shifted_conversion_line & \\\n                           close_above_double_shifted_upper_cloud\n\n        df['buy_allowed'] = -df['is_cloud_green']\n        for i in range(101, len(df)):\n            df.loc[i, 'buy_allowed'] = df.loc[i - 1, 'buy_allowed']\n\n            if df.loc[i - 1, 'buy']:\n                df.loc[i, 'buy_allowed'] = False\n\n            elif not df.loc[i, 'is_cloud_green']:\n                df[i, 'buy_allowed'] = True\n\n        df.loc[\n            (df['buy_allowed'] & df['should_buy'])\n            , 'buy'] = 1\n\n        return df\n\n    def populate_sell_trend(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['sell'] = 0\n        return df\n"
  },
  {
    "path": "strategies/NowoIchimoku1hV2/NowoIchimoku1hV2.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport math\nfrom typing import Callable\n\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy import DecimalParameter, IntParameter\n\nfrom freqtrade.strategy import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy import IntParameter\nfrom pandas import Series\nfrom numpy.typing import ArrayLike\nfrom datetime import datetime, timedelta\nimport technical.indicators as indicators\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom finta import TA\n\n\ndef wma(series: Series, length: int) -> Series:\n    norm = 0\n    sum = 0\n\n    for i in range(1, length - 1):\n        weight = (length - i) * length\n        norm = norm + weight\n        sum = sum + series.shift(i) * weight\n\n    return sum / norm\n\n\ndef hma(series: Series, length: int) -> Series:\n    h = 2 * wma(series, math.floor(length / 2)) - wma(series, length)\n    hma = wma(h, math.floor(math.sqrt(length)))\n    return hma\n\n\ndef bollinger_bands(series: Series, moving_average='sma', length=20, mult=2.0) -> DataFrame:\n    basis = None\n    if moving_average == 'sma':\n        basis = ta.SMA(series, length)\n    elif moving_average == 'hma':\n        basis = hma(series, length)\n    else:\n        raise Exception(\"moving_average has to be sma or hma\")\n\n    dev = mult * ta.STDDEV(series, length)\n\n    return DataFrame({\n        'upper': basis + dev\n    })\n\n\nclass NowoIchimoku1hV2(IStrategy):\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    startup_candle_count = 100\n\n    use_sell_signal = False\n\n    use_custom_stoploss = True\n\n    trailing_stop = True\n\n    minimal_roi = {\n        \"0\": 0.427,\n        \"448\": 0.202,\n        \"1123\": 0.089,\n        \"2355\": 0\n    }\n\n    stoploss = -0.345\n\n    plot_config = {\n        'main_plot': {\n            # 'lead_1': {\n            #     'color': 'green',\n            #     'fill_to': 'lead_2',\n            #     'fill_label': 'Ichimoku Cloud',\n            #     'fill_color': 'rgba(0,0,0,0.2)',\n            # },\n            # 'lead_2': {\n            #     'color': 'red',\n            # },\n            # 'conversion_line': {'color': 'blue'},\n            # 'base_line': {'color': 'orange'},\n            'upper': {\n                'color': 'blue'\n            }\n        },\n        'subplots': {\n            'Buy Allowed': {\n                'buy_allowed': {\n                    'color': 'blue'\n                },\n            },\n            'Should Buy': {\n                'should_buy': {\n                    'color': 'green'\n                },\n            },\n            'Is Cloud Green': {\n                'is_cloud_green': {\n                    'color': 'black'\n                }\n            }\n        }\n    }\n\n    srsi_k_min_profit = DecimalParameter(0.01, 0.99, decimals=3, default=0.036, space=\"sell\")\n    above_upper_min_profit = DecimalParameter(0.001, 0.5, decimals=3, default=0.011, space=\"sell\")\n    limit_factor = DecimalParameter(0.5, 5, decimals=3, default=1.918, space=\"sell\")\n    lower_cloud_factor = DecimalParameter(0.5, 1.5, decimals=3, default=0.971, space=\"sell\")\n    close_above_shifted_upper_cloud = DecimalParameter(0.5, 2, decimals=3, default=0.603, space=\"buy\")\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle = dataframe.iloc[-2].squeeze()\n\n        if (last_candle is not None) & (previous_candle is not None):\n            # In dry/live runs trade open date will not match candle open date therefore it must be\n            # rounded.\n            trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            # Look up trade candle.\n            trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n\n            # trade_candle may be empty for trades that just opened as it is still incomplete.\n            if not trade_candle.empty:\n                trade_candle = trade_candle.squeeze()\n\n                if (last_candle['srsi_k'] > 80) & (current_profit > self.srsi_k_min_profit.value):\n                    return -0.0001\n\n                if (previous_candle['close'] < previous_candle['upper']) & (current_rate > last_candle['upper']) & (\n                        current_profit > self.above_upper_min_profit.value):\n                    return -0.0001\n\n                limit = trade.open_rate + ((trade.open_rate - trade_candle['shifted_lower_cloud']) * self.limit_factor.value)\n\n                if current_rate > limit:\n                    return -0.0001\n\n                if current_rate < (trade_candle['shifted_lower_cloud'] * self.lower_cloud_factor.value):\n                    return -0.0001\n\n        return -0.99\n\n    def populate_indicators(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['upper'] = bollinger_bands(df['close'], moving_average='hma', length=20, mult=2.5)['upper']\n\n        ichi = indicators.ichimoku(df)\n\n        df['conversion_line'] = ichi['tenkan_sen']\n        df['base_line'] = ichi['kijun_sen']\n\n        df['lead_1'] = ichi['leading_senkou_span_a']\n        df['lead_2'] = ichi['leading_senkou_span_b']\n\n        df['cloud_green'] = ichi['cloud_green']\n\n        df['upper_cloud'] = df['lead_1'].where(df['lead_1'] > df['lead_2'], df['lead_2'])\n        df['lower_cloud'] = df['lead_1'].where(df['lead_1'] < df['lead_2'], df['lead_2'])\n\n        df['shifted_upper_cloud'] = df['upper_cloud'].shift(25)\n        df['shifted_lower_cloud'] = df['lower_cloud'].shift(25)\n\n        smoothK = 3\n        smoothD = 3\n        lengthRSI = 14\n        lengthStoch = 14\n\n        df['rsi'] = ta.RSI(df, timeperiod=lengthRSI)\n\n        stochrsi = (df['rsi'] - df['rsi'].rolling(lengthStoch).min()) / (\n                df['rsi'].rolling(lengthStoch).max() - df['rsi'].rolling(lengthStoch).min())\n\n        df['srsi_k'] = stochrsi.rolling(smoothK).mean() * 100\n        df['srsi_d'] = df['srsi_k'].rolling(smoothD).mean()\n\n        # df['srsi_top'] = 80\n        # df['srsi_bottom'] = 20\n\n        return df\n\n    def populate_buy_trend(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['is_cloud_green'] = df['lead_1'] > df['lead_2']\n\n        double_shifted_upper_cloud = df['upper_cloud'].shift(50)\n\n        close_above_shifted_upper_cloud = df['close'] > df['shifted_upper_cloud'] * self.close_above_shifted_upper_cloud.value\n        close_above_shifted_lower_cloud = df['close'] > df['shifted_lower_cloud']\n        close_above_double_shifted_upper_cloud = df['close'] > double_shifted_upper_cloud\n\n        conversion_line_above_base_line = df['conversion_line'] > df['base_line']\n        close_above_shifted_conversion_line = df['close'] > df['conversion_line'].shift(25)\n\n        df['should_buy'] = (df['close'] > df['open']) & \\\n                           close_above_shifted_upper_cloud & \\\n                           close_above_shifted_lower_cloud & \\\n                           df['is_cloud_green'] & \\\n                           conversion_line_above_base_line & \\\n                           close_above_shifted_conversion_line & \\\n                           close_above_double_shifted_upper_cloud\n\n        df['buy'] = False\n        df['buy_allowed'] = True\n        for row in df.itertuples():\n            if row.Index > 100:\n                df.loc[row.Index, 'buy_allowed'] = df.at[row.Index - 1, 'buy_allowed']\n\n                if df.at[row.Index - 1, 'buy']:\n                    df.loc[row.Index, 'buy_allowed'] = False\n\n                if not df.at[row.Index, 'is_cloud_green']:\n                    df.loc[row.Index, 'buy_allowed'] = True\n\n                df.loc[row.Index, 'buy'] = df.at[row.Index, 'buy_allowed'] & df.at[row.Index, 'should_buy']\n\n        return df\n\n    def populate_sell_trend(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['sell'] = 0\n        return df\n"
  },
  {
    "path": "strategies/NowoIchimoku5mV2/NowoIchimoku5mV2.py",
    "content": "# This version of the strategy is broken!\n\n# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport math\nfrom typing import Callable\n\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.exchange import timeframe_to_minutes\n\nfrom freqtrade.strategy import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy import IntParameter\nfrom pandas import Series\nfrom numpy.typing import ArrayLike\nfrom datetime import datetime, timedelta\nimport technical.indicators as indicators\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom finta import TA\n\n\ndef merge_informative_pair(dataframe: pd.DataFrame, informative: pd.DataFrame,\n                           timeframe: str, timeframe_inf: str, ffill: bool = True) -> pd.DataFrame:\n    \"\"\"\n   Correctly merge informative samples to the original dataframe, avoiding lookahead bias.\n\n   Since dates are candle open dates, merging a 15m candle that starts at 15:00, and a\n   1h candle that starts at 15:00 will result in all candles to know the close at 16:00\n   which they should not know.\n\n   Moves the date of the informative pair by 1 time interval forward.\n   This way, the 14:00 1h candle is merged to 15:00 15m candle, since the 14:00 1h candle is the\n   last candle that's closed at 15:00, 15:15, 15:30 or 15:45.\n\n   Assuming inf_tf = '1d' - then the resulting columns will be:\n   date_1d, open_1d, high_1d, low_1d, close_1d, rsi_1d\n\n   :param dataframe: Original dataframe\n   :param informative: Informative pair, most likely loaded via dp.get_pair_dataframe\n   :param timeframe: Timeframe of the original pair sample.\n   :param timeframe_inf: Timeframe of the informative pair sample.\n   :param ffill: Forwardfill missing values - optional but usually required\n   :return: Merged dataframe\n   :raise: ValueError if the secondary timeframe is shorter than the dataframe timeframe\n   \"\"\"\n\n    minutes_inf = timeframe_to_minutes(timeframe_inf)\n    minutes = timeframe_to_minutes(timeframe)\n    if minutes == minutes_inf:\n        # No need to forwardshift if the timeframes are identical\n        informative['date_merge'] = informative[\"date\"]\n    elif minutes < minutes_inf:\n        # Subtract \"small\" timeframe so merging is not delayed by 1 small candle\n        # Detailed explanation in https://github.com/freqtrade/freqtrade/issues/4073\n        informative['date_merge'] = (\n                informative[\"date\"] + pd.to_timedelta(minutes_inf, 'm') - pd.to_timedelta(minutes, 'm')\n        )\n    else:\n        raise ValueError(\"Tried to merge a faster timeframe to a slower timeframe.\"\n                         \"This would create new rows, and can throw off your regular indicators.\")\n\n    # Rename columns to be unique\n    informative.columns = [f\"{col}_{timeframe_inf}\" for col in informative.columns]\n\n    # Combine the 2 dataframes\n    # all indicators on the informative sample MUST be calculated before this point\n    dataframe = pd.merge(dataframe, informative, left_on='date',\n                         right_on=f'date_merge_{timeframe_inf}', how='left')\n    dataframe = dataframe.drop(f'date_merge_{timeframe_inf}', axis=1)\n\n    if ffill:\n        dataframe = dataframe.ffill()\n\n    return dataframe\n\n\ndef wma(series: Series, length: int) -> Series:\n    norm = 0\n    sum = 0\n\n    for i in range(1, length - 1):\n        weight = (length - i) * length\n        norm = norm + weight\n        sum = sum + series.shift(i) * weight\n\n    return sum / norm\n\n\ndef hma(series: Series, length: int) -> Series:\n    h = 2 * wma(series, math.floor(length / 2)) - wma(series, length)\n    hma = wma(h, math.floor(math.sqrt(length)))\n    return hma\n\n\ndef bollinger_bands(series: Series, moving_average='sma', length=20, mult=2.0) -> DataFrame:\n    basis = None\n    if moving_average == 'sma':\n        basis = ta.SMA(series, length)\n    elif moving_average == 'hma':\n        basis = hma(series, length)\n    else:\n        raise Exception(\"moving_average has to be sma or hma\")\n\n    dev = mult * ta.STDDEV(series, length)\n\n    return DataFrame({\n        'upper': basis + dev\n    })\n\n\nclass NowoIchimoku5mV2(IStrategy):\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    time_factor = int(60 / 5)\n\n    startup_candle_count = int(100 * time_factor)\n\n    use_sell_signal = False\n\n    use_custom_stoploss = True\n\n    trailing_stop = True\n\n    minimal_roi = {\n        \"0\": 999\n    }\n\n    stoploss = -0.293\n\n    plot_config = {\n        'main_plot': {\n            # 'lead_1': {\n            #     'color': 'green',\n            #     'fill_to': 'lead_2',\n            #     'fill_label': 'Ichimoku Cloud',\n            #     'fill_color': 'rgba(0,0,0,0.2)',\n            # },\n            # 'lead_2': {\n            #     'color': 'red',\n            # },\n            # 'conversion_line': {'color': 'blue'},\n            # 'base_line': {'color': 'orange'},\n            'upper': {\n                'color': 'blue'\n            }\n        },\n        'subplots': {\n            'Buy Allowed': {\n                'buy_allowed': {\n                    'color': 'blue'\n                },\n            },\n            'Should Buy': {\n                'should_buy': {\n                    'color': 'green'\n                },\n            },\n            'Is Cloud Green': {\n                'is_cloud_green': {\n                    'color': 'black'\n                }\n            }\n        }\n    }\n\n    srsi_k_min_profit = DecimalParameter(0.01, 0.99, decimals=3, default=0.036, space=\"sell\")\n    above_upper_min_profit = DecimalParameter(0.001, 0.5, decimals=3, default=0.011, space=\"sell\")\n    limit_factor = DecimalParameter(0.5, 5, decimals=3, default=1.918, space=\"sell\")\n    lower_cloud_factor = DecimalParameter(0.5, 1.5, decimals=3, default=0.971, space=\"sell\")\n    close_above_shifted_upper_cloud = DecimalParameter(0.5, 2, decimals=3, default=0.603, space=\"buy\")\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def populate_indicators(self, df_5m: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Get the informative pair\n        df_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        df_1h['upper'] = bollinger_bands(df_1h['close'], moving_average='hma', length=20, mult=2.5)['upper']\n\n        ichi_1h = indicators.ichimoku(df_1h)\n\n        df_1h['conversion_line'] = ichi_1h['tenkan_sen']\n        df_1h['base_line'] = ichi_1h['kijun_sen']\n\n        df_1h['lead_1'] = ichi_1h['leading_senkou_span_a']\n        df_1h['lead_2'] = ichi_1h['leading_senkou_span_b']\n\n        df_1h['is_cloud_green'] = ichi_1h['cloud_green']\n\n        df_1h['upper_cloud'] = df_1h['lead_1'].where(df_1h['lead_1'] > df_1h['lead_2'], df_1h['lead_2'])\n        df_1h['lower_cloud'] = df_1h['lead_1'].where(df_1h['lead_1'] < df_1h['lead_2'], df_1h['lead_2'])\n\n        df_1h['shifted_upper_cloud'] = df_1h['upper_cloud'].shift(25)\n        df_1h['shifted_lower_cloud'] = df_1h['lower_cloud'].shift(25)\n\n        smoothK = 3\n        smoothD = 3\n        lengthRSI = 14\n        lengthStoch = 14\n\n        df_1h['rsi'] = ta.RSI(df_1h, timeperiod=lengthRSI)\n\n        stochrsi = (df_1h['rsi'] - df_1h['rsi'].rolling(lengthStoch).min()) / (\n                df_1h['rsi'].rolling(lengthStoch).max() - df_1h['rsi'].rolling(lengthStoch).min())\n\n        df_1h['srsi_k'] = stochrsi.rolling(smoothK).mean() * 100\n        df_1h['srsi_d'] = df_1h['srsi_k'].rolling(smoothD).mean()\n\n        df = merge_informative_pair(df_5m, df_1h, self.timeframe, self.informative_timeframe, ffill=True)\n        # don't overwrite the base dataframe's OHLCV information\n        skip_columns = [(s + \"_\" + self.informative_timeframe) for s in\n                        ['date', 'open', 'high', 'low', 'close', 'volume']]\n        df.rename(\n            columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s,\n            inplace=True)\n\n        return df\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1 * self.time_factor].squeeze()\n        previous_candle = dataframe.iloc[-2 * self.time_factor].squeeze()\n\n        if (last_candle is not None) & (previous_candle is not None):\n            # In dry/live runs trade open date will not match candle open date therefore it must be\n            # rounded.\n            trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n            # Look up trade candle.\n            trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n\n            # trade_candle may be empty for trades that just opened as it is still incomplete.\n            if not trade_candle.empty:\n                trade_candle = trade_candle.squeeze()\n\n                if (last_candle['srsi_k'] > 80) & (current_profit > self.srsi_k_min_profit.value):\n                    return -0.0001\n\n                if (previous_candle['close'] < previous_candle['upper']) & (current_rate > last_candle['upper']) & (\n                        current_profit > self.above_upper_min_profit.value):\n                    return -0.0001\n\n                limit = trade.open_rate + (\n                        (trade.open_rate - trade_candle['shifted_lower_cloud']) * self.limit_factor.value)\n\n                if current_rate > limit:\n                    return -0.0001\n\n                if current_rate < (trade_candle['shifted_lower_cloud'] * self.lower_cloud_factor.value):\n                    return -0.0001\n\n        return -0.99\n\n    def populate_buy_trend(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df.info(verbose=True)\n\n        double_shifted_upper_cloud = df['upper_cloud'].shift(50 * self.time_factor)\n\n        close_above_shifted_upper_cloud = df['close'] > df[\n            'shifted_upper_cloud'] * self.close_above_shifted_upper_cloud.value\n        close_above_shifted_lower_cloud = df['close'] > df['shifted_lower_cloud']\n        close_above_double_shifted_upper_cloud = df['close'] > double_shifted_upper_cloud\n\n        conversion_line_above_base_line = df['conversion_line'] > df['base_line']\n        close_above_shifted_conversion_line = df['close'] > df['conversion_line'].shift(25 * self.time_factor)\n\n        df['should_buy'] = (df['close'] > df['open']) & \\\n                           close_above_shifted_upper_cloud & \\\n                           close_above_shifted_lower_cloud & \\\n                           df['is_cloud_green'] & \\\n                           conversion_line_above_base_line & \\\n                           close_above_shifted_conversion_line & \\\n                           close_above_double_shifted_upper_cloud\n\n        df['buy'] = False\n        df['buy_allowed'] = True\n\n        for i in range(1, len(df)):\n            df.loc[i, 'buy_allowed'] = df.at[i - 1, 'buy_allowed']\n\n            if df.at[i - 1, 'buy']:\n                df.loc[i, 'buy_allowed'] = False\n\n            if not df.at[i, 'is_cloud_green']:\n                df.loc[i, 'buy_allowed'] = True\n\n            df.loc[i, 'buy'] = df.at[i, 'buy_allowed'] & df.at[i, 'should_buy']\n\n        return df\n\n    def populate_sell_trend(self, df: DataFrame, metadata: dict) -> DataFrame:\n        df['sell'] = 0\n        return df\n"
  },
  {
    "path": "strategies/ONUR/ONUR.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass ONUR(IStrategy):\n    minimal_roi = {\n        \"0\": 0.131,\n        \"109\": 0.08,\n        \"226\": 0.03\n    }\n\n    stoploss = -0.99\n    trailing_stop = True\n    trailing_stop_positive = 0.293\n    trailing_stop_positive_offset = 0.362\n    trailing_only_offset_is_reached = True\n\n    timeframe = '15m'\n\n    order_types = {\n        \"buy\": \"limit\",\n        \"sell\": \"limit\",\n        \"emergencysell\": \"market\",\n        \"forcebuy\": \"market\",\n        \"forcesell\": \"market\",\n        \"stoploss\": \"market\",\n        \"stoploss_on_exchange\": True,\n        \"stoploss_on_exchange_interval\": 60,\n        \"stoploss_on_exchange_limit_ratio\": 0.99,\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 74)\n                & (dataframe['close'] > dataframe['bb_middleband'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # (dataframe['close'] > dataframe['bb_upperband'])\n            ),\n            'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/ObeliskIM_v1_1/ObeliskIM_v1_1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\nimport pandas as pd  # noqa\npd.options.mode.chained_assignment = None  # default='warn'\n\nimport technical.indicators as ftt\nfrom technical.util import resample_to_interval, resampled_merge\n\nfrom functools import reduce\nfrom datetime import datetime, timedelta\n\n\n# ObeliskIM v1.1 - 2021-03-24\n#\n# by Obelisk \n# https://twitter.com/brookmiles\n#\n# I watched a youtube video on Ichimoku and then wrote this last night at 3am while I couldn't sleep.\n# Run at your own risk.\n#\n# Improvements and suggestions welcome!\n#\n# Potential areas of improvement:\n# - reduce buying small peaks during sideways ranges\n# - additional entry trigger(s) for strong up trends / breakouts if tk cross happened in/below cloud\n\nclass ObeliskIM_v1_1(IStrategy):\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    startup_candle_count = 288 # one day @ 5m\n    process_only_new_candles = True\n\n    minimal_roi = {\n        \"0\": 5,\n    }\n\n    # Stoploss:\n    stoploss = -0.04\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'senkou_a': {\n                'color': 'green',\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud',\n                'fill_color': 'rgba(0,0,0,0.2)',\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {\n                'color': 'red',\n            },\n            'tenkan_sen': { 'color': 'orange' },\n            'kijun_sen': { 'color': 'blue' },\n        },\n        'subplots': {\n            \"Ichimoku\": {\n                'cloud_green': {'color': 'green'},\n                'cloud_red': {'color': 'red'},\n\n                'cloud_green_strong': {'color': 'green'},\n                'cloud_red_strong': {'color': 'red'},\n\n                'tk_cross_up': {'color': 'blue'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'blue'},\n            },\n        }\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        ichimoku = ftt.ichimoku(dataframe, \n            conversion_line_period=20, \n            base_line_periods=60,\n            laggin_span=120, \n            displacement=30\n            )\n\n        # cross indicators\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n\n        # cloud, green a > b, red a < b\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        # dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        # dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\n\n        dataframe['cloud_green_strong'] = (\n                dataframe['cloud_green'] & \n                (dataframe['tenkan_sen'] > dataframe['kijun_sen']) &\n                (dataframe['kijun_sen'] > dataframe['senkou_a'])\n            ).astype('int') * 2\n\n        dataframe['cloud_red_strong'] = (\n                dataframe['cloud_red'] & \n                (dataframe['tenkan_sen'] < dataframe['kijun_sen']) &\n                (dataframe['kijun_sen'] < dataframe['senkou_b'])\n            ).astype('int') * -2\n\n        dataframe.loc[\n            qtpylib.crossed_above(dataframe['tenkan_sen'], dataframe['kijun_sen']),\n            'tk_cross_up'] = 3\n        dataframe['tk_cross_up'].fillna(method='ffill', inplace=True, limit=2)\n        dataframe['tk_cross_up'].fillna(value=0, inplace=True)\n\n        # dataframe['rsi_ok'] = (dataframe['rsi'] < 75).astype('int')\n        dataframe['ema35_ok'] = (\n            (dataframe['ema3'] > dataframe['ema5']) &\n            (dataframe['ema5'] > dataframe['ema10'])\n            ).astype('int')\n\n        dataframe['spike'] = (\n            (dataframe['close'] > (dataframe['close'].shift(3) * (1 - self.stoploss * 0.9)))\n            ).astype('int')\n\n        dataframe['recent_high'] = dataframe['high'].rolling(12).max()\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # params = self.buy_params\n\n        conditions = []\n        # conditions.append(dataframe['volume'] > 0)\n\n        conditions.append( dataframe['cloud_green_strong'] > 0 )\n        # conditions.append( dataframe['ema3'] > dataframe['ema5'] )\n        conditions.append( dataframe['tk_cross_up'] > 0 )\n        # conditions.append( dataframe['rsi_ok'] > 0 )\n        conditions.append( dataframe['ema35_ok'] > 0 )\n        conditions.append( dataframe['close'] > dataframe['close'].shift() )\n        conditions.append( dataframe['close'] > dataframe['recent_high'].shift() ) # remove me for a \"good time\"\n        conditions.append( dataframe['spike'] < 1 )\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # params = self.sell_params\n\n        conditions = []\n        # conditions.append(dataframe['volume'] > 0)\n\n        conditions.append( \n            qtpylib.crossed_below(dataframe['tenkan_sen'], dataframe['kijun_sen']) | \n            qtpylib.crossed_below(dataframe['close'], dataframe['kijun_sen'])\n            )\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ObeliskRSI_v6_1/ObeliskRSI_v6_1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\nimport pandas as pd  # noqa\npd.options.mode.chained_assignment = None  # default='warn'\n\nfrom technical.util import resample_to_interval, resampled_merge\n\nfrom functools import reduce\nfrom datetime import datetime, timedelta\n\n# ObeliskRSI v6.1 - 2021-03-06\n#\n# by Obelisk \n# https://twitter.com/brookmiles\n#\n# Run at your own risk.\n# I don't know what I'm doing.\n# Backtests quite a bit better than it actually works.\n# Let me know if you manage to improve it!\n#\n# Buys when RSI crosses the low threshold\n# Doesn't wait for reversal, trying to anticipate the \"bottom\" of the dip.\n#\n# Sells on ROI (often), Stoploss (sometimes), or RSI high (rarely)\n#\n# Custom Stoploss starts wide and then narrows over time\n# Combined with ROI, every trade will be forced to close in custom_stop_ramp_minutes, win or lose\n#\n# Bull/Bear trends\n#\n# Uses two different sets of buy/sell thresholds, which are used depending on the longer RSI trend\n# Enter earlier and leave later when bullish; enter later and leave earlier when bearish\n#\n# Strengths\n#\n# Choppy markets - requires strong enough dips to trigger a buy, then we want a bounce back up\n#\n# Weaknesses\n#\n# Steady bull runs - no dips to buy, missed opportunity\n# Sudden ongoing bear runs - if the market keeps dipping and dropping repeatedly that's bad,\n# so use protections, eg.\n#\n# \"protections\": [\n#     {\n#         \"method\": \"StoplossGuard\",\n#         \"lookback_period\": 720,\n#         \"trade_limit\": 2,\n#         \"stop_duration\": 720,\n#         \"only_per_pair\": true\n#     },\n# ],  \n# \n# Works best on high volume pairs with decent volatility eg.\n#\n# \"SXP/USD\",\n# \"MATIC/USD\",\n# \"SUSHI/USD\",\n# \"CHZ/USD\",\n#\n# and not ETH/USD or BTC/USD\n\n\ndef easeInCubic(t):\n    return t * t * t\n\ndef clamp(num, min_value, max_value):\n    return max(min(num, max_value), min_value)\n\ndef clamp01(num):\n    return clamp(num, 0, 1)\n\n\nclass ObeliskRSI_v6_1(IStrategy):\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    startup_candle_count = 240\n    process_only_new_candles = True\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.15,\n        \"35\": 0.04,\n        \"65\": 0.01,\n        \"115\": 0\n    }\n\n    # Buy hyperspace params:\n    buy_params = {\n     'bear-buy-rsi-value': 21, \n     'bull-buy-rsi-value': 35\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'bear-sell-rsi-value': 55, \n     'bull-sell-rsi-value': 69 \n    }\n\n    # Stoploss:\n    stoploss = -0.30\n\n    use_custom_stoploss = True\n    custom_stop_ramp_minutes = 110\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # longer RSI used for determining trend\n        resample_rsi_indicator = self.get_ticker_indicator() * 12\n        resample_rsi_key = 'resample_{}_rsi'.format(resample_rsi_indicator)\n\n        dataframe_long = resample_to_interval(dataframe, resample_rsi_indicator)\n        dataframe_long['rsi'] = ta.RSI(dataframe_long, timeperiod=14)\n        dataframe = resampled_merge(dataframe, dataframe_long)\n        dataframe[resample_rsi_key].fillna(method='ffill', inplace=True)\n\n        # bull used to select between two different sets of buy/sell threshold values\n        # based on long RSI\n        dataframe['bull'] = dataframe[resample_rsi_key].gt(60).astype('int')\n\n        # normal rsi acts mainly as the buy trigger\n        # used for sell as well, but more likely to ROI or stop out\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    # buy low\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        conditions = []\n        conditions.append(dataframe['volume'] > 0)\n\n        conditions.append(\n            ((dataframe['bull'] > 0) & qtpylib.crossed_below(dataframe['rsi'], params['bull-buy-rsi-value'])) |\n            (~(dataframe['bull'] > 0) & qtpylib.crossed_below(dataframe['rsi'], params['bear-buy-rsi-value']))\n            )\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'buy'] = 1\n\n        return dataframe\n\n    # sell high\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        conditions = []\n        conditions.append(dataframe['volume'] > 0)\n\n        conditions.append(\n            ((dataframe['bull'] > 0) & (dataframe['rsi'] > params['bull-sell-rsi-value'])) |\n            (~(dataframe['bull'] > 0) & (dataframe['rsi'] > params['bear-sell-rsi-value']))\n            )\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'sell'] = 1\n\n        return dataframe\n\n    # Custom stoploss starts at the basic stoploss, and ramps towards zero in a curve, \n    # narrowing the trailing stoploss until forcing the trade to stop out after custom_stop_ramp_minutes\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n\n        since_open = current_time - trade.open_date\n        sl_pct = 1 - easeInCubic( clamp01( since_open / timedelta(minutes=self.custom_stop_ramp_minutes) ) )\n        sl_ramp = abs(self.stoploss) * sl_pct\n\n        return sl_ramp + 0.001 # we can't go all the way to zero\n"
  },
  {
    "path": "strategies/Obelisk_3EMA_StochRSI_ATR/Obelisk_3EMA_StochRSI_ATR.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n# --------------------------------\nimport pandas as pd\nimport numpy as np\nimport logging\nfrom datetime import datetime, timedelta\nimport technical.indicators as ftt\nfrom freqtrade.strategy import stoploss_from_open\nfrom freqtrade.exchange import timeframe_to_minutes\n\nlogger = logging.getLogger(__name__)\n\n# Obelisk_3EMA_StochRSI_ATR - 2021-04-10\n#\n# by Obelisk\n# https://github.com/brookmiles/\n#\n# DO NOT RUN LIVE\n#\n# based on Trade Pro \"76% Win Rate Highly Profitable Trading Strategy Proven 100 Trades - 3 EMA + Stochastic RSI + ATR\"\n# https://www.youtube.com/watch?v=7NM7bR2mL7U\n#\n# correctness/accuracy not guaranteed\n#\n# WARNING\n#\n# While this strategy is designed to be run at 1h, it should be backtested at 5m (or 1m).\n# This is done to avoid misleading results produced using trailing stops and roi values at longer timeframes.\n#\n# When running at 5m, an informative pair at 1h will be used to generate signals equivalent to running at 1h.\n#\n# live / dryrun: use 1h\n# backtest / hyperopt: use 5m or 1m\n\nclass Obelisk_3EMA_StochRSI_ATR(IStrategy):\n\n    # Backtest or hyperopt at this timeframe\n    timeframe = '5m'\n\n    # Live or Dry-run at this timeframe\n    informative_timeframe = '1h'\n\n    startup_candle_count = 500\n\n    # NOTE: this strat only uses candle information, so processing between\n    # new candles is a waste of resources as nothing will change\n    process_only_new_candles = True\n\n    minimal_roi = {\n        \"0\": 1,\n    }\n\n    stoploss = -0.99\n    use_custom_stoploss = True\n\n    custom_info = {}\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['ema8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n\n        #RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        #StochRSI\n        period = 14\n        smoothD = 3\n        SmoothK = 3\n        stochrsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(period).min()) / (dataframe['rsi'].rolling(period).max() - dataframe['rsi'].rolling(period).min())\n        dataframe['srsi_k'] = stochrsi.rolling(SmoothK).mean() * 100\n        dataframe['srsi_d'] = dataframe['srsi_k'].rolling(smoothD).mean()\n\n        dataframe.loc[\n            (dataframe['ema8'] > dataframe['ema14']) &\n            (dataframe['ema14'] > dataframe['ema50']) &\n            qtpylib.crossed_above(dataframe['srsi_k'], dataframe['srsi_d'])\n        ,\n        'go_long'] = 1\n        dataframe['go_long'].fillna(0, inplace=True)\n\n        dataframe.loc[\n            qtpylib.crossed_above(dataframe['go_long'], 0),\n            'take_profit'] = dataframe['close'] + dataframe['atr'] * 2\n        dataframe['take_profit'].fillna(method='ffill', inplace=True)\n\n        dataframe.loc[\n            qtpylib.crossed_above(dataframe['go_long'], 0),\n            'stop_loss'] = dataframe['close'] - dataframe['atr'] * 3\n        dataframe['stop_loss'].fillna(method='ffill', inplace=True)\n\n        dataframe.loc[\n            qtpylib.crossed_above(dataframe['go_long'], 0),\n            'stop_pct'] = (dataframe['atr'] * 3) / dataframe['close']\n        dataframe['stop_pct'].fillna(method='ffill', inplace=True)\n\n        # add indicator mapped to correct DatetimeIndex to custom_info\n        self.custom_info[metadata['pair']] = dataframe[['date', 'stop_pct', 'take_profit']].copy().set_index('date')\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        if self.config['runmode'].value in ('backtest', 'hyperopt'):\n            assert (timeframe_to_minutes(self.timeframe) <= 5), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.do_indicators(dataframe, metadata)\n        else:\n            if not self.dp:\n                return dataframe\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n            informative = self.do_indicators(informative.copy(), metadata)\n\n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            # don't overwrite the base dataframe's OHLCV information\n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            qtpylib.crossed_above(dataframe['go_long'], 0)\n        ,\n        'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['sell'] = 0\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        result = 1\n\n        custom_info_pair = self.custom_info[pair]\n        if custom_info_pair is not None:\n            # using current_time/open_date directly will only work in backtesting/hyperopt.\n            # in live / dry-run, we have to search for nearest row before\n            tz = custom_info_pair.index.tz\n            open_date = trade.open_date_utc if hasattr(trade, 'open_date_utc') else trade.open_date.replace(tzinfo=custom_info_pair.index.tz)\n            open_date_mask = custom_info_pair.index.unique().get_loc(open_date, method='ffill')\n            open_df = custom_info_pair.iloc[open_date_mask]\n\n            # trade might be open too long for us to find opening candle\n            if(open_df is None or len(open_df) == 0):\n                logger.debug(\"No open_df :(\")\n                return 1 # oh well\n\n            # stop out if we have reached our take profit limit\n            take_profit = open_df['take_profit']\n            if (take_profit is not None):\n                if current_rate > take_profit:\n                    logger.debug(\"take_profit={}, current={}\".format(\n                        take_profit,\n                        current_rate\n                        ))\n                    return 0.001\n\n            # keep trailing stoploss at -stop_pct from the open price\n            stop_pct = open_df['stop_pct']\n            if (stop_pct is not None):\n                new_stop = stoploss_from_open(-stop_pct, current_profit)\n                logger.debug(\"open={}, current={}, profit={}, stop_pct={}, stop={}\".format(\n                    current_rate / (1 + current_profit),\n                    current_rate,\n                    current_profit,\n                    stop_pct,\n                    current_rate * (1 - new_stop)))\n                if new_stop > 0:\n                    result = new_stop\n\n        return result\n\n    plot_config = {\n        'main_plot': {\n            'ema50': { 'color': 'orange' },\n            'ema14': { 'color': 'blue' },\n            'ema8': { 'color': 'purple' },\n            'take_profit': { 'color': 'green' },\n            'stop_loss': { 'color': 'red' },\n        },\n        'subplots': {\n            \"SRSI\": {\n                'srsi_k': {'color': 'blue'},\n                'srsi_d': {'color': 'red'},\n            },\n            \"ATR\": {\n                'atr': {'color': 'blue'},\n            },\n        }\n    }\n"
  },
  {
    "path": "strategies/Obelisk_Ichimoku_Slow_v1_3/Obelisk_Ichimoku_Slow_v1_3.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n# --------------------------------\nimport pandas as pd\nimport numpy as np\nimport technical.indicators as ftt\nfrom freqtrade.exchange import timeframe_to_minutes\n\n# Obelisk_Ichimoku_Slow v1.3 - 2021-04-20\n#\n# by Obelisk \n# https://github.com/brookmiles/\n#\n# 1.3 increase return without too much additional drawdown\n#  - add ema entry guards\n#  - remove cloud top exit signal from 1.2\n#\n# The point of this strategy is to buy and hold an up trend as long as possible.\n# If you are tempted to add ROI or trailing stops, you will need to make other modifications as well.\n#\n# This strategy can optionally be backtested at 5m or 1m to validate roi/trailing stop behaviour (there isn't any).\n#\n# WARNING \n#\n# Do not use stoploss_on_exchange or the bot may trigger emergencysell when it \n# fails to place the stoploss.\n#\n# WARNING\n#\n# This strat will buy into ongoing trends, so pay attention to timing when you launch it. \n# If the market is peaking then you may end up buying into trends that are just about to end.\n#\n#\n# Contributions:\n# JimmyNixx - SSL Channel confirmation\n#\n# Backtested with pairlist generated with:\n#     \"pairlists\": [\n#         {\n#             \"method\": \"VolumePairList\",\n#             \"number_assets\": 25,\n#             \"sort_key\": \"quoteVolume\",\n#             \"refresh_period\": 1800\n#         },\n#         {\"method\": \"AgeFilter\", \"min_days_listed\": 10},\n#         {\"method\": \"PrecisionFilter\"},\n#         {\"method\": \"PriceFilter\", \"low_price_ratio\": 0.001},\n#         {\n#             \"method\": \"RangeStabilityFilter\",\n#             \"lookback_days\": 3,\n#             \"min_rate_of_change\": 0.1,\n#             \"refresh_period\": 1440\n#         },\n#     ],\n\ndef ssl_atr(dataframe, length = 7):\n    df = dataframe.copy()\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['atr']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['atr']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass Obelisk_Ichimoku_Slow_v1_3(IStrategy):\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    # generate signals from the 1h timeframe\n    informative_timeframe = '1h'\n\n    # WARNING: ichimoku is a long indicator, if you remove or use a \n    # shorter startup_candle_count your results will be unstable/invalid \n    # for up to a week from the start of your backtest or dry/live run\n    # (180 candles = 7.5 days)\n    startup_candle_count = 180\n\n    # NOTE: this strat only uses candle information, so processing between\n    # new candles is a waste of resources as nothing will change\n    process_only_new_candles = True\n\n    minimal_roi = {\n        \"0\": 0.10,\n        \"60\": 0.072,\n        \"120\": 0.049,\n        \"240\": 0.02,\n        \"360\": 0,\n    }\n    # Trailing stoploss (not used)\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.04\n\n    # WARNING setting a stoploss for this strategy doesn't make much sense, as it will buy\n    # back into the trend at the next available opportunity, unless the trend has ended,\n    # in which case it would sell anyway.\n\n    # Stoploss:\n    stoploss = -0.99\n\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def slow_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        displacement = 30\n        ichimoku = ftt.ichimoku(dataframe, \n            conversion_line_period=20, \n            base_line_periods=60,\n            laggin_span=120, \n            displacement=displacement\n            )\n\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n\n        # cross indicators\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n\n        # cloud, green a > b, red a < b\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\n\n        dataframe.loc[:, 'cloud_top'] = dataframe.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n        dataframe.loc[:, 'cloud_bottom'] = dataframe.loc[:, ['senkou_a', 'senkou_b']].min(axis=1)\n\n        # DANGER ZONE START\n\n        # NOTE: Not actually the future, present data that is normally shifted forward for display as the cloud\n        dataframe['future_green'] = (dataframe['leading_senkou_span_a'] > dataframe['leading_senkou_span_b']).astype('int') * 2\n\n        # The chikou_span is shifted into the past, so we need to be careful not to read the\n        # current value.  But if we shift it forward again by displacement it should be safe to use.\n        # We're effectively \"looking back\" at where it normally appears on the chart.\n        dataframe['chikou_high'] = (\n                (dataframe['chikou_span'] > dataframe['senkou_a']) &\n                (dataframe['chikou_span'] > dataframe['senkou_b'])\n            ).shift(displacement).fillna(0).astype('int')\n\n        # DANGER ZONE END\n\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n        dataframe['ema_ok'] = (\n                (dataframe['close'] > dataframe['ema50'])\n                & (dataframe['ema50'] > dataframe['ema200'])\n            ).astype('int') * 2\n\n        dataframe['efi_base'] = ((dataframe['close'] - dataframe['close'].shift()) * dataframe['volume'])\n        dataframe['efi'] = ta.EMA(dataframe['efi_base'], 13)\n        dataframe['efi_ok'] = (dataframe['efi'] > 0).astype('int')\n\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        ssl_down, ssl_up = ssl_atr(dataframe, 10)\n        dataframe['ssl_down'] = ssl_down\n        dataframe['ssl_up'] = ssl_up\n        dataframe['ssl_ok'] = (\n                (ssl_up > ssl_down) \n            ).astype('int') * 3\n\n        dataframe['ichimoku_ok'] = (\n                (dataframe['tenkan_sen'] > dataframe['kijun_sen'])\n                & (dataframe['close'] > dataframe['cloud_top'])\n                & (dataframe['future_green'] > 0) \n                & (dataframe['chikou_high'] > 0) \n            ).astype('int') * 4\n\n        dataframe['entry_ok'] = (\n                (dataframe['efi_ok'] > 0)\n                & (dataframe['open'] < dataframe['ssl_up'])\n                & (dataframe['close'] < dataframe['ssl_up'])\n            ).astype('int') * 1\n\n        dataframe['trend_pulse'] = (\n                (dataframe['ichimoku_ok'] > 0) \n                & (dataframe['ssl_ok'] > 0)\n                & (dataframe['ema_ok'] > 0)\n            ).astype('int') * 2\n\n        dataframe['trend_over'] = (\n                (dataframe['ssl_ok'] == 0)\n            ).astype('int') * 1\n\n        dataframe.loc[ (dataframe['trend_pulse'] > 0), 'trending'] = 3\n        dataframe.loc[ (dataframe['trend_over'] > 0) , 'trending'] = 0\n        dataframe['trending'].fillna(method='ffill', inplace=True)\n\n        return dataframe\n\n    def fast_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # none atm\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Obelisk_Ichimoku_Slow does not use trailing stop or roi and should be safe to backtest at 1h\n        # if self.config['runmode'].value in ('backtest', 'hyperopt'):\n        #     assert (timeframe_to_minutes(self.timeframe) <= 5), \"Backtest this strategy in 5m or 1m timeframe.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.slow_tf_indicators(dataframe, metadata)\n        else:\n            assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n            informative = self.slow_tf_indicators(informative.copy(), metadata)\n\n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            # don't overwrite the base dataframe's OHLCV information\n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        dataframe = self.fast_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['trending'] > 0)\n            & (dataframe['entry_ok'] > 0)\n            & (dataframe['date'].dt.minute == 0) # when backtesting at 5m/1m only set signal on the hour\n        , 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (dataframe['trending'] == 0)\n            & (dataframe['date'].dt.minute == 0) # when backtesting at 5m/1m only set signal on the hour\n            , 'sell'] = 1\n        return dataframe\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'senkou_a': {\n                'color': 'green',\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud',\n                'fill_color': 'rgba(0,0,0,0.2)',\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {\n                'color': 'red',\n            },\n            'tenkan_sen': { 'color': 'blue' },\n            'kijun_sen': { 'color': 'orange' },\n\n            # 'chikou_span': { 'color': 'lightgreen' },\n\n            # 'ssl_up': { 'color': 'green' },\n            # 'ssl_down': { 'color': 'red' },\n\n            # 'ema50': { 'color': 'violet' },\n            # 'ema200': { 'color': 'magenta' },\n        },\n        'subplots': {\n            \"Trend\": {\n                'trend_pulse': {'color': 'blue'},\n                'trending': {'color': 'orange'},\n                'trend_over': {'color': 'red'},\n            },\n            \"Signals\": {\n                'ichimoku_ok': {'color': 'green'},\n                'ssl_ok': {'color': 'red'},\n                'ema_ok': {'color': 'orange'},\n                'entry_ok': {'color': 'blue'},\n            },\n        }\n    }\n"
  },
  {
    "path": "strategies/Obelisk_Ichimoku_ZEMA_v1/Obelisk_Ichimoku_ZEMA_v1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, DecimalParameter, IntParameter\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n# --------------------------------\nimport pandas as pd\nimport numpy as np\nimport technical.indicators as ftt\nfrom freqtrade.exchange import timeframe_to_minutes\nimport logging\n\nlogger = logging.getLogger(__name__)\n\n# Obelisk_Ichimoku_ZEMA v1 - 2021-05-20\n#\n# EXPERIMENTAL\n#\n# RUN AT YOUR OWN RISK\n#\n# by Obelisk\n# https://github.com/brookmiles/\n\ndef ssl_atr(dataframe, length = 7):\n    df = dataframe.copy()\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['atr']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['atr']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass Obelisk_Ichimoku_ZEMA_v1(IStrategy):\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # generate signals from the 1h timeframe\n    informative_timeframe = '1h'\n\n    # WARNING: ichimoku is a long indicator, if you remove or use a \n    # shorter startup_candle_count your backtest results will be unreliable\n    startup_candle_count = 500\n\n    # NOTE: this strat only uses candle information, so processing between\n    # new candles is a waste of resources as nothing will change\n    process_only_new_candles = True\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.078,\n        \"40\": 0.062,\n        \"99\": 0.039,\n        \"218\": 0\n    }\n\n    stoploss = -0.294\n\n    # Buy hyperspace params:\n    buy_params = {\n     'low_offset': 0.964, 'zema_len_buy': 51\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'high_offset': 1.004, 'zema_len_sell': 72\n    }\n\n    low_offset = DecimalParameter(0.80, 1.20, default=1.004, space='buy', optimize=True)\n    high_offset = DecimalParameter(0.80, 1.20, default=0.964, space='sell', optimize=True)\n    zema_len_buy = IntParameter(30, 90, default=72, space='buy', optimize=True)\n    zema_len_sell = IntParameter(30, 90, default=51, space='sell', optimize=True)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        return informative_pairs\n\n    def slow_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        displacement = 30\n        ichimoku = ftt.ichimoku(dataframe, \n            conversion_line_period=20, \n            base_line_periods=60,\n            laggin_span=120, \n            displacement=displacement\n            )\n\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n\n        # cross indicators\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n\n        # cloud, green a > b, red a < b\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\n\n        dataframe.loc[:, 'cloud_top'] = dataframe.loc[:, ['senkou_a', 'senkou_b']].max(axis=1)\n        dataframe.loc[:, 'cloud_bottom'] = dataframe.loc[:, ['senkou_a', 'senkou_b']].min(axis=1)\n\n        # DANGER ZONE START\n\n        # NOTE: Not actually the future, present data that is normally shifted forward for display as the cloud\n        dataframe['future_green'] = (dataframe['leading_senkou_span_a'] > dataframe['leading_senkou_span_b']).astype('int') * 2\n        dataframe['future_red'] = (dataframe['leading_senkou_span_a'] < dataframe['leading_senkou_span_b']).astype('int') * 2\n\n        # The chikou_span is shifted into the past, so we need to be careful not to read the\n        # current value.  But if we shift it forward again by displacement it should be safe to use.\n        # We're effectively \"looking back\" at where it normally appears on the chart.\n        dataframe['chikou_high'] = (\n                (dataframe['chikou_span'] > dataframe['cloud_top'])\n            ).shift(displacement).fillna(0).astype('int')\n\n        dataframe['chikou_low'] = (\n                (dataframe['chikou_span'] < dataframe['cloud_bottom'])\n            ).shift(displacement).fillna(0).astype('int')\n\n        # DANGER ZONE END\n\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        ssl_down, ssl_up = ssl_atr(dataframe, 10)\n        dataframe['ssl_down'] = ssl_down\n        dataframe['ssl_up'] = ssl_up\n        dataframe['ssl_ok'] = (\n                (ssl_up > ssl_down) \n            ).astype('int') * 3\n        dataframe['ssl_bear'] = (\n                (ssl_up < ssl_down) \n            ).astype('int') * 3\n\n        dataframe['ichimoku_ok'] = (\n                (dataframe['tenkan_sen'] > dataframe['kijun_sen'])\n                & (dataframe['close'] > dataframe['cloud_top'])\n                & (dataframe['future_green'] > 0) \n                & (dataframe['chikou_high'] > 0) \n            ).astype('int') * 4\n\n        dataframe['ichimoku_bear'] = (\n                (dataframe['tenkan_sen'] < dataframe['kijun_sen'])\n                & (dataframe['close'] < dataframe['cloud_bottom'])\n                & (dataframe['future_red'] > 0) \n                & (dataframe['chikou_low'] > 0) \n            ).astype('int') * 4\n\n        dataframe['ichimoku_valid'] = (\n                (dataframe['leading_senkou_span_b'] == dataframe['leading_senkou_span_b']) # not NaN\n            ).astype('int') * 1\n\n        dataframe['trend_pulse'] = (\n                (dataframe['ichimoku_ok'] > 0) \n                & (dataframe['ssl_ok'] > 0)\n            ).astype('int') * 2\n\n        dataframe['bear_trend_pulse'] = (\n                (dataframe['ichimoku_bear'] > 0) \n                & (dataframe['ssl_bear'] > 0)\n            ).astype('int') * 2\n\n\n        dataframe['trend_over'] = (\n                (dataframe['ssl_ok'] == 0)\n                | (dataframe['close'] < dataframe['cloud_top'])\n            ).astype('int') * 1\n\n        dataframe['bear_trend_over'] = (\n                (dataframe['ssl_bear'] == 0)\n                | (dataframe['close'] > dataframe['cloud_bottom'])\n            ).astype('int') * 1\n\n        dataframe.loc[ (dataframe['trend_pulse'] > 0), 'trending'] = 3\n        dataframe.loc[ (dataframe['trend_over'] > 0) , 'trending'] = 0\n        dataframe['trending'].fillna(method='ffill', inplace=True)\n\n        dataframe.loc[ (dataframe['bear_trend_pulse'] > 0), 'bear_trending'] = 3\n        dataframe.loc[ (dataframe['bear_trend_over'] > 0) , 'bear_trending'] = 0\n        dataframe['bear_trending'].fillna(method='ffill', inplace=True)\n\n        return dataframe\n\n    def fast_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            for len in range(30, 91):\n                dataframe[f'zema_{len}'] = ftt.zema(dataframe, period=len)\n        else:\n            dataframe[f'zema_{self.zema_len_buy.value}'] = ftt.zema(dataframe, period=self.zema_len_buy.value)\n            dataframe[f'zema_{self.zema_len_sell.value}'] = ftt.zema(dataframe, period=self.zema_len_sell.value)\n            dataframe[f'zema_buy'] = ftt.zema(dataframe, period=self.zema_len_buy.value) * self.low_offset.value\n            dataframe[f'zema_sell'] = ftt.zema(dataframe, period=self.zema_len_sell.value) * self.high_offset.value\n\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert (timeframe_to_minutes(self.timeframe) == 5), \"Run this strategy at 5m.\"\n\n        if self.timeframe == self.informative_timeframe:\n            dataframe = self.slow_tf_indicators(dataframe, metadata)\n        else:\n            assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n            informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n            informative = self.slow_tf_indicators(informative.copy(), metadata)\n\n            dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\n            # don't overwrite the base dataframe's OHLCV information\n            skip_columns = [(s + \"_\" + self.informative_timeframe) for s in ['date', 'open', 'high', 'low', 'close', 'volume']]\n            dataframe.rename(columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s, inplace=True)\n\n        dataframe = self.fast_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        zema = f'zema_{self.zema_len_buy.value}'\n\n        dataframe.loc[\n            (dataframe['ichimoku_valid'] > 0)\n            & (dataframe['bear_trending'] == 0)\n            & (dataframe['close'] < (dataframe[zema] * self.low_offset.value))\n        , 'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        zema = f'zema_{self.zema_len_sell.value}'\n\n        dataframe.loc[\n            (\n                (dataframe['close'] > (dataframe[zema] * self.high_offset.value))\n            )\n        , 'sell'] = 1\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: 'Trade', order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: 'datetime', **kwargs) -> bool:\n\n        if sell_reason in ('roi',):\n            dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n            current_candle = dataframe.iloc[-1]\n            if current_candle is not None:\n                current_candle = current_candle.squeeze()\n                # don't sell during ichimoku uptrend\n                if current_candle['trending'] > 0:\n                    return False\n\n        return True\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'senkou_a': {\n                'color': 'green',\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud',\n                'fill_color': 'rgba(0,0,0,0.2)',\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {\n                'color': 'red',\n            },\n            'tenkan_sen': { 'color': 'blue' },\n            'kijun_sen': { 'color': 'orange' },\n\n            # 'chikou_span': { 'color': 'lightgreen' },\n\n            'ssl_up': { 'color': 'green' },\n            # 'ssl_down': { 'color': 'red' },\n\n            # 'ema50': { 'color': 'violet' },\n            # 'ema200': { 'color': 'magenta' },\n\n            'zema_buy': { 'color': 'blue' },\n            'zema_sell': { 'color': 'orange' },\n        },\n        'subplots': {\n            \"Trend\": {\n                'trending': {'color': 'green'},\n                'bear_trending': {'color': 'red'},\n            },\n            \"Bull\": {\n                'trend_pulse': {'color': 'blue'},\n                'trending': {'color': 'orange'},\n                'trend_over': {'color': 'red'},\n            },\n            \"Bull Signals\": {\n                'ichimoku_ok': {'color': 'green'},\n                'ssl_ok': {'color': 'red'},\n            },\n            \"Bear\": {\n                'bear_trend_pulse': {'color': 'blue'},\n                'bear_trending': {'color': 'orange'},\n                'bear_trend_over': {'color': 'red'},\n            },\n            \"Bear Signals\": {\n                'ichimoku_bear': {'color': 'green'},\n                'ssl_bear': {'color': 'red'},\n            },\n            \"Misc\": {\n                'ichimoku_valid': {'color': 'green'},\n            },\n        }\n    }"
  },
  {
    "path": "strategies/Obelisk_TradePro_Ichi_v1_1/Obelisk_TradePro_Ichi_v1_1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# --------------------------------\nimport pandas as pd  # noqa\npd.options.mode.chained_assignment = None  # default='warn'\n\nimport technical.indicators as ftt\nfrom technical.util import resample_to_interval, resampled_merge\n\nfrom functools import reduce\nfrom datetime import datetime, timedelta\n\n# Obelisk_TradeProIM v1 - 2021-03-25\n#\n# by Obelisk \n# https://twitter.com/brookmiles\n#\n# Based on \"Crazy Results Best Ichimoku Cloud Trading Strategy Proven 100 Trades\" by Trade Pro\n# https://www.youtube.com/watch?v=8gWIykJgMNY\n#\n# Does not attempt to emulate the risk/reward take-profit/stop-loss, so the sell criteria are mine.\n\nclass Obelisk_TradePro_Ichi_v1_1(IStrategy):\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    startup_candle_count = 120\n    process_only_new_candles = True\n\n    # no ROI\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    # Stoploss:\n    stoploss = -0.015\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'senkou_a': {\n                'color': 'green',\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud',\n                'fill_color': 'rgba(0,0,0,0.2)',\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {\n                'color': 'red',\n            },\n            'tenkan_sen': { 'color': 'orange' },\n            'kijun_sen': { 'color': 'blue' },\n\n            'chikou_span': { 'color': 'lightgreen' },\n        },\n        'subplots': {\n            \"Signals\": {\n                'go_long': {'color': 'blue'},\n                'future_green': {'color': 'green'},\n                'chikou_high': {'color': 'lightgreen'},\n            },\n        }\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # # Standard Settings\n        # displacement = 26\n        # ichimoku = ftt.ichimoku(dataframe, \n        #     conversion_line_period=9, \n        #     base_line_periods=26,\n        #     laggin_span=52, \n        #     displacement=displacement\n        #     )\n\n        # Crypto Settings\n        displacement = 30\n        ichimoku = ftt.ichimoku(dataframe, \n            conversion_line_period=20, \n            base_line_periods=60,\n            laggin_span=120, \n            displacement=displacement\n            )\n\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n\n        # cross indicators\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n\n        # cloud, green a > b, red a < b\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\n\n        # DANGER ZONE START\n\n        # NOTE: Not actually the future, present data that is normally shifted forward for display as the cloud\n        dataframe['future_green'] = (dataframe['leading_senkou_span_a'] > dataframe['leading_senkou_span_b']).astype('int') * 2\n\n        # The chikou_span is shifted into the past, so we need to be careful not to read the\n        # current value.  But if we shift it forward again by displacement it should be safe to use.\n        # We're effectively \"looking back\" at where it normally appears on the chart.\n        dataframe['chikou_high'] = (\n                (dataframe['chikou_span'] > dataframe['senkou_a']) &\n                (dataframe['chikou_span'] > dataframe['senkou_b'])\n            ).shift(displacement).fillna(0).astype('int')\n\n        # DANGER ZONE END\n\n        dataframe['go_long'] = (\n                (dataframe['tenkan_sen'] > dataframe['kijun_sen']) &\n                (dataframe['close'] > dataframe['senkou_a']) &\n                (dataframe['close'] > dataframe['senkou_b']) &\n                (dataframe['future_green'] > 0) &\n                (dataframe['chikou_high'] > 0)\n                ).astype('int') * 3\n\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n\n            qtpylib.crossed_above(dataframe['go_long'], 0),\n\n        'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n\n            qtpylib.crossed_below(dataframe['tenkan_sen'], dataframe['kijun_sen']) \n            | \n            qtpylib.crossed_below(dataframe['close'], dataframe['kijun_sen']),\n\n        'sell'] = 1\n\n        return dataframe\n\n#\n# Fun with outliers.\n#\n# ============================================================= BACKTESTING REPORT =============================================================\n# |        Pair |   Buys |   Avg Profit % |   Cum Profit % |   Tot Profit USD |   Tot Profit % |    Avg Duration |   Wins |   Draws |   Losses |\n# |-------------+--------+----------------+----------------+------------------+----------------+-----------------+--------+---------+----------|\n# |     BTC/USD |     12 |           0.92 |          11.02 |           55.129 |           2.20 |  1 day, 1:10:00 |      5 |       0 |        7 |\n# |     ETH/USD |     12 |           2.13 |          25.50 |          127.549 |           5.10 |  1 day, 7:35:00 |      5 |       0 |        7 |\n# |    PERP/USD |     11 |          -0.76 |          -8.35 |          -41.752 |          -1.67 |         6:27:00 |      3 |       0 |        8 |\n# |     FTT/USD |     11 |           7.37 |          81.09 |          405.519 |          16.22 | 1 day, 15:11:00 |      5 |       0 |        6 |\n# |     MOB/USD |     13 |           0.59 |           7.67 |           38.371 |           1.53 |        23:42:00 |      1 |       0 |       12 |\n# |     RAY/USD |      5 |          -0.88 |          -4.42 |          -22.129 |          -0.88 |        13:12:00 |      1 |       0 |        4 |\n# |    BULL/USD |      8 |          -0.18 |          -1.40 |           -7.003 |          -0.28 |         8:30:00 |      2 |       0 |        6 |\n# |     SRM/USD |      6 |          -1.54 |          -9.24 |          -46.191 |          -1.85 |         4:30:00 |      0 |       0 |        6 |\n# |    LINA/USD |     11 |          11.56 |         127.19 |          636.069 |          25.44 |         9:22:00 |      3 |       0 |        8 |\n# | SXPBULL/USD |      9 |          -0.08 |          -0.75 |           -3.767 |          -0.15 |         3:00:00 |      1 |       0 |        8 |\n# |    BTMX/USD |     12 |          38.27 |         459.20 |         2296.435 |          91.84 | 1 day, 23:15:00 |      5 |       0 |        7 |\n# |    LINK/USD |     13 |          -0.68 |          -8.81 |          -44.053 |          -1.76 |        13:00:00 |      3 |       0 |       10 |\n# |     LTC/USD |     12 |           0.46 |           5.54 |           27.728 |           1.11 |        11:40:00 |      5 |       0 |        7 |\n# |     SXP/USD |     11 |           1.79 |          19.71 |           98.578 |           3.94 |        10:22:00 |      2 |       0 |        9 |\n# |    AAVE/USD |      7 |          -1.38 |          -9.68 |          -48.425 |          -1.94 |         2:00:00 |      0 |       0 |        7 |\n# |     BNB/USD |     12 |          -0.83 |          -9.95 |          -49.744 |          -1.99 |         4:30:00 |      2 |       0 |       10 |\n# |     UNI/USD |     14 |          -0.62 |          -8.71 |          -43.580 |          -1.74 |         2:34:00 |      2 |       0 |       12 |\n# | ADABULL/USD |      7 |          -1.54 |         -10.78 |          -53.889 |          -2.16 |         2:17:00 |      0 |       0 |        7 |\n# |   SUSHI/USD |      9 |          -0.44 |          -4.00 |          -20.000 |          -0.80 |         5:40:00 |      1 |       0 |        8 |\n# |     BCH/USD |     13 |          -0.10 |          -1.35 |           -6.744 |          -0.27 |         8:55:00 |      4 |       0 |        9 |\n# |       TOTAL |    208 |           3.17 |         659.49 |         3298.103 |         131.90 |        14:42:00 |     50 |       0 |      158 |\n# ====================================================== SELL REASON STATS ======================================================\n# |   Sell Reason |   Sells |   Wins |   Draws |   Losses |   Avg Profit % |   Cum Profit % |   Tot Profit USD |   Tot Profit % |\n# |---------------+---------+--------+---------+----------+----------------+----------------+------------------+----------------|\n# |     stop_loss |     145 |      0 |       0 |      145 |          -1.54 |        -223.21 |         -1116.28 |         -44.64 |\n# |   sell_signal |      63 |     50 |       0 |       13 |          14.01 |         882.7  |          4414.39 |         176.54 |\n# ======================================================= LEFT OPEN TRADES REPORT ========================================================\n# |   Pair |   Buys |   Avg Profit % |   Cum Profit % |   Tot Profit USD |   Tot Profit % |   Avg Duration |   Wins |   Draws |   Losses |\n# |--------+--------+----------------+----------------+------------------+----------------+----------------+--------+---------+----------|\n# |  TOTAL |      0 |           0.00 |           0.00 |            0.000 |           0.00 |           0:00 |      0 |       0 |        0 |\n# =============== SUMMARY METRICS ===============\n# | Metric                | Value               |\n# |-----------------------+---------------------|\n# | Backtesting from      | 2021-02-01 00:00:00 |\n# | Backtesting to        | 2021-03-24 22:00:00 |\n# | Max open trades       | 5                   |\n# |                       |                     |\n# | Total trades          | 208                 |\n# | Total Profit %        | 131.9%              |\n# | Trades per day        | 4.08                |\n# |                       |                     |\n# | Best Pair             | BTMX/USD 459.2%     |\n# | Worst Pair            | ADABULL/USD -10.78% |\n# | Best trade            | BTMX/USD 307.52%    |\n# | Worst trade           | AAVE/USD -1.54%     |\n# | Best day              | 304.44%             |\n# | Worst day             | -16.93%             |\n# | Days win/draw/lose    | 20 / 4 / 28         |\n# | Avg. Duration Winners | 2 days, 2:08:00     |\n# | Avg. Duration Loser   | 3:30:00             |\n# |                       |                     |\n# | Abs Profit Min        | -60.400 USD         |\n# | Abs Profit Max        | 3298.103 USD        |\n# | Max Drawdown          | 39.83%              |\n# | Drawdown Start        | 2021-02-27 01:00:00 |\n# | Drawdown End          | 2021-03-10 02:00:00 |\n# | Market change         | 229.59%             |\n# ===============================================\n"
  },
  {
    "path": "strategies/Obelisk_TradePro_Ichi_v2_1/Obelisk_TradePro_Ichi_v2_1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n# --------------------------------\nimport pandas as pd\nimport numpy as np\nimport technical.indicators as ftt\n\npd.options.mode.chained_assignment = None  # default='warn'\n\n# Obelisk_TradePro_Ichi v2.1 - 2021-04-02\n#\n# by Obelisk\n# https://twitter.com/brookmiles\n#\n# Originally based on \"Crazy Results Best Ichimoku Cloud Trading Strategy Proven 100 Trades\" by Trade Pro\n# https://www.youtube.com/watch?v=8gWIykJgMNY\n#\n# Contributions:\n#\n# JimmyNixx\n#  - SSL Channel confirmation\n#  - ROCR & RMI confirmations\n#\n#\n# Backtested with pairlist generated from:\n# \"pairlists\": [\n#     {\n#         \"method\": \"VolumePairList\",\n#         \"number_assets\": 50,\n#         \"sort_key\": \"quoteVolume\",\n#         \"refresh_period\": 1800\n#     },\n#     {\"method\": \"AgeFilter\", \"min_days_listed\": 10},\n#     {\"method\": \"PrecisionFilter\"},\n#     {\"method\": \"PriceFilter\",\n#         \"low_price_ratio\": 0.001,\n#         \"max_price\": 20,\n#     },\n#     {\"method\": \"SpreadFilter\", \"max_spread_ratio\": 0.002},\n#     {\n#         \"method\": \"RangeStabilityFilter\",\n#         \"lookback_days\": 3,\n#         \"min_rate_of_change\": 0.1,\n#         \"refresh_period\": 1440\n#     },\n# ],\n\n\ndef SSLChannels(dataframe, length = 7):\n    df = dataframe.copy()\n    df['ATR'] = ta.ATR(df, timeperiod=14)\n    df['smaHigh'] = df['high'].rolling(length).mean() + df['ATR']\n    df['smaLow'] = df['low'].rolling(length).mean() - df['ATR']\n    df['hlv'] = np.where(df['close'] > df['smaHigh'], 1, np.where(df['close'] < df['smaLow'], -1, np.NAN))\n    df['hlv'] = df['hlv'].ffill()\n    df['sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n    df['sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n    return df['sslDown'], df['sslUp']\n\nclass Obelisk_TradePro_Ichi_v2_1(IStrategy):\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    # WARNING: ichimoku is a long indicator, if you remove or use a\n    # shorter startup_candle_count your results will be unstable/invalid\n    # for up to a week from the start of your backtest or dry/live run\n    # (180 candles = 7.5 days)\n    startup_candle_count = 180\n\n    # NOTE: this strat only uses candle information, so processing between\n    # new candles is a waste of resources as nothing will change\n    process_only_new_candles = True\n\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    # Stoploss:\n    stoploss = -0.075\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'senkou_a': {\n                'color': 'green',\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud',\n                'fill_color': 'rgba(0,0,0,0.2)',\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {\n                'color': 'red',\n            },\n            'tenkan_sen': { 'color': 'orange' },\n            'kijun_sen': { 'color': 'blue' },\n\n            'chikou_span': { 'color': 'lightgreen' },\n\n            # 'ssl_up': { 'color': 'green' },\n            # 'ssl_down': { 'color': 'red' },\n        },\n        'subplots': {\n            \"Signals\": {\n                'go_long': {'color': 'blue'},\n                'future_green': {'color': 'green'},\n                'chikou_high': {'color': 'lightgreen'},\n                'ssl_high': {'color': 'orange'},\n            },\n        }\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # # Standard Settings\n        # displacement = 26\n        # ichimoku = ftt.ichimoku(dataframe,\n        #     conversion_line_period=9,\n        #     base_line_periods=26,\n        #     laggin_span=52,\n        #     displacement=displacement\n        #     )\n\n        # Crypto Settings\n        displacement = 30\n        ichimoku = ftt.ichimoku(dataframe,\n            conversion_line_period=20,\n            base_line_periods=60,\n            laggin_span=120,\n            displacement=displacement\n            )\n\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n\n        # cross indicators\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n\n        # cloud, green a > b, red a < b\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green'] * 1\n        dataframe['cloud_red'] = ichimoku['cloud_red'] * -1\n\n        # DANGER ZONE START\n\n        # NOTE: Not actually the future, present data that is normally shifted forward for display as the cloud\n        dataframe['future_green'] = (dataframe['leading_senkou_span_a'] > dataframe['leading_senkou_span_b']).astype('int') * 2\n\n        # The chikou_span is shifted into the past, so we need to be careful not to read the\n        # current value.  But if we shift it forward again by displacement it should be safe to use.\n        # We're effectively \"looking back\" at where it normally appears on the chart.\n        dataframe['chikou_high'] = (\n                (dataframe['chikou_span'] > dataframe['senkou_a']) &\n                (dataframe['chikou_span'] > dataframe['senkou_b'])\n            ).shift(displacement).fillna(0).astype('int')\n\n        # DANGER ZONE END\n\n        ssl_down, ssl_up = SSLChannels(dataframe, 10)\n        dataframe['ssl_down'] = ssl_down\n        dataframe['ssl_up'] = ssl_up\n        dataframe['ssl_high'] = (ssl_up > ssl_down).astype('int') * 3\n\n        dataframe['rocr'] = ta.ROCR(dataframe, timeperiod=28)\n        dataframe['rmi-fast'] = ftt.RMI(dataframe, length=9, mom=3)\n\n        dataframe['go_long'] = (\n                (dataframe['tenkan_sen'] > dataframe['kijun_sen']) &\n                (dataframe['close'] > dataframe['senkou_a']) &\n                (dataframe['close'] > dataframe['senkou_b']) &\n                (dataframe['future_green'] > 0) &\n                (dataframe['chikou_high'] > 0) &\n                (dataframe['ssl_high'] > 0) &\n                (dataframe['rocr'] > dataframe['rocr'].shift()) &\n                (dataframe['rmi-fast'] > dataframe['rmi-fast'].shift(2))\n                ).astype('int') * 4\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            qtpylib.crossed_above(dataframe['go_long'], 0)\n        ,\n        'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n                (dataframe['ssl_high'] == 0)\n                &\n                (\n                    (dataframe['tenkan_sen'] < dataframe['kijun_sen'])\n                    |\n                    (dataframe['close'] < dataframe['kijun_sen'])\n                )\n        ,\n        'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/PRICEFOLLOWING/PRICEFOLLOWING.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\n\n# This class is a sample. Feel free to customize it.\nclass PRICEFOLLOWING(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.025,\n        \"30\": 0.03,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.1\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03  # Disabled / not configured\n\n    # Hyperoptable parameters\n    rsi_value = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)\n    rsi_enabled = BooleanParameter(default=False, space='buy', optimize=True, load=True)\n    ema_pct = DecimalParameter(0.0001, 0.1, decimals = 4, default = 0.004, space=\"buy\", optimize=True)\n\n    ema_sell_pct = DecimalParameter(0.0001, 0.1, decimals = 4, default = 0.003, space=\"sell\", optimize=True, load=True)\n    sell_rsi_value = IntParameter(low=25, high=100, default=70, space='sell', optimize=True, load=True)\n    sell_rsi_enabled = BooleanParameter(default=True, space='sell', optimize=True, load=True)\n    \n            \n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 15\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'ema7':{},\n            'ha_open':{},\n            'ha_close':{},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            \n        \"\"\"\n        return [(\"ETH/USDT\", \"15m\"),\n                (\"BTC/USDT\", \"15m\"),\n                (\"RVN/USDT\", \"15m\")\n                        ]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n       \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        #rsi = 0.1 * (dataframe['rsi'] - 50)\n        #dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n       \n        # Stochastic Fast\n        #stoch_fast = ta.STOCHF(dataframe)\n        #dataframe['fastd'] = stoch_fast['fastd']\n        #dataframe['fastk'] = stoch_fast['fastk']\n\n       \n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema7'] = ta.EMA(dataframe, timeperiod=7)\n        dataframe['ema24'] = ta.EMA(dataframe, timeperiod=24)\n        #dataframe['ema60'] = ta.EMA(dataframe, timeperiod=60)\n        #dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        \n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=7)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n        \n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        \n        \n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        #rsi_enabled = BooleanParameter(default=True, space='buy', optimize=True)\n\n        last_ema7 = dataframe['ema7'].tail()\n        last_tema = dataframe['tema'].tail()\n        haclose = dataframe['ha_close'].tail(4)\n        haclose4thlast, haclose3rdlast, haclose2ndlast, hacloselast = haclose\n        haopen = dataframe['ha_open']\n        Conditions = []\n        #GUARDS\n        if self.rsi_enabled.value:\n                Conditions.append(dataframe['rsi'] < self.rsi_value.value)\n                Conditions.append(qtpylib.crossed_below(dataframe['ema7'], dataframe['tema']))\n        else:\n            Conditions.append(qtpylib.crossed_below(dataframe['ema7'], dataframe['tema']))\n            #Conditions.append(haclose3rdlast > haclose2ndlast > hacloselast)\n            Conditions.append(dataframe['tema'] < dataframe['tema'].shift(1))\n        \n        #Conditions.append(qtpylib.crossed_below(dataframe['tema'], dataframe['ema7']))\n        #Conditions.append((abs(last_tema - last_ema7) / last_tema) > self.ema_pct.value)\n       \n        if Conditions:\n             dataframe.loc[\n                 reduce(lambda x, y: x & y, Conditions),\n                 'buy'] = 1\n       \n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n            \n            haopen = dataframe['ha_open']\n            haclose = dataframe['ha_close']\n            last_ema7 = dataframe['ema7'].tail()\n            last_tema = dataframe['tema'].tail()\n            haclose = dataframe['ha_close'].tail(2)\n            haclose2ndlast, hacloselast = haclose\n            conditions = []\n            # GUARDS AND TRENDS\n            if self.sell_rsi_enabled.value:\n                conditions.append(dataframe['rsi'] < self.sell_rsi_value.value)\n                conditions.append(qtpylib.crossed_above(dataframe['ema7'], dataframe['tema']))\n            else:\n                #conditions.append(haclose2ndlast > hacloselast)\n                conditions.append(qtpylib.crossed_above(dataframe['ema7'], dataframe['tema']))\n               #conditions.append(dataframe['best_bid'] < haclose)\n                #conditions.append(((last_tema - last_ema7) / last_ema7) < self.ema_sell_pct.value)\n\n            if conditions:\n                 dataframe.loc[\n                      reduce(lambda x, y: x & y, conditions),\n                      'sell'] = 1\n\n            return dataframe\n"
  },
  {
    "path": "strategies/PRICEFOLLOWING2/PRICEFOLLOWING2.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\n\n# This class is a sample. Feel free to customize it.\nclass PRICEFOLLOWING2(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.025,\n        \"30\": 0.03,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.1\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03  # Disabled / not configured\n\n    # Hyperoptable parameters\n    rsi_value = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)\n    rsi_enabled = BooleanParameter(default=False, space='buy', optimize=True, load=True)\n    ema_pct = DecimalParameter(0.0001, 0.1, decimals = 4, default = 0.004, space=\"buy\", optimize=True)\n\n    ema_sell_pct = DecimalParameter(0.0001, 0.1, decimals = 4, default = 0.003, space=\"sell\", optimize=True, load=True)\n    sell_rsi_value = IntParameter(low=25, high=100, default=70, space='sell', optimize=True, load=True)\n    sell_rsi_enabled = BooleanParameter(default=True, space='sell', optimize=True, load=True)\n    \n            \n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 15\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'ema7':{},\n            'ha_open':{},\n            'ha_close':{},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            \n        \"\"\"\n        return [(\"ETH/USDT\", \"15m\"),\n                (\"BTC/USDT\", \"15m\"),\n                (\"RVN/USDT\", \"15m\")\n                        ]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n       \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        #rsi = 0.1 * (dataframe['rsi'] - 50)\n        #dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n       \n        # Stochastic Fast\n        #stoch_fast = ta.STOCHF(dataframe)\n        #dataframe['fastd'] = stoch_fast['fastd']\n        #dataframe['fastk'] = stoch_fast['fastk']\n\n       \n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema7'] = ta.EMA(dataframe, timeperiod=7)\n        dataframe['ema24'] = ta.EMA(dataframe, timeperiod=24)\n        #dataframe['ema60'] = ta.EMA(dataframe, timeperiod=60)\n        #dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        \n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=7)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n        \n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        \n        \n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        #rsi_enabled = BooleanParameter(default=True, space='buy', optimize=True)\n\n        last_ema7 = dataframe['ema7'].tail()\n        last_tema = dataframe['tema'].tail()\n        haclose = dataframe['ha_close'].tail(4)\n        haclose4thlast, haclose3rdlast, haclose2ndlast, hacloselast = haclose\n        haopen = dataframe['ha_open']\n        Conditions = []\n        #GUARDS\n        if self.rsi_enabled.value:\n                Conditions.append(dataframe['rsi'] < self.rsi_value.value)\n                Conditions.append(qtpylib.crossed_below(dataframe['ema7'], dataframe['tema']))\n        else:\n            Conditions.append(qtpylib.crossed_below(dataframe['ema7'], dataframe['tema']))\n            #Conditions.append(haclose3rdlast > haclose2ndlast > hacloselast)\n            #Conditions.append(dataframe['tema'] < dataframe['tema'].shift(1))\n            #Conditions.append(qtpylib.crossed_below(dataframe['tema'], dataframe['ema7']))\n            Conditions.append(((last_tema - last_ema7) / last_tema) < self.ema_pct.value)\n       \n        if Conditions:\n             dataframe.loc[\n                 reduce(lambda x, y: x & y, Conditions),\n                 'buy'] = 1\n       \n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n            \n            haopen = dataframe['ha_open']\n            haclose = dataframe['ha_close']\n            last_ema7 = dataframe['ema7'].tail()\n            last_tema = dataframe['tema'].tail()\n            haclose = dataframe['ha_close'].tail(2)\n            haclose2ndlast, hacloselast = haclose\n            conditions = []\n            # GUARDS AND TRENDS\n            if self.sell_rsi_enabled.value:\n                conditions.append(dataframe['rsi'] < self.sell_rsi_value.value)\n                conditions.append(qtpylib.crossed_above(dataframe['ema7'], dataframe['tema']))\n            else:\n                #conditions.append(haclose2ndlast > hacloselast)\n                conditions.append(qtpylib.crossed_above(dataframe['ema7'], dataframe['tema']))\n                conditions.append(dataframe['best_bid'] < haclose)\n                conditions.append(((last_tema - last_ema7) / last_ema7) < self.ema_sell_pct.value)\n\n            if conditions:\n                 dataframe.loc[\n                      reduce(lambda x, y: x & y, conditions),\n                      'sell'] = 1\n\n            return dataframe\n"
  },
  {
    "path": "strategies/PRICEFOLLOWINGX/PRICEFOLLOWINGX.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\n\n# This class is a sample. Feel free to customize it.\nclass PRICEFOLLOWINGX(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    @property\n    def protections(self):\n            return [\n                {\n                    \"method\": \"MaxDrawdown\",\n                    \"lookback_period_candles\": 48,\n                    \"trade_limit\": 5,\n                    \"stop_duration_candles\": 5,\n                    \"max_allowed_drawdown\": 0.75\n                },\n                {\n                    \"method\": \"StoplossGuard\",\n                    \"lookback_period_candles\": 24,\n                    \"trade_limit\": 3,\n                    \"stop_duration_candles\": 5,\n                    \"only_per_pair\": True\n                },\n                {\n                    \"method\": \"LowProfitPairs\",\n                    \"lookback_period_candles\": 30,\n                    \"trade_limit\": 2,\n                    \"stop_duration_candles\": 6,\n                    \"required_profit\": 0.005\n                },\n            ]\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"120\":0.015,\n        \"60\": 0.025,\n        \"30\": 0.03,\n        \"0\": 0.015\n       }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.5\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03  # Disabled / not configured\n\n    # Hyperoptable parameters\n    rsi_enabled = BooleanParameter(default=True, space='buy', optimize=True, load=True)\n    #buy_rsi = DecimalParameter(0, 50, decimals = 2, default = 40, space=\"buy\", optimize=True, load=True)\n    ema_pct = DecimalParameter(0.001, 0.100, decimals = 3, default = 0.040, space=\"buy\", optimize=True, load=True)\n    buy_frsi = DecimalParameter(-0.71, 0.50, decimals = 2, default = -0.40, space=\"buy\", optimize=True, load=True)\n    frsi_pct = DecimalParameter(0.01, 0.20, decimals = 2, default = 0.10, space=\"buy\", optimize=True, load=True)\n    #sellspace\n    ema_sell_pct = DecimalParameter(0.001, 0.020, decimals = 3, default = 0.003, space=\"sell\", optimize=True, load=True)\n    sell_rsi_enabled = BooleanParameter(default=True, space='sell', optimize=True, load=True)\n    sell_frsi = DecimalParameter(-0.30, 0.70, decimals=2, default=0.2, space=\"sell\", load=True)\n\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'ema7':{},\n            'ema7low':{},\n            'ema10high':{},\n            'ha_open':{},\n            'ha_close':{},\n        },\n        'subplots': {\n            #\"MACD\": {\n            #    'macd': {'color': 'blue'},\n            #    'macdsignal': {'color': 'orange'},\n            #},\n            \"RSI\": {\n                'frsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            \n        \"\"\"\n        return [(\"ETH/BUSD\", \"1h\"),\n                (\"LINK/BUSD\", \"1h\"),\n                (\"RVN/BUSD\", \"1h\"),\n                (\"MATIC/BUSD\", \"30m\")\n                        ]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n       \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, window=14)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['frsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n       \n        # Stochastic Fast\n        #stoch_fast = ta.STOCHF(dataframe)\n        #dataframe['fastd'] = stoch_fast['fastd']\n        #dataframe['fastk'] = stoch_fast['fastk']\n\n       \n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        \n        # Parabolic SAR\n        #dataframe['sar'] = ta.SAR(dataframe)\n        #Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=19, stds=2.2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=7)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        #hilbert = ta.HT_SINE(dataframe)\n        #dataframe['htsine'] = hilbert['sine']\n        #dataframe['htleadsine'] = hilbert['leadsine']\n        \n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema7'] = ta.SMA(dataframe, timeperiod=14)\n        dataframe['emalow'] = ta.EMA(dataframe, timeperiod=12, price='low')\n        dataframe['emahigh'] = ta.EMA(dataframe, timeperiod=14, price='high')\n        #dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        #rsi_enabled = BooleanParameter(default=True, space='buy', optimize=True)\n\n        last_emalow = dataframe['emalow'].tail()\n        last_tema = dataframe['tema'].tail()\n        haclose = dataframe['ha_close'].tail(3)\n        haclose3rdlast, haclose2ndlast, hacloselast = haclose\n        haopen = dataframe['ha_open']\n        Conditions = []\n        #GUARDS\n        if self.rsi_enabled.value:\n           Conditions.append(qtpylib.crossed_below(dataframe['frsi'], self.buy_frsi.value))\n           Conditions.append(dataframe['tema'] < dataframe['bb_lowerband'])\n           Conditions.append(qtpylib.crossed_below(dataframe['tema'], dataframe['emalow']))\n           #Conditions.append(dataframe['best_bid'] < dataframe['bb_lowerband'])\n            \n        else:\n           Conditions.append(dataframe['tema'] > dataframe['bb_middleband'])\n           Conditions.append(qtpylib.crossed_above(dataframe['tema'], dataframe['ema7']))\n           #Conditions.append(dataframe['best_bid'] < dataframe['bb_lowerband'])\n           #Conditions.append(((abs(last_emalow - last_tema)) / last_tema) > self.ema_sell_pct.value)\n        \n        if Conditions:\n             dataframe.loc[\n                 reduce(lambda x, y: x & y, Conditions),\n                 'buy'] = 1\n\n        return dataframe\n\n        #if dataframe['buy'] != 1:\n\n          #    dataframe.loc[\n          #       (qtpylib.crossed_above(dataframe['tema'], dataframe['ha_high']))&\n          #       (60 < dataframe['rsi'] < 90 )&\n          #       (dataframe['macd'] > dataframe['macdsignal']),\n          #       'buy'] = 1\n\n        \n        #return dataframe\n    \n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n            haopen = dataframe['ha_open']\n            haclose = dataframe['ha_close']\n            last_tema = dataframe['tema'].tail()\n            last_emahigh = dataframe['emahigh'].tail()\n            conditions = []\n            # GUARDS AND TRENDS\n            if self.sell_rsi_enabled.value:\n                 conditions.append(qtpylib.crossed_below(dataframe['frsi'], self.sell_frsi.value))\n                 conditions.append(dataframe['tema'] < dataframe['bb_middleband'])\n                 #conditions.append(haclose2ndlast > hacloselast)\n                 conditions.append(qtpylib.crossed_below(dataframe['tema'], dataframe['ema7']))\n                 #conditions.append(dataframe['best_bid'] < dataframe['ha_close'].shift(1))\n            else:\n                 conditions.append(dataframe['tema'] < dataframe['bb_middleband'])\n                 conditions.append(qtpylib.crossed_below(dataframe['tema'], dataframe['ema7']))\n                 #conditions.append(dataframe['best_bid'] < dataframe['ha_close'].shift(1))\n                 #conditions.append(((abs(last_emahigh - last_tema)) / last_tema) > self.ema_sell_pct.value)\n\n            if conditions:\n                 dataframe.loc[\n                      reduce(lambda x, y: x & y, conditions),\n                      'sell'] = 1\n\n            return dataframe\n"
  },
  {
    "path": "strategies/Persia/Persia.py",
    "content": "# Persia Strategy\n# An strategy for combining formulas\n# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --strategy Persia\n# --- Do not remove these libs ---\nfrom typing import get_type_hints\nfrom numpy.lib.function_base import append\n\nfrom pandas.core.series import Series\n\nfrom freqtrade.strategy.hyper import CategoricalParameter, IntParameter, DecimalParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n# Add your lib to import here\nimport talib.abstract as ta\n# import freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom functools import reduce\nimport pandas as pd\nimport numpy as np\n###################################### SETINGS ######################################\n\n# INDICATORS\nCOSTUMEINDICATORSENABLED = True\nCOSTUMEINDICATORS = ['SMA', 'EMA', 'TEMA', 'DEMA']\n\n# TIMEFRAMES\nTIMEFRAMES = 10  # number of populated indicators\nTFGAP = 3  # gap between each timeframe\nCOSTUMETFENABLED = True\nCOSTUMETF = [3, 7, 9, 21, 27, 63, 81, 189]\n\n# REALS\nREALSRANGE = [-2, 2]\nDECIMALS = 1\n\n# CONDITIONS\nCONDITIONS = 3  # (max 100)\n\n# FORMULAS\nFORMULAS = [\n    # '(A**2+B**2)>R**2',\n    # '(A**2+B**2)<R**2',\n    'A>B',\n    'A<B',\n    'A*R==B',\n    'A==R',\n    'A!=R',\n    'A/B>R',\n    'B/A>R',\n    '0<=A<=1',\n    '0<=B<=1',\n    # 'A+R<B',\n    # 'A-R>B',\n    # '(R/(A+B))<A',\n    # '(R/(A+B))<B',\n    # '(R/(A+B))>A',\n    # '(R/(A+B))>B',\n\n    # 'A*(1+R)**2>5', # FV\n    # 'A/(1+R)**2>5', # PV\n    # '100-(100/(1+A/B))>70', # RSI\n    # '100-(100/(1+A/B))<30', # RSI\n]\n#################################### END SETINGS ####################################\n\n\nta_funcs = ta.__TA_FUNCTION_NAMES__\nta_funcs.pop(107)\nta_funcs = [f for f in ta_funcs if not f.startswith('CDL')]\nindicators = COSTUMEINDICATORS if COSTUMEINDICATORSENABLED else ta_funcs\n\ntf_arr = np.arange(TIMEFRAMES)*TFGAP+TFGAP\n# TODO: Not Costumized timeframes not work!\ntimeframes = COSTUMETF  # if COSTUMETFENABLED else np.delete(tf_arr,np.argwhere(tf_arr < 2))\n\nreals = REALSRANGE\n\nformulas = FORMULAS\n\n\nclass Persia(IStrategy):\n    ###################### RESULT PLACE ######################\n    buy_params = {\n        \"formula0\": \"A!=R\",\n        \"formula1\": \"0<=B<=1\",\n        \"formula2\": \"B/A>R\",\n        \"indicator0\": \"TEMA\",\n        \"indicator1\": \"DEMA\",\n        \"indicator2\": \"DEMA\",\n        \"timeframe0\": 9,\n        \"timeframe1\": 3,\n        \"timeframe2\": 27,\n        \"crossed0\": \"TEMA\",\n        \"crossed1\": \"EMA\",\n        \"crossed2\": \"DEMA\",\n        \"crossed_timeframe0\": 81,\n        \"crossed_timeframe1\": 27,\n        \"crossed_timeframe2\": 63,\n        \"real0\": 0.5,\n        \"real1\": 1.8,\n        \"real2\": -1.4,\n    }\n    sell_params = {\n        \"sell_formula0\": \"A==R\",\n        \"sell_formula1\": \"B/A>R\",\n        \"sell_formula2\": \"A!=R\",\n        \"sell_indicator0\": \"EMA\",\n        \"sell_indicator1\": \"DEMA\",\n        \"sell_indicator2\": \"TEMA\",\n        \"sell_timeframe0\": 21,\n        \"sell_timeframe1\": 21,\n        \"sell_timeframe2\": 3,\n        \"sell_crossed0\": \"SMA\",\n        \"sell_crossed1\": \"TEMA\",\n        \"sell_crossed2\": \"EMA\",\n        \"sell_crossed_timeframe0\": 27,\n        \"sell_crossed_timeframe1\": 27,\n        \"sell_crossed_timeframe2\": 3,\n        \"sell_real0\": 1.5,\n        \"sell_real1\": 1.4,\n        \"sell_real2\": 1.6,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.273,\n        \"26\": 0.084,\n        \"79\": 0.033,\n        \"187\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.19\n\n    timeframe = '5m'\n    # #################### END OF RESULT PLACE ####################\n\n    ###############################################################\n    # BUY HYPEROPTABLE PARAMS:\n    formula0 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=0 < CONDITIONS, space='buy')\n    formula1 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=1 < CONDITIONS, space='buy')\n    formula2 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=2 < CONDITIONS, space='buy')\n    formula3 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=3 < CONDITIONS, space='buy')\n    formula4 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=4 < CONDITIONS, space='buy')\n    formula5 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=5 < CONDITIONS, space='buy')\n    formula6 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=6 < CONDITIONS, space='buy')\n    formula7 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=7 < CONDITIONS, space='buy')\n    formula8 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=8 < CONDITIONS, space='buy')\n    formula9 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=9 < CONDITIONS, space='buy')\n    formula10 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=10 < CONDITIONS, space='buy')\n    formula11 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=11 < CONDITIONS, space='buy')\n    formula12 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=12 < CONDITIONS, space='buy')\n    formula13 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=13 < CONDITIONS, space='buy')\n    formula14 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=14 < CONDITIONS, space='buy')\n    formula15 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=15 < CONDITIONS, space='buy')\n    formula16 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=16 < CONDITIONS, space='buy')\n    formula17 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=17 < CONDITIONS, space='buy')\n    formula18 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=18 < CONDITIONS, space='buy')\n    formula19 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=19 < CONDITIONS, space='buy')\n    formula20 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=20 < CONDITIONS, space='buy')\n    formula21 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=21 < CONDITIONS, space='buy')\n    formula22 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=22 < CONDITIONS, space='buy')\n    formula23 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=23 < CONDITIONS, space='buy')\n    formula24 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=24 < CONDITIONS, space='buy')\n    formula25 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=25 < CONDITIONS, space='buy')\n    formula26 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=26 < CONDITIONS, space='buy')\n    formula27 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=27 < CONDITIONS, space='buy')\n    formula28 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=28 < CONDITIONS, space='buy')\n    formula29 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=29 < CONDITIONS, space='buy')\n    formula30 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=30 < CONDITIONS, space='buy')\n    formula31 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=31 < CONDITIONS, space='buy')\n    formula32 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=32 < CONDITIONS, space='buy')\n    formula33 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=33 < CONDITIONS, space='buy')\n    formula34 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=34 < CONDITIONS, space='buy')\n    formula35 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=35 < CONDITIONS, space='buy')\n    formula36 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=36 < CONDITIONS, space='buy')\n    formula37 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=37 < CONDITIONS, space='buy')\n    formula38 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=38 < CONDITIONS, space='buy')\n    formula39 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=39 < CONDITIONS, space='buy')\n    formula40 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=40 < CONDITIONS, space='buy')\n    formula41 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=41 < CONDITIONS, space='buy')\n    formula42 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=42 < CONDITIONS, space='buy')\n    formula43 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=43 < CONDITIONS, space='buy')\n    formula44 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=44 < CONDITIONS, space='buy')\n    formula45 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=45 < CONDITIONS, space='buy')\n    formula46 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=46 < CONDITIONS, space='buy')\n    formula47 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=47 < CONDITIONS, space='buy')\n    formula48 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=48 < CONDITIONS, space='buy')\n    formula49 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=49 < CONDITIONS, space='buy')\n    formula50 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=50 < CONDITIONS, space='buy')\n    formula51 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=51 < CONDITIONS, space='buy')\n    formula52 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=52 < CONDITIONS, space='buy')\n    formula53 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=53 < CONDITIONS, space='buy')\n    formula54 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=54 < CONDITIONS, space='buy')\n    formula55 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=55 < CONDITIONS, space='buy')\n    formula56 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=56 < CONDITIONS, space='buy')\n    formula57 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=57 < CONDITIONS, space='buy')\n    formula58 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=58 < CONDITIONS, space='buy')\n    formula59 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=59 < CONDITIONS, space='buy')\n    formula60 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=60 < CONDITIONS, space='buy')\n    formula61 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=61 < CONDITIONS, space='buy')\n    formula62 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=62 < CONDITIONS, space='buy')\n    formula63 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=63 < CONDITIONS, space='buy')\n    formula64 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=64 < CONDITIONS, space='buy')\n    formula65 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=65 < CONDITIONS, space='buy')\n    formula66 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=66 < CONDITIONS, space='buy')\n    formula67 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=67 < CONDITIONS, space='buy')\n    formula68 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=68 < CONDITIONS, space='buy')\n    formula69 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=69 < CONDITIONS, space='buy')\n    formula70 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=70 < CONDITIONS, space='buy')\n    formula71 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=71 < CONDITIONS, space='buy')\n    formula72 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=72 < CONDITIONS, space='buy')\n    formula73 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=73 < CONDITIONS, space='buy')\n    formula74 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=74 < CONDITIONS, space='buy')\n    formula75 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=75 < CONDITIONS, space='buy')\n    formula76 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=76 < CONDITIONS, space='buy')\n    formula77 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=77 < CONDITIONS, space='buy')\n    formula78 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=78 < CONDITIONS, space='buy')\n    formula79 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=79 < CONDITIONS, space='buy')\n    formula80 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=80 < CONDITIONS, space='buy')\n    formula81 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=81 < CONDITIONS, space='buy')\n    formula82 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=82 < CONDITIONS, space='buy')\n    formula83 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=83 < CONDITIONS, space='buy')\n    formula84 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=84 < CONDITIONS, space='buy')\n    formula85 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=85 < CONDITIONS, space='buy')\n    formula86 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=86 < CONDITIONS, space='buy')\n    formula87 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=87 < CONDITIONS, space='buy')\n    formula88 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=88 < CONDITIONS, space='buy')\n    formula89 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=89 < CONDITIONS, space='buy')\n    formula90 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=90 < CONDITIONS, space='buy')\n    formula91 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=91 < CONDITIONS, space='buy')\n    formula92 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=92 < CONDITIONS, space='buy')\n    formula93 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=93 < CONDITIONS, space='buy')\n    formula94 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=94 < CONDITIONS, space='buy')\n    formula95 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=95 < CONDITIONS, space='buy')\n    formula96 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=96 < CONDITIONS, space='buy')\n    formula97 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=97 < CONDITIONS, space='buy')\n    formula98 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=98 < CONDITIONS, space='buy')\n    formula99 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=99 < CONDITIONS, space='buy')\n\n    indicator0 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=0 < CONDITIONS, space='buy')\n    indicator1 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=1 < CONDITIONS, space='buy')\n    indicator2 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=2 < CONDITIONS, space='buy')\n    indicator3 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=3 < CONDITIONS, space='buy')\n    indicator4 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=4 < CONDITIONS, space='buy')\n    indicator5 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=5 < CONDITIONS, space='buy')\n    indicator6 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=6 < CONDITIONS, space='buy')\n    indicator7 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=7 < CONDITIONS, space='buy')\n    indicator8 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=8 < CONDITIONS, space='buy')\n    indicator9 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=9 < CONDITIONS, space='buy')\n    indicator10 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=10 < CONDITIONS, space='buy')\n    indicator11 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=11 < CONDITIONS, space='buy')\n    indicator12 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=12 < CONDITIONS, space='buy')\n    indicator13 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=13 < CONDITIONS, space='buy')\n    indicator14 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=14 < CONDITIONS, space='buy')\n    indicator15 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=15 < CONDITIONS, space='buy')\n    indicator16 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=16 < CONDITIONS, space='buy')\n    indicator17 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=17 < CONDITIONS, space='buy')\n    indicator18 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=18 < CONDITIONS, space='buy')\n    indicator19 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=19 < CONDITIONS, space='buy')\n    indicator20 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=20 < CONDITIONS, space='buy')\n    indicator21 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=21 < CONDITIONS, space='buy')\n    indicator22 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=22 < CONDITIONS, space='buy')\n    indicator23 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=23 < CONDITIONS, space='buy')\n    indicator24 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=24 < CONDITIONS, space='buy')\n    indicator25 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=25 < CONDITIONS, space='buy')\n    indicator26 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=26 < CONDITIONS, space='buy')\n    indicator27 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=27 < CONDITIONS, space='buy')\n    indicator28 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=28 < CONDITIONS, space='buy')\n    indicator29 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=29 < CONDITIONS, space='buy')\n    indicator30 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=30 < CONDITIONS, space='buy')\n    indicator31 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=31 < CONDITIONS, space='buy')\n    indicator32 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=32 < CONDITIONS, space='buy')\n    indicator33 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=33 < CONDITIONS, space='buy')\n    indicator34 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=34 < CONDITIONS, space='buy')\n    indicator35 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=35 < CONDITIONS, space='buy')\n    indicator36 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=36 < CONDITIONS, space='buy')\n    indicator37 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=37 < CONDITIONS, space='buy')\n    indicator38 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=38 < CONDITIONS, space='buy')\n    indicator39 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=39 < CONDITIONS, space='buy')\n    indicator40 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=40 < CONDITIONS, space='buy')\n    indicator41 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=41 < CONDITIONS, space='buy')\n    indicator42 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=42 < CONDITIONS, space='buy')\n    indicator43 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=43 < CONDITIONS, space='buy')\n    indicator44 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=44 < CONDITIONS, space='buy')\n    indicator45 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=45 < CONDITIONS, space='buy')\n    indicator46 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=46 < CONDITIONS, space='buy')\n    indicator47 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=47 < CONDITIONS, space='buy')\n    indicator48 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=48 < CONDITIONS, space='buy')\n    indicator49 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=49 < CONDITIONS, space='buy')\n    indicator50 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=50 < CONDITIONS, space='buy')\n    indicator51 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=51 < CONDITIONS, space='buy')\n    indicator52 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=52 < CONDITIONS, space='buy')\n    indicator53 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=53 < CONDITIONS, space='buy')\n    indicator54 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=54 < CONDITIONS, space='buy')\n    indicator55 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=55 < CONDITIONS, space='buy')\n    indicator56 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=56 < CONDITIONS, space='buy')\n    indicator57 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=57 < CONDITIONS, space='buy')\n    indicator58 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=58 < CONDITIONS, space='buy')\n    indicator59 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=59 < CONDITIONS, space='buy')\n    indicator60 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=60 < CONDITIONS, space='buy')\n    indicator61 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=61 < CONDITIONS, space='buy')\n    indicator62 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=62 < CONDITIONS, space='buy')\n    indicator63 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=63 < CONDITIONS, space='buy')\n    indicator64 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=64 < CONDITIONS, space='buy')\n    indicator65 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=65 < CONDITIONS, space='buy')\n    indicator66 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=66 < CONDITIONS, space='buy')\n    indicator67 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=67 < CONDITIONS, space='buy')\n    indicator68 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=68 < CONDITIONS, space='buy')\n    indicator69 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=69 < CONDITIONS, space='buy')\n    indicator70 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=70 < CONDITIONS, space='buy')\n    indicator71 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=71 < CONDITIONS, space='buy')\n    indicator72 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=72 < CONDITIONS, space='buy')\n    indicator73 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=73 < CONDITIONS, space='buy')\n    indicator74 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=74 < CONDITIONS, space='buy')\n    indicator75 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=75 < CONDITIONS, space='buy')\n    indicator76 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=76 < CONDITIONS, space='buy')\n    indicator77 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=77 < CONDITIONS, space='buy')\n    indicator78 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=78 < CONDITIONS, space='buy')\n    indicator79 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=79 < CONDITIONS, space='buy')\n    indicator80 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=80 < CONDITIONS, space='buy')\n    indicator81 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=81 < CONDITIONS, space='buy')\n    indicator82 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=82 < CONDITIONS, space='buy')\n    indicator83 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=83 < CONDITIONS, space='buy')\n    indicator84 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=84 < CONDITIONS, space='buy')\n    indicator85 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=85 < CONDITIONS, space='buy')\n    indicator86 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=86 < CONDITIONS, space='buy')\n    indicator87 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=87 < CONDITIONS, space='buy')\n    indicator88 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=88 < CONDITIONS, space='buy')\n    indicator89 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=89 < CONDITIONS, space='buy')\n    indicator90 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=90 < CONDITIONS, space='buy')\n    indicator91 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=91 < CONDITIONS, space='buy')\n    indicator92 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=92 < CONDITIONS, space='buy')\n    indicator93 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=93 < CONDITIONS, space='buy')\n    indicator94 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=94 < CONDITIONS, space='buy')\n    indicator95 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=95 < CONDITIONS, space='buy')\n    indicator96 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=96 < CONDITIONS, space='buy')\n    indicator97 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=97 < CONDITIONS, space='buy')\n    indicator98 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=98 < CONDITIONS, space='buy')\n    indicator99 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=99 < CONDITIONS, space='buy')\n\n    crossed0 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=0 < CONDITIONS, space='buy')\n    crossed1 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=1 < CONDITIONS, space='buy')\n    crossed2 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=2 < CONDITIONS, space='buy')\n    crossed3 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=3 < CONDITIONS, space='buy')\n    crossed4 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=4 < CONDITIONS, space='buy')\n    crossed5 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=5 < CONDITIONS, space='buy')\n    crossed6 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=6 < CONDITIONS, space='buy')\n    crossed7 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=7 < CONDITIONS, space='buy')\n    crossed8 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=8 < CONDITIONS, space='buy')\n    crossed9 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=9 < CONDITIONS, space='buy')\n    crossed10 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=10 < CONDITIONS, space='buy')\n    crossed11 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=11 < CONDITIONS, space='buy')\n    crossed12 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=12 < CONDITIONS, space='buy')\n    crossed13 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=13 < CONDITIONS, space='buy')\n    crossed14 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=14 < CONDITIONS, space='buy')\n    crossed15 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=15 < CONDITIONS, space='buy')\n    crossed16 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=16 < CONDITIONS, space='buy')\n    crossed17 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=17 < CONDITIONS, space='buy')\n    crossed18 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=18 < CONDITIONS, space='buy')\n    crossed19 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=19 < CONDITIONS, space='buy')\n    crossed20 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=20 < CONDITIONS, space='buy')\n    crossed21 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=21 < CONDITIONS, space='buy')\n    crossed22 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=22 < CONDITIONS, space='buy')\n    crossed23 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=23 < CONDITIONS, space='buy')\n    crossed24 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=24 < CONDITIONS, space='buy')\n    crossed25 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=25 < CONDITIONS, space='buy')\n    crossed26 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=26 < CONDITIONS, space='buy')\n    crossed27 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=27 < CONDITIONS, space='buy')\n    crossed28 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=28 < CONDITIONS, space='buy')\n    crossed29 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=29 < CONDITIONS, space='buy')\n    crossed30 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=30 < CONDITIONS, space='buy')\n    crossed31 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=31 < CONDITIONS, space='buy')\n    crossed32 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=32 < CONDITIONS, space='buy')\n    crossed33 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=33 < CONDITIONS, space='buy')\n    crossed34 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=34 < CONDITIONS, space='buy')\n    crossed35 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=35 < CONDITIONS, space='buy')\n    crossed36 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=36 < CONDITIONS, space='buy')\n    crossed37 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=37 < CONDITIONS, space='buy')\n    crossed38 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=38 < CONDITIONS, space='buy')\n    crossed39 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=39 < CONDITIONS, space='buy')\n    crossed40 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=40 < CONDITIONS, space='buy')\n    crossed41 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=41 < CONDITIONS, space='buy')\n    crossed42 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=42 < CONDITIONS, space='buy')\n    crossed43 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=43 < CONDITIONS, space='buy')\n    crossed44 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=44 < CONDITIONS, space='buy')\n    crossed45 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=45 < CONDITIONS, space='buy')\n    crossed46 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=46 < CONDITIONS, space='buy')\n    crossed47 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=47 < CONDITIONS, space='buy')\n    crossed48 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=48 < CONDITIONS, space='buy')\n    crossed49 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=49 < CONDITIONS, space='buy')\n    crossed50 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=50 < CONDITIONS, space='buy')\n    crossed51 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=51 < CONDITIONS, space='buy')\n    crossed52 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=52 < CONDITIONS, space='buy')\n    crossed53 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=53 < CONDITIONS, space='buy')\n    crossed54 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=54 < CONDITIONS, space='buy')\n    crossed55 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=55 < CONDITIONS, space='buy')\n    crossed56 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=56 < CONDITIONS, space='buy')\n    crossed57 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=57 < CONDITIONS, space='buy')\n    crossed58 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=58 < CONDITIONS, space='buy')\n    crossed59 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=59 < CONDITIONS, space='buy')\n    crossed60 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=60 < CONDITIONS, space='buy')\n    crossed61 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=61 < CONDITIONS, space='buy')\n    crossed62 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=62 < CONDITIONS, space='buy')\n    crossed63 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=63 < CONDITIONS, space='buy')\n    crossed64 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=64 < CONDITIONS, space='buy')\n    crossed65 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=65 < CONDITIONS, space='buy')\n    crossed66 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=66 < CONDITIONS, space='buy')\n    crossed67 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=67 < CONDITIONS, space='buy')\n    crossed68 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=68 < CONDITIONS, space='buy')\n    crossed69 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=69 < CONDITIONS, space='buy')\n    crossed70 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=70 < CONDITIONS, space='buy')\n    crossed71 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=71 < CONDITIONS, space='buy')\n    crossed72 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=72 < CONDITIONS, space='buy')\n    crossed73 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=73 < CONDITIONS, space='buy')\n    crossed74 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=74 < CONDITIONS, space='buy')\n    crossed75 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=75 < CONDITIONS, space='buy')\n    crossed76 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=76 < CONDITIONS, space='buy')\n    crossed77 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=77 < CONDITIONS, space='buy')\n    crossed78 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=78 < CONDITIONS, space='buy')\n    crossed79 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=79 < CONDITIONS, space='buy')\n    crossed80 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=80 < CONDITIONS, space='buy')\n    crossed81 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=81 < CONDITIONS, space='buy')\n    crossed82 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=82 < CONDITIONS, space='buy')\n    crossed83 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=83 < CONDITIONS, space='buy')\n    crossed84 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=84 < CONDITIONS, space='buy')\n    crossed85 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=85 < CONDITIONS, space='buy')\n    crossed86 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=86 < CONDITIONS, space='buy')\n    crossed87 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=87 < CONDITIONS, space='buy')\n    crossed88 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=88 < CONDITIONS, space='buy')\n    crossed89 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=89 < CONDITIONS, space='buy')\n    crossed90 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=90 < CONDITIONS, space='buy')\n    crossed91 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=91 < CONDITIONS, space='buy')\n    crossed92 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=92 < CONDITIONS, space='buy')\n    crossed93 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=93 < CONDITIONS, space='buy')\n    crossed94 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=94 < CONDITIONS, space='buy')\n    crossed95 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=95 < CONDITIONS, space='buy')\n    crossed96 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=96 < CONDITIONS, space='buy')\n    crossed97 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=97 < CONDITIONS, space='buy')\n    crossed98 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=98 < CONDITIONS, space='buy')\n    crossed99 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=99 < CONDITIONS, space='buy')\n\n    timeframe0 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=0 < CONDITIONS, space='buy')\n    timeframe1 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=1 < CONDITIONS, space='buy')\n    timeframe2 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=2 < CONDITIONS, space='buy')\n    timeframe3 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=3 < CONDITIONS, space='buy')\n    timeframe4 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=4 < CONDITIONS, space='buy')\n    timeframe5 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=5 < CONDITIONS, space='buy')\n    timeframe6 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=6 < CONDITIONS, space='buy')\n    timeframe7 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=7 < CONDITIONS, space='buy')\n    timeframe8 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=8 < CONDITIONS, space='buy')\n    timeframe9 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=9 < CONDITIONS, space='buy')\n    timeframe10 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=10 < CONDITIONS, space='buy')\n    timeframe11 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=11 < CONDITIONS, space='buy')\n    timeframe12 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=12 < CONDITIONS, space='buy')\n    timeframe13 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=13 < CONDITIONS, space='buy')\n    timeframe14 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=14 < CONDITIONS, space='buy')\n    timeframe15 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=15 < CONDITIONS, space='buy')\n    timeframe16 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=16 < CONDITIONS, space='buy')\n    timeframe17 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=17 < CONDITIONS, space='buy')\n    timeframe18 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=18 < CONDITIONS, space='buy')\n    timeframe19 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=19 < CONDITIONS, space='buy')\n    timeframe20 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=20 < CONDITIONS, space='buy')\n    timeframe21 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=21 < CONDITIONS, space='buy')\n    timeframe22 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=22 < CONDITIONS, space='buy')\n    timeframe23 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=23 < CONDITIONS, space='buy')\n    timeframe24 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=24 < CONDITIONS, space='buy')\n    timeframe25 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=25 < CONDITIONS, space='buy')\n    timeframe26 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=26 < CONDITIONS, space='buy')\n    timeframe27 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=27 < CONDITIONS, space='buy')\n    timeframe28 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=28 < CONDITIONS, space='buy')\n    timeframe29 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=29 < CONDITIONS, space='buy')\n    timeframe30 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=30 < CONDITIONS, space='buy')\n    timeframe31 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=31 < CONDITIONS, space='buy')\n    timeframe32 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=32 < CONDITIONS, space='buy')\n    timeframe33 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=33 < CONDITIONS, space='buy')\n    timeframe34 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=34 < CONDITIONS, space='buy')\n    timeframe35 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=35 < CONDITIONS, space='buy')\n    timeframe36 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=36 < CONDITIONS, space='buy')\n    timeframe37 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=37 < CONDITIONS, space='buy')\n    timeframe38 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=38 < CONDITIONS, space='buy')\n    timeframe39 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=39 < CONDITIONS, space='buy')\n    timeframe40 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=40 < CONDITIONS, space='buy')\n    timeframe41 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=41 < CONDITIONS, space='buy')\n    timeframe42 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=42 < CONDITIONS, space='buy')\n    timeframe43 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=43 < CONDITIONS, space='buy')\n    timeframe44 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=44 < CONDITIONS, space='buy')\n    timeframe45 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=45 < CONDITIONS, space='buy')\n    timeframe46 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=46 < CONDITIONS, space='buy')\n    timeframe47 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=47 < CONDITIONS, space='buy')\n    timeframe48 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=48 < CONDITIONS, space='buy')\n    timeframe49 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=49 < CONDITIONS, space='buy')\n    timeframe50 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=50 < CONDITIONS, space='buy')\n    timeframe51 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=51 < CONDITIONS, space='buy')\n    timeframe52 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=52 < CONDITIONS, space='buy')\n    timeframe53 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=53 < CONDITIONS, space='buy')\n    timeframe54 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=54 < CONDITIONS, space='buy')\n    timeframe55 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=55 < CONDITIONS, space='buy')\n    timeframe56 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=56 < CONDITIONS, space='buy')\n    timeframe57 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=57 < CONDITIONS, space='buy')\n    timeframe58 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=58 < CONDITIONS, space='buy')\n    timeframe59 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=59 < CONDITIONS, space='buy')\n    timeframe60 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=60 < CONDITIONS, space='buy')\n    timeframe61 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=61 < CONDITIONS, space='buy')\n    timeframe62 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=62 < CONDITIONS, space='buy')\n    timeframe63 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=63 < CONDITIONS, space='buy')\n    timeframe64 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=64 < CONDITIONS, space='buy')\n    timeframe65 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=65 < CONDITIONS, space='buy')\n    timeframe66 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=66 < CONDITIONS, space='buy')\n    timeframe67 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=67 < CONDITIONS, space='buy')\n    timeframe68 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=68 < CONDITIONS, space='buy')\n    timeframe69 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=69 < CONDITIONS, space='buy')\n    timeframe70 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=70 < CONDITIONS, space='buy')\n    timeframe71 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=71 < CONDITIONS, space='buy')\n    timeframe72 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=72 < CONDITIONS, space='buy')\n    timeframe73 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=73 < CONDITIONS, space='buy')\n    timeframe74 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=74 < CONDITIONS, space='buy')\n    timeframe75 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=75 < CONDITIONS, space='buy')\n    timeframe76 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=76 < CONDITIONS, space='buy')\n    timeframe77 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=77 < CONDITIONS, space='buy')\n    timeframe78 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=78 < CONDITIONS, space='buy')\n    timeframe79 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=79 < CONDITIONS, space='buy')\n    timeframe80 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=80 < CONDITIONS, space='buy')\n    timeframe81 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=81 < CONDITIONS, space='buy')\n    timeframe82 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=82 < CONDITIONS, space='buy')\n    timeframe83 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=83 < CONDITIONS, space='buy')\n    timeframe84 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=84 < CONDITIONS, space='buy')\n    timeframe85 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=85 < CONDITIONS, space='buy')\n    timeframe86 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=86 < CONDITIONS, space='buy')\n    timeframe87 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=87 < CONDITIONS, space='buy')\n    timeframe88 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=88 < CONDITIONS, space='buy')\n    timeframe89 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=89 < CONDITIONS, space='buy')\n    timeframe90 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=90 < CONDITIONS, space='buy')\n    timeframe91 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=91 < CONDITIONS, space='buy')\n    timeframe92 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=92 < CONDITIONS, space='buy')\n    timeframe93 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=93 < CONDITIONS, space='buy')\n    timeframe94 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=94 < CONDITIONS, space='buy')\n    timeframe95 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=95 < CONDITIONS, space='buy')\n    timeframe96 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=96 < CONDITIONS, space='buy')\n    timeframe97 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=97 < CONDITIONS, space='buy')\n    timeframe98 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=98 < CONDITIONS, space='buy')\n    timeframe99 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=99 < CONDITIONS, space='buy')\n\n    crossed_timeframe0 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=0 < CONDITIONS, space='buy')\n    crossed_timeframe1 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=1 < CONDITIONS, space='buy')\n    crossed_timeframe2 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=2 < CONDITIONS, space='buy')\n    crossed_timeframe3 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=3 < CONDITIONS, space='buy')\n    crossed_timeframe4 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=4 < CONDITIONS, space='buy')\n    crossed_timeframe5 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=5 < CONDITIONS, space='buy')\n    crossed_timeframe6 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=6 < CONDITIONS, space='buy')\n    crossed_timeframe7 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=7 < CONDITIONS, space='buy')\n    crossed_timeframe8 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=8 < CONDITIONS, space='buy')\n    crossed_timeframe9 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=9 < CONDITIONS, space='buy')\n    crossed_timeframe10 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=10 < CONDITIONS, space='buy')\n    crossed_timeframe11 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=11 < CONDITIONS, space='buy')\n    crossed_timeframe12 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=12 < CONDITIONS, space='buy')\n    crossed_timeframe13 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=13 < CONDITIONS, space='buy')\n    crossed_timeframe14 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=14 < CONDITIONS, space='buy')\n    crossed_timeframe15 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=15 < CONDITIONS, space='buy')\n    crossed_timeframe16 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=16 < CONDITIONS, space='buy')\n    crossed_timeframe17 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=17 < CONDITIONS, space='buy')\n    crossed_timeframe18 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=18 < CONDITIONS, space='buy')\n    crossed_timeframe19 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=19 < CONDITIONS, space='buy')\n    crossed_timeframe20 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=20 < CONDITIONS, space='buy')\n    crossed_timeframe21 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=21 < CONDITIONS, space='buy')\n    crossed_timeframe22 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=22 < CONDITIONS, space='buy')\n    crossed_timeframe23 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=23 < CONDITIONS, space='buy')\n    crossed_timeframe24 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=24 < CONDITIONS, space='buy')\n    crossed_timeframe25 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=25 < CONDITIONS, space='buy')\n    crossed_timeframe26 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=26 < CONDITIONS, space='buy')\n    crossed_timeframe27 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=27 < CONDITIONS, space='buy')\n    crossed_timeframe28 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=28 < CONDITIONS, space='buy')\n    crossed_timeframe29 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=29 < CONDITIONS, space='buy')\n    crossed_timeframe30 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=30 < CONDITIONS, space='buy')\n    crossed_timeframe31 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=31 < CONDITIONS, space='buy')\n    crossed_timeframe32 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=32 < CONDITIONS, space='buy')\n    crossed_timeframe33 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=33 < CONDITIONS, space='buy')\n    crossed_timeframe34 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=34 < CONDITIONS, space='buy')\n    crossed_timeframe35 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=35 < CONDITIONS, space='buy')\n    crossed_timeframe36 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=36 < CONDITIONS, space='buy')\n    crossed_timeframe37 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=37 < CONDITIONS, space='buy')\n    crossed_timeframe38 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=38 < CONDITIONS, space='buy')\n    crossed_timeframe39 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=39 < CONDITIONS, space='buy')\n    crossed_timeframe40 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=40 < CONDITIONS, space='buy')\n    crossed_timeframe41 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=41 < CONDITIONS, space='buy')\n    crossed_timeframe42 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=42 < CONDITIONS, space='buy')\n    crossed_timeframe43 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=43 < CONDITIONS, space='buy')\n    crossed_timeframe44 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=44 < CONDITIONS, space='buy')\n    crossed_timeframe45 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=45 < CONDITIONS, space='buy')\n    crossed_timeframe46 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=46 < CONDITIONS, space='buy')\n    crossed_timeframe47 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=47 < CONDITIONS, space='buy')\n    crossed_timeframe48 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=48 < CONDITIONS, space='buy')\n    crossed_timeframe49 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=49 < CONDITIONS, space='buy')\n    crossed_timeframe50 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=50 < CONDITIONS, space='buy')\n    crossed_timeframe51 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=51 < CONDITIONS, space='buy')\n    crossed_timeframe52 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=52 < CONDITIONS, space='buy')\n    crossed_timeframe53 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=53 < CONDITIONS, space='buy')\n    crossed_timeframe54 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=54 < CONDITIONS, space='buy')\n    crossed_timeframe55 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=55 < CONDITIONS, space='buy')\n    crossed_timeframe56 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=56 < CONDITIONS, space='buy')\n    crossed_timeframe57 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=57 < CONDITIONS, space='buy')\n    crossed_timeframe58 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=58 < CONDITIONS, space='buy')\n    crossed_timeframe59 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=59 < CONDITIONS, space='buy')\n    crossed_timeframe60 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=60 < CONDITIONS, space='buy')\n    crossed_timeframe61 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=61 < CONDITIONS, space='buy')\n    crossed_timeframe62 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=62 < CONDITIONS, space='buy')\n    crossed_timeframe63 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=63 < CONDITIONS, space='buy')\n    crossed_timeframe64 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=64 < CONDITIONS, space='buy')\n    crossed_timeframe65 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=65 < CONDITIONS, space='buy')\n    crossed_timeframe66 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=66 < CONDITIONS, space='buy')\n    crossed_timeframe67 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=67 < CONDITIONS, space='buy')\n    crossed_timeframe68 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=68 < CONDITIONS, space='buy')\n    crossed_timeframe69 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=69 < CONDITIONS, space='buy')\n    crossed_timeframe70 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=70 < CONDITIONS, space='buy')\n    crossed_timeframe71 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=71 < CONDITIONS, space='buy')\n    crossed_timeframe72 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=72 < CONDITIONS, space='buy')\n    crossed_timeframe73 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=73 < CONDITIONS, space='buy')\n    crossed_timeframe74 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=74 < CONDITIONS, space='buy')\n    crossed_timeframe75 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=75 < CONDITIONS, space='buy')\n    crossed_timeframe76 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=76 < CONDITIONS, space='buy')\n    crossed_timeframe77 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=77 < CONDITIONS, space='buy')\n    crossed_timeframe78 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=78 < CONDITIONS, space='buy')\n    crossed_timeframe79 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=79 < CONDITIONS, space='buy')\n    crossed_timeframe80 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=80 < CONDITIONS, space='buy')\n    crossed_timeframe81 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=81 < CONDITIONS, space='buy')\n    crossed_timeframe82 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=82 < CONDITIONS, space='buy')\n    crossed_timeframe83 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=83 < CONDITIONS, space='buy')\n    crossed_timeframe84 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=84 < CONDITIONS, space='buy')\n    crossed_timeframe85 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=85 < CONDITIONS, space='buy')\n    crossed_timeframe86 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=86 < CONDITIONS, space='buy')\n    crossed_timeframe87 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=87 < CONDITIONS, space='buy')\n    crossed_timeframe88 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=88 < CONDITIONS, space='buy')\n    crossed_timeframe89 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=89 < CONDITIONS, space='buy')\n    crossed_timeframe90 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=90 < CONDITIONS, space='buy')\n    crossed_timeframe91 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=91 < CONDITIONS, space='buy')\n    crossed_timeframe92 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=92 < CONDITIONS, space='buy')\n    crossed_timeframe93 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=93 < CONDITIONS, space='buy')\n    crossed_timeframe94 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=94 < CONDITIONS, space='buy')\n    crossed_timeframe95 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=95 < CONDITIONS, space='buy')\n    crossed_timeframe96 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=96 < CONDITIONS, space='buy')\n    crossed_timeframe97 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=97 < CONDITIONS, space='buy')\n    crossed_timeframe98 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=98 < CONDITIONS, space='buy')\n    crossed_timeframe99 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='buy')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=99 < CONDITIONS, space='buy')\n\n    real0 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=0 < CONDITIONS, space='buy')\n    real1 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=1 < CONDITIONS, space='buy')\n    real2 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=2 < CONDITIONS, space='buy')\n    real3 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=3 < CONDITIONS, space='buy')\n    real4 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=4 < CONDITIONS, space='buy')\n    real5 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=5 < CONDITIONS, space='buy')\n    real6 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=6 < CONDITIONS, space='buy')\n    real7 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=7 < CONDITIONS, space='buy')\n    real8 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=8 < CONDITIONS, space='buy')\n    real9 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                             decimals=DECIMALS, optimize=9 < CONDITIONS, space='buy')\n    real10 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=10 < CONDITIONS, space='buy')\n    real11 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=11 < CONDITIONS, space='buy')\n    real12 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=12 < CONDITIONS, space='buy')\n    real13 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=13 < CONDITIONS, space='buy')\n    real14 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=14 < CONDITIONS, space='buy')\n    real15 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=15 < CONDITIONS, space='buy')\n    real16 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=16 < CONDITIONS, space='buy')\n    real17 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=17 < CONDITIONS, space='buy')\n    real18 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=18 < CONDITIONS, space='buy')\n    real19 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=19 < CONDITIONS, space='buy')\n    real20 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=20 < CONDITIONS, space='buy')\n    real21 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=21 < CONDITIONS, space='buy')\n    real22 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=22 < CONDITIONS, space='buy')\n    real23 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=23 < CONDITIONS, space='buy')\n    real24 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=24 < CONDITIONS, space='buy')\n    real25 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=25 < CONDITIONS, space='buy')\n    real26 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=26 < CONDITIONS, space='buy')\n    real27 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=27 < CONDITIONS, space='buy')\n    real28 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=28 < CONDITIONS, space='buy')\n    real29 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=29 < CONDITIONS, space='buy')\n    real30 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=30 < CONDITIONS, space='buy')\n    real31 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=31 < CONDITIONS, space='buy')\n    real32 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=32 < CONDITIONS, space='buy')\n    real33 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=33 < CONDITIONS, space='buy')\n    real34 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=34 < CONDITIONS, space='buy')\n    real35 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=35 < CONDITIONS, space='buy')\n    real36 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=36 < CONDITIONS, space='buy')\n    real37 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=37 < CONDITIONS, space='buy')\n    real38 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=38 < CONDITIONS, space='buy')\n    real39 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=39 < CONDITIONS, space='buy')\n    real40 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=40 < CONDITIONS, space='buy')\n    real41 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=41 < CONDITIONS, space='buy')\n    real42 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=42 < CONDITIONS, space='buy')\n    real43 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=43 < CONDITIONS, space='buy')\n    real44 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=44 < CONDITIONS, space='buy')\n    real45 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=45 < CONDITIONS, space='buy')\n    real46 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=46 < CONDITIONS, space='buy')\n    real47 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=47 < CONDITIONS, space='buy')\n    real48 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=48 < CONDITIONS, space='buy')\n    real49 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=49 < CONDITIONS, space='buy')\n    real50 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=50 < CONDITIONS, space='buy')\n    real51 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=51 < CONDITIONS, space='buy')\n    real52 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=52 < CONDITIONS, space='buy')\n    real53 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=53 < CONDITIONS, space='buy')\n    real54 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=54 < CONDITIONS, space='buy')\n    real55 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=55 < CONDITIONS, space='buy')\n    real56 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=56 < CONDITIONS, space='buy')\n    real57 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=57 < CONDITIONS, space='buy')\n    real58 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=58 < CONDITIONS, space='buy')\n    real59 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=59 < CONDITIONS, space='buy')\n    real60 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=60 < CONDITIONS, space='buy')\n    real61 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=61 < CONDITIONS, space='buy')\n    real62 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=62 < CONDITIONS, space='buy')\n    real63 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=63 < CONDITIONS, space='buy')\n    real64 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=64 < CONDITIONS, space='buy')\n    real65 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=65 < CONDITIONS, space='buy')\n    real66 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=66 < CONDITIONS, space='buy')\n    real67 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=67 < CONDITIONS, space='buy')\n    real68 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=68 < CONDITIONS, space='buy')\n    real69 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=69 < CONDITIONS, space='buy')\n    real70 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=70 < CONDITIONS, space='buy')\n    real71 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=71 < CONDITIONS, space='buy')\n    real72 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=72 < CONDITIONS, space='buy')\n    real73 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=73 < CONDITIONS, space='buy')\n    real74 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=74 < CONDITIONS, space='buy')\n    real75 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=75 < CONDITIONS, space='buy')\n    real76 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=76 < CONDITIONS, space='buy')\n    real77 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=77 < CONDITIONS, space='buy')\n    real78 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=78 < CONDITIONS, space='buy')\n    real79 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=79 < CONDITIONS, space='buy')\n    real80 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=80 < CONDITIONS, space='buy')\n    real81 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=81 < CONDITIONS, space='buy')\n    real82 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=82 < CONDITIONS, space='buy')\n    real83 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=83 < CONDITIONS, space='buy')\n    real84 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=84 < CONDITIONS, space='buy')\n    real85 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=85 < CONDITIONS, space='buy')\n    real86 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=86 < CONDITIONS, space='buy')\n    real87 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=87 < CONDITIONS, space='buy')\n    real88 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=88 < CONDITIONS, space='buy')\n    real89 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=89 < CONDITIONS, space='buy')\n    real90 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=90 < CONDITIONS, space='buy')\n    real91 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=91 < CONDITIONS, space='buy')\n    real92 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=92 < CONDITIONS, space='buy')\n    real93 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=93 < CONDITIONS, space='buy')\n    real94 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=94 < CONDITIONS, space='buy')\n    real95 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=95 < CONDITIONS, space='buy')\n    real96 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=96 < CONDITIONS, space='buy')\n    real97 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=97 < CONDITIONS, space='buy')\n    real98 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=98 < CONDITIONS, space='buy')\n    real99 = DecimalParameter(reals[0], reals[-1], default=reals[0],\n                              decimals=DECIMALS, optimize=99 < CONDITIONS, space='buy')\n\n    # SELL HYPEROPTABLE PARAMS:\n    sell_formula0 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=0 < CONDITIONS, space='sell')\n    sell_formula1 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=1 < CONDITIONS, space='sell')\n    sell_formula2 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=2 < CONDITIONS, space='sell')\n    sell_formula3 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=3 < CONDITIONS, space='sell')\n    sell_formula4 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=4 < CONDITIONS, space='sell')\n    sell_formula5 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=5 < CONDITIONS, space='sell')\n    sell_formula6 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=6 < CONDITIONS, space='sell')\n    sell_formula7 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=7 < CONDITIONS, space='sell')\n    sell_formula8 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=8 < CONDITIONS, space='sell')\n    sell_formula9 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=9 < CONDITIONS, space='sell')\n    sell_formula10 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=10 < CONDITIONS, space='sell')\n    sell_formula11 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=11 < CONDITIONS, space='sell')\n    sell_formula12 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=12 < CONDITIONS, space='sell')\n    sell_formula13 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=13 < CONDITIONS, space='sell')\n    sell_formula14 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=14 < CONDITIONS, space='sell')\n    sell_formula15 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=15 < CONDITIONS, space='sell')\n    sell_formula16 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=16 < CONDITIONS, space='sell')\n    sell_formula17 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=17 < CONDITIONS, space='sell')\n    sell_formula18 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=18 < CONDITIONS, space='sell')\n    sell_formula19 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=19 < CONDITIONS, space='sell')\n    sell_formula20 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=20 < CONDITIONS, space='sell')\n    sell_formula21 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=21 < CONDITIONS, space='sell')\n    sell_formula22 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=22 < CONDITIONS, space='sell')\n    sell_formula23 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=23 < CONDITIONS, space='sell')\n    sell_formula24 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=24 < CONDITIONS, space='sell')\n    sell_formula25 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=25 < CONDITIONS, space='sell')\n    sell_formula26 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=26 < CONDITIONS, space='sell')\n    sell_formula27 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=27 < CONDITIONS, space='sell')\n    sell_formula28 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=28 < CONDITIONS, space='sell')\n    sell_formula29 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=29 < CONDITIONS, space='sell')\n    sell_formula30 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=30 < CONDITIONS, space='sell')\n    sell_formula31 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=31 < CONDITIONS, space='sell')\n    sell_formula32 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=32 < CONDITIONS, space='sell')\n    sell_formula33 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=33 < CONDITIONS, space='sell')\n    sell_formula34 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=34 < CONDITIONS, space='sell')\n    sell_formula35 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=35 < CONDITIONS, space='sell')\n    sell_formula36 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=36 < CONDITIONS, space='sell')\n    sell_formula37 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=37 < CONDITIONS, space='sell')\n    sell_formula38 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=38 < CONDITIONS, space='sell')\n    sell_formula39 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=39 < CONDITIONS, space='sell')\n    sell_formula40 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=40 < CONDITIONS, space='sell')\n    sell_formula41 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=41 < CONDITIONS, space='sell')\n    sell_formula42 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=42 < CONDITIONS, space='sell')\n    sell_formula43 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=43 < CONDITIONS, space='sell')\n    sell_formula44 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=44 < CONDITIONS, space='sell')\n    sell_formula45 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=45 < CONDITIONS, space='sell')\n    sell_formula46 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=46 < CONDITIONS, space='sell')\n    sell_formula47 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=47 < CONDITIONS, space='sell')\n    sell_formula48 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=48 < CONDITIONS, space='sell')\n    sell_formula49 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=49 < CONDITIONS, space='sell')\n    sell_formula50 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=50 < CONDITIONS, space='sell')\n    sell_formula51 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=51 < CONDITIONS, space='sell')\n    sell_formula52 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=52 < CONDITIONS, space='sell')\n    sell_formula53 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=53 < CONDITIONS, space='sell')\n    sell_formula54 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=54 < CONDITIONS, space='sell')\n    sell_formula55 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=55 < CONDITIONS, space='sell')\n    sell_formula56 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=56 < CONDITIONS, space='sell')\n    sell_formula57 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=57 < CONDITIONS, space='sell')\n    sell_formula58 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=58 < CONDITIONS, space='sell')\n    sell_formula59 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=59 < CONDITIONS, space='sell')\n    sell_formula60 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=60 < CONDITIONS, space='sell')\n    sell_formula61 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=61 < CONDITIONS, space='sell')\n    sell_formula62 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=62 < CONDITIONS, space='sell')\n    sell_formula63 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=63 < CONDITIONS, space='sell')\n    sell_formula64 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=64 < CONDITIONS, space='sell')\n    sell_formula65 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=65 < CONDITIONS, space='sell')\n    sell_formula66 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=66 < CONDITIONS, space='sell')\n    sell_formula67 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=67 < CONDITIONS, space='sell')\n    sell_formula68 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=68 < CONDITIONS, space='sell')\n    sell_formula69 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=69 < CONDITIONS, space='sell')\n    sell_formula70 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=70 < CONDITIONS, space='sell')\n    sell_formula71 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=71 < CONDITIONS, space='sell')\n    sell_formula72 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=72 < CONDITIONS, space='sell')\n    sell_formula73 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=73 < CONDITIONS, space='sell')\n    sell_formula74 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=74 < CONDITIONS, space='sell')\n    sell_formula75 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=75 < CONDITIONS, space='sell')\n    sell_formula76 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=76 < CONDITIONS, space='sell')\n    sell_formula77 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=77 < CONDITIONS, space='sell')\n    sell_formula78 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=78 < CONDITIONS, space='sell')\n    sell_formula79 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=79 < CONDITIONS, space='sell')\n    sell_formula80 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=80 < CONDITIONS, space='sell')\n    sell_formula81 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=81 < CONDITIONS, space='sell')\n    sell_formula82 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=82 < CONDITIONS, space='sell')\n    sell_formula83 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=83 < CONDITIONS, space='sell')\n    sell_formula84 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=84 < CONDITIONS, space='sell')\n    sell_formula85 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=85 < CONDITIONS, space='sell')\n    sell_formula86 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=86 < CONDITIONS, space='sell')\n    sell_formula87 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=87 < CONDITIONS, space='sell')\n    sell_formula88 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=88 < CONDITIONS, space='sell')\n    sell_formula89 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=89 < CONDITIONS, space='sell')\n    sell_formula90 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=90 < CONDITIONS, space='sell')\n    sell_formula91 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=91 < CONDITIONS, space='sell')\n    sell_formula92 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=92 < CONDITIONS, space='sell')\n    sell_formula93 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=93 < CONDITIONS, space='sell')\n    sell_formula94 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=94 < CONDITIONS, space='sell')\n    sell_formula95 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=95 < CONDITIONS, space='sell')\n    sell_formula96 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=96 < CONDITIONS, space='sell')\n    sell_formula97 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=97 < CONDITIONS, space='sell')\n    sell_formula98 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=98 < CONDITIONS, space='sell')\n    sell_formula99 = CategoricalParameter(\n        formulas, default=formulas[0], optimize=99 < CONDITIONS, space='sell')\n\n    sell_indicator0 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=0 < CONDITIONS, space='sell')\n    sell_indicator1 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=1 < CONDITIONS, space='sell')\n    sell_indicator2 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=2 < CONDITIONS, space='sell')\n    sell_indicator3 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=3 < CONDITIONS, space='sell')\n    sell_indicator4 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=4 < CONDITIONS, space='sell')\n    sell_indicator5 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=5 < CONDITIONS, space='sell')\n    sell_indicator6 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=6 < CONDITIONS, space='sell')\n    sell_indicator7 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=7 < CONDITIONS, space='sell')\n    sell_indicator8 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=8 < CONDITIONS, space='sell')\n    sell_indicator9 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=9 < CONDITIONS, space='sell')\n    sell_indicator10 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=10 < CONDITIONS, space='sell')\n    sell_indicator11 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=11 < CONDITIONS, space='sell')\n    sell_indicator12 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=12 < CONDITIONS, space='sell')\n    sell_indicator13 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=13 < CONDITIONS, space='sell')\n    sell_indicator14 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=14 < CONDITIONS, space='sell')\n    sell_indicator15 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=15 < CONDITIONS, space='sell')\n    sell_indicator16 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=16 < CONDITIONS, space='sell')\n    sell_indicator17 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=17 < CONDITIONS, space='sell')\n    sell_indicator18 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=18 < CONDITIONS, space='sell')\n    sell_indicator19 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=19 < CONDITIONS, space='sell')\n    sell_indicator20 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=20 < CONDITIONS, space='sell')\n    sell_indicator21 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=21 < CONDITIONS, space='sell')\n    sell_indicator22 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=22 < CONDITIONS, space='sell')\n    sell_indicator23 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=23 < CONDITIONS, space='sell')\n    sell_indicator24 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=24 < CONDITIONS, space='sell')\n    sell_indicator25 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=25 < CONDITIONS, space='sell')\n    sell_indicator26 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=26 < CONDITIONS, space='sell')\n    sell_indicator27 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=27 < CONDITIONS, space='sell')\n    sell_indicator28 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=28 < CONDITIONS, space='sell')\n    sell_indicator29 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=29 < CONDITIONS, space='sell')\n    sell_indicator30 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=30 < CONDITIONS, space='sell')\n    sell_indicator31 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=31 < CONDITIONS, space='sell')\n    sell_indicator32 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=32 < CONDITIONS, space='sell')\n    sell_indicator33 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=33 < CONDITIONS, space='sell')\n    sell_indicator34 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=34 < CONDITIONS, space='sell')\n    sell_indicator35 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=35 < CONDITIONS, space='sell')\n    sell_indicator36 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=36 < CONDITIONS, space='sell')\n    sell_indicator37 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=37 < CONDITIONS, space='sell')\n    sell_indicator38 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=38 < CONDITIONS, space='sell')\n    sell_indicator39 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=39 < CONDITIONS, space='sell')\n    sell_indicator40 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=40 < CONDITIONS, space='sell')\n    sell_indicator41 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=41 < CONDITIONS, space='sell')\n    sell_indicator42 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=42 < CONDITIONS, space='sell')\n    sell_indicator43 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=43 < CONDITIONS, space='sell')\n    sell_indicator44 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=44 < CONDITIONS, space='sell')\n    sell_indicator45 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=45 < CONDITIONS, space='sell')\n    sell_indicator46 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=46 < CONDITIONS, space='sell')\n    sell_indicator47 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=47 < CONDITIONS, space='sell')\n    sell_indicator48 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=48 < CONDITIONS, space='sell')\n    sell_indicator49 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=49 < CONDITIONS, space='sell')\n    sell_indicator50 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=50 < CONDITIONS, space='sell')\n    sell_indicator51 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=51 < CONDITIONS, space='sell')\n    sell_indicator52 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=52 < CONDITIONS, space='sell')\n    sell_indicator53 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=53 < CONDITIONS, space='sell')\n    sell_indicator54 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=54 < CONDITIONS, space='sell')\n    sell_indicator55 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=55 < CONDITIONS, space='sell')\n    sell_indicator56 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=56 < CONDITIONS, space='sell')\n    sell_indicator57 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=57 < CONDITIONS, space='sell')\n    sell_indicator58 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=58 < CONDITIONS, space='sell')\n    sell_indicator59 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=59 < CONDITIONS, space='sell')\n    sell_indicator60 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=60 < CONDITIONS, space='sell')\n    sell_indicator61 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=61 < CONDITIONS, space='sell')\n    sell_indicator62 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=62 < CONDITIONS, space='sell')\n    sell_indicator63 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=63 < CONDITIONS, space='sell')\n    sell_indicator64 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=64 < CONDITIONS, space='sell')\n    sell_indicator65 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=65 < CONDITIONS, space='sell')\n    sell_indicator66 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=66 < CONDITIONS, space='sell')\n    sell_indicator67 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=67 < CONDITIONS, space='sell')\n    sell_indicator68 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=68 < CONDITIONS, space='sell')\n    sell_indicator69 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=69 < CONDITIONS, space='sell')\n    sell_indicator70 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=70 < CONDITIONS, space='sell')\n    sell_indicator71 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=71 < CONDITIONS, space='sell')\n    sell_indicator72 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=72 < CONDITIONS, space='sell')\n    sell_indicator73 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=73 < CONDITIONS, space='sell')\n    sell_indicator74 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=74 < CONDITIONS, space='sell')\n    sell_indicator75 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=75 < CONDITIONS, space='sell')\n    sell_indicator76 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=76 < CONDITIONS, space='sell')\n    sell_indicator77 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=77 < CONDITIONS, space='sell')\n    sell_indicator78 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=78 < CONDITIONS, space='sell')\n    sell_indicator79 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=79 < CONDITIONS, space='sell')\n    sell_indicator80 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=80 < CONDITIONS, space='sell')\n    sell_indicator81 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=81 < CONDITIONS, space='sell')\n    sell_indicator82 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=82 < CONDITIONS, space='sell')\n    sell_indicator83 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=83 < CONDITIONS, space='sell')\n    sell_indicator84 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=84 < CONDITIONS, space='sell')\n    sell_indicator85 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=85 < CONDITIONS, space='sell')\n    sell_indicator86 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=86 < CONDITIONS, space='sell')\n    sell_indicator87 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=87 < CONDITIONS, space='sell')\n    sell_indicator88 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=88 < CONDITIONS, space='sell')\n    sell_indicator89 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=89 < CONDITIONS, space='sell')\n    sell_indicator90 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=90 < CONDITIONS, space='sell')\n    sell_indicator91 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=91 < CONDITIONS, space='sell')\n    sell_indicator92 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=92 < CONDITIONS, space='sell')\n    sell_indicator93 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=93 < CONDITIONS, space='sell')\n    sell_indicator94 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=94 < CONDITIONS, space='sell')\n    sell_indicator95 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=95 < CONDITIONS, space='sell')\n    sell_indicator96 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=96 < CONDITIONS, space='sell')\n    sell_indicator97 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=97 < CONDITIONS, space='sell')\n    sell_indicator98 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=98 < CONDITIONS, space='sell')\n    sell_indicator99 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=99 < CONDITIONS, space='sell')\n\n    sell_crossed0 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=0 < CONDITIONS, space='sell')\n    sell_crossed1 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=1 < CONDITIONS, space='sell')\n    sell_crossed2 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=2 < CONDITIONS, space='sell')\n    sell_crossed3 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=3 < CONDITIONS, space='sell')\n    sell_crossed4 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=4 < CONDITIONS, space='sell')\n    sell_crossed5 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=5 < CONDITIONS, space='sell')\n    sell_crossed6 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=6 < CONDITIONS, space='sell')\n    sell_crossed7 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=7 < CONDITIONS, space='sell')\n    sell_crossed8 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=8 < CONDITIONS, space='sell')\n    sell_crossed9 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=9 < CONDITIONS, space='sell')\n    sell_crossed10 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=10 < CONDITIONS, space='sell')\n    sell_crossed11 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=11 < CONDITIONS, space='sell')\n    sell_crossed12 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=12 < CONDITIONS, space='sell')\n    sell_crossed13 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=13 < CONDITIONS, space='sell')\n    sell_crossed14 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=14 < CONDITIONS, space='sell')\n    sell_crossed15 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=15 < CONDITIONS, space='sell')\n    sell_crossed16 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=16 < CONDITIONS, space='sell')\n    sell_crossed17 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=17 < CONDITIONS, space='sell')\n    sell_crossed18 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=18 < CONDITIONS, space='sell')\n    sell_crossed19 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=19 < CONDITIONS, space='sell')\n    sell_crossed20 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=20 < CONDITIONS, space='sell')\n    sell_crossed21 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=21 < CONDITIONS, space='sell')\n    sell_crossed22 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=22 < CONDITIONS, space='sell')\n    sell_crossed23 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=23 < CONDITIONS, space='sell')\n    sell_crossed24 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=24 < CONDITIONS, space='sell')\n    sell_crossed25 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=25 < CONDITIONS, space='sell')\n    sell_crossed26 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=26 < CONDITIONS, space='sell')\n    sell_crossed27 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=27 < CONDITIONS, space='sell')\n    sell_crossed28 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=28 < CONDITIONS, space='sell')\n    sell_crossed29 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=29 < CONDITIONS, space='sell')\n    sell_crossed30 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=30 < CONDITIONS, space='sell')\n    sell_crossed31 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=31 < CONDITIONS, space='sell')\n    sell_crossed32 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=32 < CONDITIONS, space='sell')\n    sell_crossed33 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=33 < CONDITIONS, space='sell')\n    sell_crossed34 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=34 < CONDITIONS, space='sell')\n    sell_crossed35 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=35 < CONDITIONS, space='sell')\n    sell_crossed36 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=36 < CONDITIONS, space='sell')\n    sell_crossed37 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=37 < CONDITIONS, space='sell')\n    sell_crossed38 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=38 < CONDITIONS, space='sell')\n    sell_crossed39 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=39 < CONDITIONS, space='sell')\n    sell_crossed40 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=40 < CONDITIONS, space='sell')\n    sell_crossed41 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=41 < CONDITIONS, space='sell')\n    sell_crossed42 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=42 < CONDITIONS, space='sell')\n    sell_crossed43 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=43 < CONDITIONS, space='sell')\n    sell_crossed44 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=44 < CONDITIONS, space='sell')\n    sell_crossed45 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=45 < CONDITIONS, space='sell')\n    sell_crossed46 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=46 < CONDITIONS, space='sell')\n    sell_crossed47 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=47 < CONDITIONS, space='sell')\n    sell_crossed48 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=48 < CONDITIONS, space='sell')\n    sell_crossed49 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=49 < CONDITIONS, space='sell')\n    sell_crossed50 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=50 < CONDITIONS, space='sell')\n    sell_crossed51 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=51 < CONDITIONS, space='sell')\n    sell_crossed52 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=52 < CONDITIONS, space='sell')\n    sell_crossed53 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=53 < CONDITIONS, space='sell')\n    sell_crossed54 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=54 < CONDITIONS, space='sell')\n    sell_crossed55 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=55 < CONDITIONS, space='sell')\n    sell_crossed56 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=56 < CONDITIONS, space='sell')\n    sell_crossed57 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=57 < CONDITIONS, space='sell')\n    sell_crossed58 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=58 < CONDITIONS, space='sell')\n    sell_crossed59 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=59 < CONDITIONS, space='sell')\n    sell_crossed60 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=60 < CONDITIONS, space='sell')\n    sell_crossed61 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=61 < CONDITIONS, space='sell')\n    sell_crossed62 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=62 < CONDITIONS, space='sell')\n    sell_crossed63 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=63 < CONDITIONS, space='sell')\n    sell_crossed64 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=64 < CONDITIONS, space='sell')\n    sell_crossed65 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=65 < CONDITIONS, space='sell')\n    sell_crossed66 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=66 < CONDITIONS, space='sell')\n    sell_crossed67 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=67 < CONDITIONS, space='sell')\n    sell_crossed68 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=68 < CONDITIONS, space='sell')\n    sell_crossed69 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=69 < CONDITIONS, space='sell')\n    sell_crossed70 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=70 < CONDITIONS, space='sell')\n    sell_crossed71 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=71 < CONDITIONS, space='sell')\n    sell_crossed72 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=72 < CONDITIONS, space='sell')\n    sell_crossed73 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=73 < CONDITIONS, space='sell')\n    sell_crossed74 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=74 < CONDITIONS, space='sell')\n    sell_crossed75 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=75 < CONDITIONS, space='sell')\n    sell_crossed76 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=76 < CONDITIONS, space='sell')\n    sell_crossed77 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=77 < CONDITIONS, space='sell')\n    sell_crossed78 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=78 < CONDITIONS, space='sell')\n    sell_crossed79 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=79 < CONDITIONS, space='sell')\n    sell_crossed80 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=80 < CONDITIONS, space='sell')\n    sell_crossed81 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=81 < CONDITIONS, space='sell')\n    sell_crossed82 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=82 < CONDITIONS, space='sell')\n    sell_crossed83 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=83 < CONDITIONS, space='sell')\n    sell_crossed84 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=84 < CONDITIONS, space='sell')\n    sell_crossed85 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=85 < CONDITIONS, space='sell')\n    sell_crossed86 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=86 < CONDITIONS, space='sell')\n    sell_crossed87 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=87 < CONDITIONS, space='sell')\n    sell_crossed88 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=88 < CONDITIONS, space='sell')\n    sell_crossed89 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=89 < CONDITIONS, space='sell')\n    sell_crossed90 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=90 < CONDITIONS, space='sell')\n    sell_crossed91 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=91 < CONDITIONS, space='sell')\n    sell_crossed92 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=92 < CONDITIONS, space='sell')\n    sell_crossed93 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=93 < CONDITIONS, space='sell')\n    sell_crossed94 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=94 < CONDITIONS, space='sell')\n    sell_crossed95 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=95 < CONDITIONS, space='sell')\n    sell_crossed96 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=96 < CONDITIONS, space='sell')\n    sell_crossed97 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=97 < CONDITIONS, space='sell')\n    sell_crossed98 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=98 < CONDITIONS, space='sell')\n    sell_crossed99 = CategoricalParameter(\n        indicators, default=indicators[0], optimize=99 < CONDITIONS, space='sell')\n\n    sell_timeframe0 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=0 < CONDITIONS, space='sell')\n    sell_timeframe1 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=1 < CONDITIONS, space='sell')\n    sell_timeframe2 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=2 < CONDITIONS, space='sell')\n    sell_timeframe3 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=3 < CONDITIONS, space='sell')\n    sell_timeframe4 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=4 < CONDITIONS, space='sell')\n    sell_timeframe5 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=5 < CONDITIONS, space='sell')\n    sell_timeframe6 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=6 < CONDITIONS, space='sell')\n    sell_timeframe7 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=7 < CONDITIONS, space='sell')\n    sell_timeframe8 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=8 < CONDITIONS, space='sell')\n    sell_timeframe9 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=9 < CONDITIONS, space='sell')\n    sell_timeframe10 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=10 < CONDITIONS, space='sell')\n    sell_timeframe11 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=11 < CONDITIONS, space='sell')\n    sell_timeframe12 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=12 < CONDITIONS, space='sell')\n    sell_timeframe13 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=13 < CONDITIONS, space='sell')\n    sell_timeframe14 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=14 < CONDITIONS, space='sell')\n    sell_timeframe15 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=15 < CONDITIONS, space='sell')\n    sell_timeframe16 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=16 < CONDITIONS, space='sell')\n    sell_timeframe17 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=17 < CONDITIONS, space='sell')\n    sell_timeframe18 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=18 < CONDITIONS, space='sell')\n    sell_timeframe19 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=19 < CONDITIONS, space='sell')\n    sell_timeframe20 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=20 < CONDITIONS, space='sell')\n    sell_timeframe21 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=21 < CONDITIONS, space='sell')\n    sell_timeframe22 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=22 < CONDITIONS, space='sell')\n    sell_timeframe23 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=23 < CONDITIONS, space='sell')\n    sell_timeframe24 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=24 < CONDITIONS, space='sell')\n    sell_timeframe25 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=25 < CONDITIONS, space='sell')\n    sell_timeframe26 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=26 < CONDITIONS, space='sell')\n    sell_timeframe27 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=27 < CONDITIONS, space='sell')\n    sell_timeframe28 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=28 < CONDITIONS, space='sell')\n    sell_timeframe29 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=29 < CONDITIONS, space='sell')\n    sell_timeframe30 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=30 < CONDITIONS, space='sell')\n    sell_timeframe31 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=31 < CONDITIONS, space='sell')\n    sell_timeframe32 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=32 < CONDITIONS, space='sell')\n    sell_timeframe33 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=33 < CONDITIONS, space='sell')\n    sell_timeframe34 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=34 < CONDITIONS, space='sell')\n    sell_timeframe35 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=35 < CONDITIONS, space='sell')\n    sell_timeframe36 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=36 < CONDITIONS, space='sell')\n    sell_timeframe37 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=37 < CONDITIONS, space='sell')\n    sell_timeframe38 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=38 < CONDITIONS, space='sell')\n    sell_timeframe39 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=39 < CONDITIONS, space='sell')\n    sell_timeframe40 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=40 < CONDITIONS, space='sell')\n    sell_timeframe41 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=41 < CONDITIONS, space='sell')\n    sell_timeframe42 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=42 < CONDITIONS, space='sell')\n    sell_timeframe43 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=43 < CONDITIONS, space='sell')\n    sell_timeframe44 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=44 < CONDITIONS, space='sell')\n    sell_timeframe45 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=45 < CONDITIONS, space='sell')\n    sell_timeframe46 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=46 < CONDITIONS, space='sell')\n    sell_timeframe47 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=47 < CONDITIONS, space='sell')\n    sell_timeframe48 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=48 < CONDITIONS, space='sell')\n    sell_timeframe49 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=49 < CONDITIONS, space='sell')\n    sell_timeframe50 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=50 < CONDITIONS, space='sell')\n    sell_timeframe51 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=51 < CONDITIONS, space='sell')\n    sell_timeframe52 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=52 < CONDITIONS, space='sell')\n    sell_timeframe53 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=53 < CONDITIONS, space='sell')\n    sell_timeframe54 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=54 < CONDITIONS, space='sell')\n    sell_timeframe55 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=55 < CONDITIONS, space='sell')\n    sell_timeframe56 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=56 < CONDITIONS, space='sell')\n    sell_timeframe57 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=57 < CONDITIONS, space='sell')\n    sell_timeframe58 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=58 < CONDITIONS, space='sell')\n    sell_timeframe59 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=59 < CONDITIONS, space='sell')\n    sell_timeframe60 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=60 < CONDITIONS, space='sell')\n    sell_timeframe61 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=61 < CONDITIONS, space='sell')\n    sell_timeframe62 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=62 < CONDITIONS, space='sell')\n    sell_timeframe63 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=63 < CONDITIONS, space='sell')\n    sell_timeframe64 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=64 < CONDITIONS, space='sell')\n    sell_timeframe65 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=65 < CONDITIONS, space='sell')\n    sell_timeframe66 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=66 < CONDITIONS, space='sell')\n    sell_timeframe67 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=67 < CONDITIONS, space='sell')\n    sell_timeframe68 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=68 < CONDITIONS, space='sell')\n    sell_timeframe69 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=69 < CONDITIONS, space='sell')\n    sell_timeframe70 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=70 < CONDITIONS, space='sell')\n    sell_timeframe71 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=71 < CONDITIONS, space='sell')\n    sell_timeframe72 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=72 < CONDITIONS, space='sell')\n    sell_timeframe73 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=73 < CONDITIONS, space='sell')\n    sell_timeframe74 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=74 < CONDITIONS, space='sell')\n    sell_timeframe75 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=75 < CONDITIONS, space='sell')\n    sell_timeframe76 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=76 < CONDITIONS, space='sell')\n    sell_timeframe77 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=77 < CONDITIONS, space='sell')\n    sell_timeframe78 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=78 < CONDITIONS, space='sell')\n    sell_timeframe79 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=79 < CONDITIONS, space='sell')\n    sell_timeframe80 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=80 < CONDITIONS, space='sell')\n    sell_timeframe81 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=81 < CONDITIONS, space='sell')\n    sell_timeframe82 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=82 < CONDITIONS, space='sell')\n    sell_timeframe83 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=83 < CONDITIONS, space='sell')\n    sell_timeframe84 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=84 < CONDITIONS, space='sell')\n    sell_timeframe85 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=85 < CONDITIONS, space='sell')\n    sell_timeframe86 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=86 < CONDITIONS, space='sell')\n    sell_timeframe87 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=87 < CONDITIONS, space='sell')\n    sell_timeframe88 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=88 < CONDITIONS, space='sell')\n    sell_timeframe89 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=89 < CONDITIONS, space='sell')\n    sell_timeframe90 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=90 < CONDITIONS, space='sell')\n    sell_timeframe91 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=91 < CONDITIONS, space='sell')\n    sell_timeframe92 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=92 < CONDITIONS, space='sell')\n    sell_timeframe93 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=93 < CONDITIONS, space='sell')\n    sell_timeframe94 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=94 < CONDITIONS, space='sell')\n    sell_timeframe95 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=95 < CONDITIONS, space='sell')\n    sell_timeframe96 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=96 < CONDITIONS, space='sell')\n    sell_timeframe97 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=97 < CONDITIONS, space='sell')\n    sell_timeframe98 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=98 < CONDITIONS, space='sell')\n    sell_timeframe99 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=99 < CONDITIONS, space='sell')\n\n    sell_crossed_timeframe0 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=0 < CONDITIONS, space='sell')\n    sell_crossed_timeframe1 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=1 < CONDITIONS, space='sell')\n    sell_crossed_timeframe2 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=2 < CONDITIONS, space='sell')\n    sell_crossed_timeframe3 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=3 < CONDITIONS, space='sell')\n    sell_crossed_timeframe4 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=4 < CONDITIONS, space='sell')\n    sell_crossed_timeframe5 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=5 < CONDITIONS, space='sell')\n    sell_crossed_timeframe6 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=6 < CONDITIONS, space='sell')\n    sell_crossed_timeframe7 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=7 < CONDITIONS, space='sell')\n    sell_crossed_timeframe8 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=8 < CONDITIONS, space='sell')\n    sell_crossed_timeframe9 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=9 < CONDITIONS, space='sell')\n    sell_crossed_timeframe10 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=10 < CONDITIONS, space='sell')\n    sell_crossed_timeframe11 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=11 < CONDITIONS, space='sell')\n    sell_crossed_timeframe12 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=12 < CONDITIONS, space='sell')\n    sell_crossed_timeframe13 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=13 < CONDITIONS, space='sell')\n    sell_crossed_timeframe14 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=14 < CONDITIONS, space='sell')\n    sell_crossed_timeframe15 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=15 < CONDITIONS, space='sell')\n    sell_crossed_timeframe16 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=16 < CONDITIONS, space='sell')\n    sell_crossed_timeframe17 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=17 < CONDITIONS, space='sell')\n    sell_crossed_timeframe18 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=18 < CONDITIONS, space='sell')\n    sell_crossed_timeframe19 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=19 < CONDITIONS, space='sell')\n    sell_crossed_timeframe20 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=20 < CONDITIONS, space='sell')\n    sell_crossed_timeframe21 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=21 < CONDITIONS, space='sell')\n    sell_crossed_timeframe22 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=22 < CONDITIONS, space='sell')\n    sell_crossed_timeframe23 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=23 < CONDITIONS, space='sell')\n    sell_crossed_timeframe24 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=24 < CONDITIONS, space='sell')\n    sell_crossed_timeframe25 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=25 < CONDITIONS, space='sell')\n    sell_crossed_timeframe26 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=26 < CONDITIONS, space='sell')\n    sell_crossed_timeframe27 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=27 < CONDITIONS, space='sell')\n    sell_crossed_timeframe28 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=28 < CONDITIONS, space='sell')\n    sell_crossed_timeframe29 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=29 < CONDITIONS, space='sell')\n    sell_crossed_timeframe30 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=30 < CONDITIONS, space='sell')\n    sell_crossed_timeframe31 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=31 < CONDITIONS, space='sell')\n    sell_crossed_timeframe32 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=32 < CONDITIONS, space='sell')\n    sell_crossed_timeframe33 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=33 < CONDITIONS, space='sell')\n    sell_crossed_timeframe34 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=34 < CONDITIONS, space='sell')\n    sell_crossed_timeframe35 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=35 < CONDITIONS, space='sell')\n    sell_crossed_timeframe36 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=36 < CONDITIONS, space='sell')\n    sell_crossed_timeframe37 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=37 < CONDITIONS, space='sell')\n    sell_crossed_timeframe38 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=38 < CONDITIONS, space='sell')\n    sell_crossed_timeframe39 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=39 < CONDITIONS, space='sell')\n    sell_crossed_timeframe40 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=40 < CONDITIONS, space='sell')\n    sell_crossed_timeframe41 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=41 < CONDITIONS, space='sell')\n    sell_crossed_timeframe42 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=42 < CONDITIONS, space='sell')\n    sell_crossed_timeframe43 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=43 < CONDITIONS, space='sell')\n    sell_crossed_timeframe44 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=44 < CONDITIONS, space='sell')\n    sell_crossed_timeframe45 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=45 < CONDITIONS, space='sell')\n    sell_crossed_timeframe46 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=46 < CONDITIONS, space='sell')\n    sell_crossed_timeframe47 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=47 < CONDITIONS, space='sell')\n    sell_crossed_timeframe48 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=48 < CONDITIONS, space='sell')\n    sell_crossed_timeframe49 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=49 < CONDITIONS, space='sell')\n    sell_crossed_timeframe50 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=50 < CONDITIONS, space='sell')\n    sell_crossed_timeframe51 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=51 < CONDITIONS, space='sell')\n    sell_crossed_timeframe52 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=52 < CONDITIONS, space='sell')\n    sell_crossed_timeframe53 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=53 < CONDITIONS, space='sell')\n    sell_crossed_timeframe54 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=54 < CONDITIONS, space='sell')\n    sell_crossed_timeframe55 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=55 < CONDITIONS, space='sell')\n    sell_crossed_timeframe56 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=56 < CONDITIONS, space='sell')\n    sell_crossed_timeframe57 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=57 < CONDITIONS, space='sell')\n    sell_crossed_timeframe58 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=58 < CONDITIONS, space='sell')\n    sell_crossed_timeframe59 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=59 < CONDITIONS, space='sell')\n    sell_crossed_timeframe60 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=60 < CONDITIONS, space='sell')\n    sell_crossed_timeframe61 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=61 < CONDITIONS, space='sell')\n    sell_crossed_timeframe62 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=62 < CONDITIONS, space='sell')\n    sell_crossed_timeframe63 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=63 < CONDITIONS, space='sell')\n    sell_crossed_timeframe64 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=64 < CONDITIONS, space='sell')\n    sell_crossed_timeframe65 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=65 < CONDITIONS, space='sell')\n    sell_crossed_timeframe66 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=66 < CONDITIONS, space='sell')\n    sell_crossed_timeframe67 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=67 < CONDITIONS, space='sell')\n    sell_crossed_timeframe68 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=68 < CONDITIONS, space='sell')\n    sell_crossed_timeframe69 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=69 < CONDITIONS, space='sell')\n    sell_crossed_timeframe70 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=70 < CONDITIONS, space='sell')\n    sell_crossed_timeframe71 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=71 < CONDITIONS, space='sell')\n    sell_crossed_timeframe72 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=72 < CONDITIONS, space='sell')\n    sell_crossed_timeframe73 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=73 < CONDITIONS, space='sell')\n    sell_crossed_timeframe74 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=74 < CONDITIONS, space='sell')\n    sell_crossed_timeframe75 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=75 < CONDITIONS, space='sell')\n    sell_crossed_timeframe76 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=76 < CONDITIONS, space='sell')\n    sell_crossed_timeframe77 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=77 < CONDITIONS, space='sell')\n    sell_crossed_timeframe78 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=78 < CONDITIONS, space='sell')\n    sell_crossed_timeframe79 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=79 < CONDITIONS, space='sell')\n    sell_crossed_timeframe80 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=80 < CONDITIONS, space='sell')\n    sell_crossed_timeframe81 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=81 < CONDITIONS, space='sell')\n    sell_crossed_timeframe82 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=82 < CONDITIONS, space='sell')\n    sell_crossed_timeframe83 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=83 < CONDITIONS, space='sell')\n    sell_crossed_timeframe84 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=84 < CONDITIONS, space='sell')\n    sell_crossed_timeframe85 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=85 < CONDITIONS, space='sell')\n    sell_crossed_timeframe86 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=86 < CONDITIONS, space='sell')\n    sell_crossed_timeframe87 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=87 < CONDITIONS, space='sell')\n    sell_crossed_timeframe88 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=88 < CONDITIONS, space='sell')\n    sell_crossed_timeframe89 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=89 < CONDITIONS, space='sell')\n    sell_crossed_timeframe90 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=90 < CONDITIONS, space='sell')\n    sell_crossed_timeframe91 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=91 < CONDITIONS, space='sell')\n    sell_crossed_timeframe92 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=92 < CONDITIONS, space='sell')\n    sell_crossed_timeframe93 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=93 < CONDITIONS, space='sell')\n    sell_crossed_timeframe94 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=94 < CONDITIONS, space='sell')\n    sell_crossed_timeframe95 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=95 < CONDITIONS, space='sell')\n    sell_crossed_timeframe96 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=96 < CONDITIONS, space='sell')\n    sell_crossed_timeframe97 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=97 < CONDITIONS, space='sell')\n    sell_crossed_timeframe98 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=98 < CONDITIONS, space='sell')\n    sell_crossed_timeframe99 = CategoricalParameter(timeframes, default=timeframes[0], optimize=0 < CONDITIONS, space='sell')if COSTUMETFENABLED else IntParameter(\n        timeframes[0], timeframes[-1], default=timeframes[0], optimize=99 < CONDITIONS, space='sell')\n\n    sell_real0 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=0 < CONDITIONS, space='sell')\n    sell_real1 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=1 < CONDITIONS, space='sell')\n    sell_real2 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=2 < CONDITIONS, space='sell')\n    sell_real3 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=3 < CONDITIONS, space='sell')\n    sell_real4 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=4 < CONDITIONS, space='sell')\n    sell_real5 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=5 < CONDITIONS, space='sell')\n    sell_real6 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=6 < CONDITIONS, space='sell')\n    sell_real7 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=7 < CONDITIONS, space='sell')\n    sell_real8 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=8 < CONDITIONS, space='sell')\n    sell_real9 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=9 < CONDITIONS, space='sell')\n    sell_real10 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=10 < CONDITIONS, space='sell')\n    sell_real11 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=11 < CONDITIONS, space='sell')\n    sell_real12 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=12 < CONDITIONS, space='sell')\n    sell_real13 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=13 < CONDITIONS, space='sell')\n    sell_real14 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=14 < CONDITIONS, space='sell')\n    sell_real15 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=15 < CONDITIONS, space='sell')\n    sell_real16 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=16 < CONDITIONS, space='sell')\n    sell_real17 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=17 < CONDITIONS, space='sell')\n    sell_real18 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=18 < CONDITIONS, space='sell')\n    sell_real19 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=19 < CONDITIONS, space='sell')\n    sell_real20 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=20 < CONDITIONS, space='sell')\n    sell_real21 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=21 < CONDITIONS, space='sell')\n    sell_real22 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=22 < CONDITIONS, space='sell')\n    sell_real23 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=23 < CONDITIONS, space='sell')\n    sell_real24 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=24 < CONDITIONS, space='sell')\n    sell_real25 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=25 < CONDITIONS, space='sell')\n    sell_real26 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=26 < CONDITIONS, space='sell')\n    sell_real27 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=27 < CONDITIONS, space='sell')\n    sell_real28 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=28 < CONDITIONS, space='sell')\n    sell_real29 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=29 < CONDITIONS, space='sell')\n    sell_real30 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=30 < CONDITIONS, space='sell')\n    sell_real31 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=31 < CONDITIONS, space='sell')\n    sell_real32 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=32 < CONDITIONS, space='sell')\n    sell_real33 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=33 < CONDITIONS, space='sell')\n    sell_real34 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=34 < CONDITIONS, space='sell')\n    sell_real35 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=35 < CONDITIONS, space='sell')\n    sell_real36 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=36 < CONDITIONS, space='sell')\n    sell_real37 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=37 < CONDITIONS, space='sell')\n    sell_real38 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=38 < CONDITIONS, space='sell')\n    sell_real39 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=39 < CONDITIONS, space='sell')\n    sell_real40 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=40 < CONDITIONS, space='sell')\n    sell_real41 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=41 < CONDITIONS, space='sell')\n    sell_real42 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=42 < CONDITIONS, space='sell')\n    sell_real43 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=43 < CONDITIONS, space='sell')\n    sell_real44 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=44 < CONDITIONS, space='sell')\n    sell_real45 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=45 < CONDITIONS, space='sell')\n    sell_real46 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=46 < CONDITIONS, space='sell')\n    sell_real47 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=47 < CONDITIONS, space='sell')\n    sell_real48 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=48 < CONDITIONS, space='sell')\n    sell_real49 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=49 < CONDITIONS, space='sell')\n    sell_real50 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=50 < CONDITIONS, space='sell')\n    sell_real51 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=51 < CONDITIONS, space='sell')\n    sell_real52 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=52 < CONDITIONS, space='sell')\n    sell_real53 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=53 < CONDITIONS, space='sell')\n    sell_real54 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=54 < CONDITIONS, space='sell')\n    sell_real55 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=55 < CONDITIONS, space='sell')\n    sell_real56 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=56 < CONDITIONS, space='sell')\n    sell_real57 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=57 < CONDITIONS, space='sell')\n    sell_real58 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=58 < CONDITIONS, space='sell')\n    sell_real59 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=59 < CONDITIONS, space='sell')\n    sell_real60 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=60 < CONDITIONS, space='sell')\n    sell_real61 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=61 < CONDITIONS, space='sell')\n    sell_real62 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=62 < CONDITIONS, space='sell')\n    sell_real63 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=63 < CONDITIONS, space='sell')\n    sell_real64 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=64 < CONDITIONS, space='sell')\n    sell_real65 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=65 < CONDITIONS, space='sell')\n    sell_real66 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=66 < CONDITIONS, space='sell')\n    sell_real67 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=67 < CONDITIONS, space='sell')\n    sell_real68 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=68 < CONDITIONS, space='sell')\n    sell_real69 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=69 < CONDITIONS, space='sell')\n    sell_real70 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=70 < CONDITIONS, space='sell')\n    sell_real71 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=71 < CONDITIONS, space='sell')\n    sell_real72 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=72 < CONDITIONS, space='sell')\n    sell_real73 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=73 < CONDITIONS, space='sell')\n    sell_real74 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=74 < CONDITIONS, space='sell')\n    sell_real75 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=75 < CONDITIONS, space='sell')\n    sell_real76 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=76 < CONDITIONS, space='sell')\n    sell_real77 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=77 < CONDITIONS, space='sell')\n    sell_real78 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=78 < CONDITIONS, space='sell')\n    sell_real79 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=79 < CONDITIONS, space='sell')\n    sell_real80 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=80 < CONDITIONS, space='sell')\n    sell_real81 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=81 < CONDITIONS, space='sell')\n    sell_real82 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=82 < CONDITIONS, space='sell')\n    sell_real83 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=83 < CONDITIONS, space='sell')\n    sell_real84 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=84 < CONDITIONS, space='sell')\n    sell_real85 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=85 < CONDITIONS, space='sell')\n    sell_real86 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=86 < CONDITIONS, space='sell')\n    sell_real87 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=87 < CONDITIONS, space='sell')\n    sell_real88 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=88 < CONDITIONS, space='sell')\n    sell_real89 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=89 < CONDITIONS, space='sell')\n    sell_real90 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=90 < CONDITIONS, space='sell')\n    sell_real91 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=91 < CONDITIONS, space='sell')\n    sell_real92 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=92 < CONDITIONS, space='sell')\n    sell_real93 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=93 < CONDITIONS, space='sell')\n    sell_real94 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=94 < CONDITIONS, space='sell')\n    sell_real95 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=95 < CONDITIONS, space='sell')\n    sell_real96 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=96 < CONDITIONS, space='sell')\n    sell_real97 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=97 < CONDITIONS, space='sell')\n    sell_real98 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=98 < CONDITIONS, space='sell')\n    sell_real99 = DecimalParameter(\n        reals[0], reals[-1], default=reals[0], decimals=DECIMALS, optimize=99 < CONDITIONS, space='sell')\n    ###############################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe1 = dataframe.shift(1)\n        # print(timeframes)\n        for indicator in indicators:\n            for tf_idx in timeframes:\n                tf_idx = int(tf_idx)\n                try:\n                    dataframe[f'{indicator}-{tf_idx}'] = getattr(\n                        ta, indicator)(dataframe1, timeperiod=tf_idx)\n                except:\n                    try:\n                        dataframe[f'{indicator}-{tf_idx}'] = getattr(\n                            ta, indicator)(dataframe1, timeperiod=float(tf_idx))\n                    except:\n                        try:\n                            dataframe[f'{indicator}-{tf_idx}'] = getattr(ta, indicator)(\n                                dataframe1,  timeperiod=tf_idx).iloc[:, 0]\n                        except:\n                            raise\n        # print(dataframe.keys())\n        # print(\"\\t\",metadata['pair'],end=\"\\h\")\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        for i in range(CONDITIONS):\n            i = str(i)\n            indicator = f'{getattr(self,\"indicator\"+i).value}'\n            crossed = f'{getattr(self,\"crossed\"+i).value}'\n            timeframe = f'{getattr(self,\"timeframe\"+i).value}'\n            crossed_timeframe = f'{getattr(self,\"crossed_timeframe\"+i).value}'\n            formula = f'{getattr(self,\"formula\"+i).value}'\n\n            A = dataframe[f'{indicator}-{timeframe}']\n            B = dataframe[f'{crossed}-{crossed_timeframe}']\n            R = pd.Series([float(f'{getattr(self,\"real\"+i).value}')]*len(A))\n            df = pd.DataFrame({'A': A, 'B': A, 'R': R})\n\n            conditions.append(df.eval(formula))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy']=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        formula = []\n        max_loop = CONDITIONS\n        i = 0\n        last_df = pd.DataFrame\n        last_opr = None\n        for i in range(CONDITIONS):\n            i = str(i)\n            indicator = f'{getattr(self,\"sell_indicator\"+i).value}'\n            crossed = f'{getattr(self,\"sell_crossed\"+i).value}'\n            tf_idx = f'{getattr(self,\"sell_timeframe\"+i).value}'\n            crossed_timeframe_idx = f'{getattr(self,\"sell_crossed_timeframe\"+i).value}'\n            formula = f'{getattr(self,\"sell_formula\"+i).value}'\n\n            A = dataframe[f'{indicator}-{tf_idx}']\n            B = dataframe[f'{crossed}-{crossed_timeframe_idx}']\n            R = pd.Series([float(f'{getattr(self,\"sell_real\"+i).value}')]*len(A))\n            df = pd.DataFrame({'A': A, 'B': A, 'R': R})\n\n            conditions.append(df.eval(formula))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell']=1\n\n        return dataframe\n\n"
  },
  {
    "path": "strategies/PrawnstarOBV/PrawnstarOBV.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import IStrategy, stoploss_from_open\n\npd.options.mode.chained_assignment = None  # default='warn'\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass PrawnstarOBV(IStrategy):\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    # ROI table:\n    #minimal_roi = {\n    #    \"0\": 0.8\n    #}\n\n    minimal_roi = {\n        \"0\": 0.296,\n        \"179\": 0.137,\n        \"810\": 0.025,\n        \"1024\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.15\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.04\n    trailing_only_offset_is_reached = True\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = False\n    use_buy_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Momentum Indicators\n        # ------------------------------------\n        \n        # Momentum\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['obv'] = ta.OBV(dataframe)\n        dataframe['obvSma'] = ta.SMA(dataframe['obv'], timeperiod=7)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['obv'], dataframe['obvSma'])) &\n                (dataframe['rsi'] < 50) |\n                ((dataframe['obvSma'] - dataframe['close']) / dataframe['obvSma'] > 0.1) |\n                (dataframe['obv'] > dataframe['obv'].shift(1)) &\n                (dataframe['obvSma'] > dataframe['obvSma'].shift(5)) &\n                (dataframe['rsi'] < 50)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/PumpDetector/PumpDetector.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nimport math\n\n\"\"\"\n    https://fr.tradingview.com/script/vDX9m7PJ-L2-KDJ-with-Whale-Pump-Detector/\n    translated for freqtrade: viksal1982  viktors.s@gmail.com\n\"\"\"\n\n\ndef xsa(dataframe, source, len, wei):\n    df = dataframe.copy().fillna(0)\n    def calc_xsa(dfr, init=0):\n        global calc_sumf_value\n        global calc_src_value\n        global calc_out_value\n        if init == 1:\n            calc_sumf_value = [0.0] * len\n            calc_src_value = [0.0] * len\n            calc_out_value = [0.0] * len\n            return\n        calc_src_value.pop(0)\n        calc_src_value.append(dfr[source])\n        sumf_val = calc_sumf_value[-1] - calc_src_value[0] \n        ma_val = sumf_val / len\n        out_val = (calc_src_value[-1] * wei + calc_out_value[-1] * (len-wei))/len\n        calc_sumf_value.pop(0)\n        calc_sumf_value.append(sumf_val)\n        calc_out_value.pop(0)\n        calc_out_value.append(out_val)\n        return out_val\n    calc_xsa(None, init=1)\n    df['retxsa'] = df.apply(calc_xsa, axis = 1)\n    \n    return df['retxsa']    \n\nclass PumpDetector(IStrategy):\n\n\n\n\n  \n    INTERFACE_VERSION = 2\n\n\n    stoploss = -0.99\n\n  \n    trailing_stop = False\n \n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n        \n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"XSA\": {\n                'j': {'color': 'blue'},\n                'k': {'color': 'orange'},\n            } \n        }\n    }\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n\n        n1 = 18\n        m1 = 4\n        m2 = 4\n\n        dataframe['var1']  = dataframe['low'].shift(1)\n        dataframe['var1_abs']  = (dataframe['low'] - dataframe['var1']).abs()\n        dataframe['var1_max']  = np.where((dataframe['low'] - dataframe['var1']) > 0, (dataframe['low'] - dataframe['var1']), 0)\n        dataframe['var2_test'] = xsa(dataframe, source = 'var1_abs', len = 3, wei = 1) \n        dataframe['var2'] = (xsa(dataframe, source = 'var1_abs', len = 3, wei = 1) / xsa(dataframe, source = 'var1_max', len = 3, wei = 1)) * 100\n        dataframe['var2_10'] = dataframe['var2'] * 10\n        dataframe['var3']  = ta.EMA( dataframe['var2_10'], timeperiod = 3)\n        dataframe['var4']  = dataframe['low'].rolling(38).min()\n        dataframe['var5']  = dataframe['var3'].rolling(38).max()\n        dataframe['var6']  = 1\n        dataframe['var7_data']  = np.where(dataframe['low'] <=  dataframe['var4'], (dataframe['var3'] + dataframe['var5'] * 2)/2 , 0 )\n        dataframe['var7']  = ta.EMA( dataframe['var7_data'], timeperiod = 3) / 618 * dataframe['var3']\n\n        dataframe['var8']  = ((dataframe['close']-dataframe['low'].rolling(21).min() )/( dataframe['high'].rolling(21).max()  - dataframe['low'].rolling(21).min() ))*100\n        dataframe['var9'] = xsa(dataframe, source = 'var8', len = 13, wei = 8)\n        \n        dataframe['rsv'] = (dataframe['close'] - dataframe['low'].rolling(n1).min() )  /( dataframe['high'].rolling(n1).max() - dataframe['low'].rolling(n1).min()  )*100\n        dataframe['k'] = xsa(dataframe, source = 'rsv', len = m1, wei = 1)\n        dataframe['d'] = xsa(dataframe, source = 'k', len = m2, wei = 1)\n        dataframe['j'] = 3 * dataframe['k'] - 2 * dataframe['d']\n\n        \n        # dataframe.to_csv('test.csv')\n\n       \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n     \n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['j'],  0)) &   \n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n   \n        dataframe.loc[\n            (\n                \n                ((qtpylib.crossed_above(dataframe['j'],  90))  |\n                (qtpylib.crossed_below(dataframe['j'], dataframe['k']) & dataframe['j'] > 50)  )  & \n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/Quickie/Quickie.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Quickie(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n        momentum based strategie. The main idea is that it closes trades very quickly, while avoiding excessive losses. Hence a rather moderate stop loss in this case\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"100\": 0.01,\n        \"30\": 0.03,\n        \"15\": 0.06,\n        \"10\": 0.15,\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n        dataframe['sma_50'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 30) &\n                    (dataframe['tema'] < dataframe['bb_middleband']) &\n                    (dataframe['tema'] > dataframe['tema'].shift(1)) &\n                    (dataframe['sma_200'] > dataframe['close'])\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['adx'] > 70) &\n                    (dataframe['tema'] > dataframe['bb_middleband']) &\n                    (dataframe['tema'] < dataframe['tema'].shift(1))\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/RSI/RSI.py",
    "content": "# --- Do not remove these libs ---\r\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, informative\r\nfrom typing import Dict, List\r\nfrom functools import reduce\r\nfrom pandas import DataFrame\r\nimport talib.abstract as ta\r\nfrom talib import WILLR\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport requests\r\nimport json\r\n# --------------------------------\r\n\r\n\r\n\r\n\r\nclass RSI(IStrategy):\r\n\r\n\r\n    # Minimal ROI designed for the strategy.\r\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\r\n    minimal_roi = {\r\n        \"0\":  0.09\r\n    }\r\n\r\n    # Optimal stoploss designed for the strategy\r\n    # This attribute will be overridden if the config file contains \"stoploss\"\r\n    stoploss = -0.99\r\n    # custom_stop = -0.1\r\n    # Optimal timeframe for the strategy\r\n    timeframe = '15m'\r\n\r\n\r\n    # trailing stoploss\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.01\r\n    trailing_stop_positive_offset = 0.02\r\n\r\n    # run \"populate_indicators\" only for new candle\r\n    process_only_new_candles = True\r\n\r\n    # Experimental settings (configuration will overide these if set)\r\n    use_sell_signal = True\r\n    sell_profit_only = True\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Optional order type mapping\r\n    order_types = {\r\n        'buy': 'limit',\r\n        'sell': 'limit',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False\r\n    }\r\n\r\n    def informative_pairs(self):\r\n        return []\r\n\r\n\r\n\r\n    @informative('30m')\r\n    def populate_indicators_30m(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rperc'] = ta.WILLR(dataframe, timeperiod=14)\r\n        return dataframe\r\n\r\n\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Adds several different TA indicators to the given DataFrame\r\n        Performance Note: For the best performance be frugal on the number of indicators\r\n        you are using. Let uncomment only the indicator you are using in your strategies\r\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\r\n        \"\"\"\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rperc'] = ta.WILLR(dataframe, timeperiod=14)\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the buy signal for the given dataframe\r\n        :param dataframe: DataFrame\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        # rsi_cond = dataframe['rsi_15m'].iloc[-1] <30 and dataframe['rsi_15m'].iloc[-2]<30\r\n        dataframe.loc[(dataframe['rsi']<30) & (dataframe['rperc']<-80),'buy'] = 1\r\n        # dataframe.loc[(dataframe['rsi']<=30) & (dataframe['rsi'].iloc[-1] <=30)] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the sell signal for the given dataframe\r\n        :param dataframe: DataFrame\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        dataframe.loc[(dataframe['rsi_30m']>70) &\r\n                            (dataframe['rperc_30m']>-20) ,'sell'] = 1\r\n\r\n\r\n        return dataframe\r\n"
  },
  {
    "path": "strategies/RSIBB02/RSIBB02.py",
    "content": "# pragma pylint: disableBBmissing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np # noqa\nimport pandas as pd # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n#from freqtrade.indicator_helpers import fishers_inverse\n\nclass RSIBB02(IStrategy):\n    \"\"\"\n    Default Strategy provided by freqtrade bot.\n    You can override it with your own strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy\n    minimal_roi = {\n    \"0\": 0.24140975952086036,\n    \"13\": 0.049595065708988986,\n    \"51\": 0.01046521346331895,\n    \"135\": 0\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.12515406445006344\n\t\n\t # Optimal ticker interval for the strategy\n    ticker_interval = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional time in force for orders\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicator\n        # ------------------------------------\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 19) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband'] )\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 83) &\n                (dataframe[\"close\"] > dataframe['bb_middleband'] )\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/RSIv2/RSIv2.py",
    "content": "# --- Do not remove these libs ---\r\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, informative\r\nfrom typing import Dict, List\r\nfrom functools import reduce\r\nfrom pandas import DataFrame\r\nimport talib.abstract as ta\r\nfrom talib import WILLR\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport requests\r\nimport json\r\n# --------------------------------\r\n\r\n\r\n\r\n\r\nclass RSIv2(IStrategy):\r\n\r\n\r\n    # Minimal ROI designed for the strategy.\r\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\r\n    minimal_roi = {\r\n        \"0\":  0.01\r\n    }\r\n\r\n    # Optimal stoploss designed for the strategy\r\n    # This attribute will be overridden if the config file contains \"stoploss\"\r\n    stoploss = -0.99\r\n    custom_stop = -0.1\r\n    # Optimal timeframe for the strategy\r\n    timeframe = '15m'\r\n    startup_candle_count = 20\r\n\r\n    # trailing stoploss\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.01\r\n    trailing_stop_positive_offset = 0.02\r\n\r\n    # run \"populate_indicators\" only for new candle\r\n    process_only_new_candles = True\r\n\r\n    # Experimental settings (configuration will overide these if set)\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Optional order type mapping\r\n    order_types = {\r\n        'buy': 'limit',\r\n        'sell': 'limit',\r\n        'stoploss': 'market',\r\n        'stoploss_on_exchange': False\r\n    }\r\n\r\n    def informative_pairs(self):\r\n        return []\r\n\r\n\r\n\r\n    @informative('30m')\r\n    def populate_indicators_30m(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rperc'] = ta.WILLR(dataframe, timeperiod=14)\r\n        return dataframe\r\n\r\n\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Adds several different TA indicators to the given DataFrame\r\n        Performance Note: For the best performance be frugal on the number of indicators\r\n        you are using. Let uncomment only the indicator you are using in your strategies\r\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\r\n        \"\"\"\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n        dataframe['rperc'] = ta.WILLR(dataframe, timeperiod=14)\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the buy signal for the given dataframe\r\n        :param dataframe: DataFrame\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        # rsi_cond = dataframe['rsi_15m'].iloc[-1] <30 and dataframe['rsi_15m'].iloc[-2]<30\r\n        dataframe.loc[(dataframe['rsi']<30) &\r\n                            (dataframe['rperc']<-80) & (dataframe['rsi'].shift(1)<30) &\r\n                            (dataframe['rperc'].shift(1)<-80),'buy'] = 1\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the sell signal for the given dataframe\r\n        :param dataframe: DataFrame\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        dataframe.loc[(dataframe['rsi_30m']>70) &\r\n                            (dataframe['rperc_30m']>-20) & (dataframe['rsi_30m'].shift(1)>70) &\r\n                            (dataframe['rperc_30m'].shift(1)>-20) ,'sell'] = 1\r\n        return dataframe\r\n"
  },
  {
    "path": "strategies/RalliV1/RalliV1.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_high_2\": -2.327,\n      \"ewo_low\": -20.988,\n      \"low_offset\": 0.975,\n      \"low_offset_2\": 0.955,\n      \"rsi_buy\": 60,\n      \"rsi_buy_2\": 45\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\n\nclass RalliV1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.04,\n        \"40\": 0.032,\n        \"87\": 0.018,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.3\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)        \n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)       \n    \n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_buy_2 = IntParameter(30, 70, default=buy_params['rsi_buy_2'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['rsi'] < 45 ) and (last_candle['hma_50'] > last_candle['ema_100']): #*1.2\n                    return False\n        return True\n    \n    use_custom_stoploss = True\n    \n    def custom_stoploss(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                        current_profit: float, **kwargs) -> float:\n        df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        candle = df.iloc[-1].squeeze()\n        \n        if current_profit < 0.001 and current_time - timedelta(minutes=140) > trade.open_date_utc:\n            return -0.005\n\n        return 1\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['hma_9'] = qtpylib.hull_moving_average(dataframe['close'], window=9)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)          \n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['ema_9'] = ta.EMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        \n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] < dataframe['ema_100'])&\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy_2.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            )\n        )\n        \n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] < dataframe['ema_100'])&\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy_2.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n            )\n        )        \n\n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] < dataframe['ema_100'])&\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) \n            )\n        )\n        \n\n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] > dataframe['ema_100'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            )\n        )\n        \n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] > dataframe['ema_100'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n            )\n        )        \n\n        conditions.append(\n            (   (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] > dataframe['ema_100'])&\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) \n            )\n        )\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['hma_50']>dataframe['ema_100'])&\n                (dataframe['close']>dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )\n            |\n            (   \n                (dataframe['close']<dataframe['ema_100'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])       \n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/RalliV1_disable56/RalliV1_disable56.py",
    "content": "# --- Do not remove these libs ---\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# @Rallipanos\n\n# Buy hyperspace params:\nbuy_params = {\n      \"base_nb_candles_buy\": 14,\n      \"ewo_high\": 2.327,\n      \"ewo_high_2\": -2.327,\n      \"ewo_low\": -20.988,\n      \"low_offset\": 0.975,\n      \"low_offset_2\": 0.955,\n      \"rsi_buy\": 60,\n      \"rsi_buy_2\": 45\n    }\n\n# Sell hyperspace params:\nsell_params = {\n      \"base_nb_candles_sell\": 24,\n      \"high_offset\": 0.991,\n      \"high_offset_2\": 0.997\n    }\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n\n\nclass RalliV1_disable56(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.04,\n        \"40\": 0.032,\n        \"87\": 0.018,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.3\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    low_offset_2 = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)        \n    high_offset = DecimalParameter(\n        0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2 = DecimalParameter(\n        0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)        \n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n\n    ewo_high_2 = DecimalParameter(\n        -6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)       \n    \n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    rsi_buy_2 = IntParameter(30, 70, default=buy_params['rsi_buy_2'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.03\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['rsi'] < 45 ) and (last_candle['hma_50'] > last_candle['ema_100']): #*1.2\n                    return False\n        return True\n    \n    use_custom_stoploss = True\n    \n    def custom_stoploss(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\n                        current_profit: float, **kwargs) -> float:\n        df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        candle = df.iloc[-1].squeeze()\n        \n        if current_profit < 0.001 and current_time - timedelta(minutes=140) > trade.open_date_utc:\n            return -0.005\n\n        return 1\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n        \n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n        dataframe['hma_9'] = qtpylib.hull_moving_average(dataframe['close'], window=9)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)          \n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n        dataframe['ema_9'] = ta.EMA(dataframe, timeperiod=9)\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        \n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] < dataframe['ema_100'])&\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy_2.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            )\n        )\n        \n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] < dataframe['ema_100'])&\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n                (dataframe['EWO'] > self.ewo_high_2.value) &\n                (dataframe['rsi'] < self.rsi_buy_2.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n                (dataframe['rsi']<25)\n            )\n        )        \n\n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] < dataframe['ema_100'])&\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\n                (dataframe['rsi_fast'] < 35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) \n            )\n        )\n        \n\n        conditions.append(\n            (   \n                (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] > dataframe['ema_100'])&\n                (dataframe['rsi_fast'] <35)&\n                (dataframe['rsi_fast'] >4)&\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)&\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\n            )\n        )\n        \n        # conditions.append(\n        #     (   \n        #         (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] > dataframe['ema_100'])&\n        #         (dataframe['rsi_fast'] <35)&\n        #         (dataframe['rsi_fast'] >4)&\n        #         (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\n        #         (dataframe['EWO'] > self.ewo_high_2.value) &\n        #         (dataframe['rsi'] < self.rsi_buy.value) &\n        #         (dataframe['volume'] > 0)&\n        #         (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\n        #         (dataframe['rsi']<25)\n        #     )\n        # )        \n\n        # conditions.append(\n        #     (   (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] > dataframe['ema_100'])&\n        #         (dataframe['rsi_fast'] < 35)&\n        #         (dataframe['rsi_fast'] >4)&\n        #         (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n        #         (dataframe['EWO'] < self.ewo_low.value) &\n        #         (dataframe['volume'] > 0)&\n        #         (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) \n        #     )\n        # )\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (   (dataframe['hma_50']>dataframe['ema_100'])&\n                (dataframe['close']>dataframe['sma_9'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])\n            )\n            |\n            (   \n                (dataframe['close']<dataframe['ema_100'])&\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)&\n                (dataframe['rsi_fast']>dataframe['rsi_slow'])       \n            )    \n            \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/RaposaDivergenceV1/RaposaDivergenceV1.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\n\npd.options.mode.chained_assignment = None\nfrom collections import deque\n\nimport talib.abstract as ta\nfrom freqtrade.strategy import IntParameter, IStrategy\nfrom pandas import DataFrame\nfrom scipy.signal import argrelextrema\n\n\nclass RaposaDivergenceV1(IStrategy):\n    \"\"\"\n    Divergence strategy\n    - By alb#1349\n\n    NOTES:\n    - \"argrelextrema\" might have look-ahead bias so results in backtest will not be reliable\n    - sell signal seems like garbage\n\n    Based on:\n    - https://raposa.trade/higher-highs-calculate-python/\n    - https://medium.com/raposa-technologies/test-and-trade-rsi-divergence-in-python-34a11c1c4142\n\n    \"\"\"\n\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"k_value\": 2,\n        \"order\": 5,\n        \"rsi_buy\": 50,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"rsi_sell\": 50,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.15,\n        \"60\": 0.02,\n        \"120\": 0.01,\n        \"180\": 0.001\n    }\n\n    # Stoploss:\n    stoploss = -0.3\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count = 40\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    rsi_buy = IntParameter(20, 80, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    order = IntParameter(1, 32, default=buy_params['order'], space='buy', optimize=True)\n    k_value = IntParameter(1, 32, default=buy_params['k_value'], space='buy', optimize=True)\n\n    rsi_sell = IntParameter(20, 80, default=sell_params['rsi_sell'], space='sell', optimize=True)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n\n        dataframe = getPeaks(dataframe, key='close', order=int(self.order.value), K=int(self.k_value.value))\n        dataframe = getPeaks(dataframe, key='rsi', order=int(self.order.value), K=int(self.k_value.value))\n\n        dataframe.loc[\n            (\n                (dataframe['close_lows'] == -1) &\n                (dataframe['rsi_lows'] == -1) &\n                (dataframe['rsi'] < int(self.rsi_buy.value)) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close_highs'] == 1) &\n                (dataframe['rsi_highs'] == -1) &\n                (dataframe['rsi'] > int(self.rsi_sell.value)) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n\ndef getHigherLows(data: np.array, order=5, K=2):\n    \"\"\"\n    Finds consecutive higher lows in price pattern.\n    Must not be exceeded within the number of periods indicated by the width\n    parameter for the value to be confirmed.\n    K determines how many consecutive lows need to be higher.\n    \"\"\"\n    # Get lows\n    low_idx = argrelextrema(data, np.less, order=order)[0]\n    lows = data[low_idx]\n    # Ensure consecutive lows are higher than previous lows\n    extrema = []\n    ex_deque = deque(maxlen=K)\n    for i, idx in enumerate(low_idx):\n        if i == 0:\n            ex_deque.append(idx)\n            continue\n        if lows[i] < lows[i-1]:\n            ex_deque.clear()\n\n        ex_deque.append(idx)\n        if len(ex_deque) == K:\n            extrema.append(ex_deque.copy())\n\n    return extrema\n\ndef getLowerHighs(data: np.array, order=5, K=2):\n    \"\"\"\n    Finds consecutive lower highs in price pattern.\n    Must not be exceeded within the number of periods indicated by the width\n    parameter for the value to be confirmed.\n    K determines how many consecutive highs need to be lower.\n    \"\"\"\n    # Get highs\n    high_idx = argrelextrema(data, np.greater, order=order)[0]\n    highs = data[high_idx]\n    # Ensure consecutive highs are lower than previous highs\n    extrema = []\n    ex_deque = deque(maxlen=K)\n    for i, idx in enumerate(high_idx):\n        if i == 0:\n            ex_deque.append(idx)\n            continue\n        if highs[i] > highs[i-1]:\n            ex_deque.clear()\n\n        ex_deque.append(idx)\n        if len(ex_deque) == K:\n            extrema.append(ex_deque.copy())\n\n    return extrema\n\ndef getHigherHighs(data: np.array, order=5, K=2):\n    \"\"\"\n    Finds consecutive higher highs in price pattern.\n    Must not be exceeded within the number of periods indicated by the width\n    parameter for the value to be confirmed.\n    K determines how many consecutive highs need to be higher.\n    \"\"\"\n    # Get highs\n    high_idx = argrelextrema(data, np.greater, order=5)[0]\n    highs = data[high_idx]\n    # Ensure consecutive highs are higher than previous highs\n    extrema = []\n    ex_deque = deque(maxlen=K)\n    for i, idx in enumerate(high_idx):\n        if i == 0:\n            ex_deque.append(idx)\n            continue\n        if highs[i] < highs[i-1]:\n            ex_deque.clear()\n\n        ex_deque.append(idx)\n        if len(ex_deque) == K:\n            extrema.append(ex_deque.copy())\n\n    return extrema\n\ndef getLowerLows(data: np.array, order=5, K=2):\n    \"\"\"\n    Finds consecutive lower lows in price pattern.\n    Must not be exceeded within the number of periods indicated by the width\n    parameter for the value to be confirmed.\n    K determines how many consecutive lows need to be lower.\n    \"\"\"\n    # Get lows\n    low_idx = argrelextrema(data, np.less, order=order)[0]\n    lows = data[low_idx]\n    # Ensure consecutive lows are lower than previous lows\n    extrema = []\n    ex_deque = deque(maxlen=K)\n    for i, idx in enumerate(low_idx):\n        if i == 0:\n            ex_deque.append(idx)\n            continue\n        if lows[i] > lows[i-1]:\n            ex_deque.clear()\n\n        ex_deque.append(idx)\n        if len(ex_deque) == K:\n            extrema.append(ex_deque.copy())\n\n    return extrema\n\ndef getHHIndex(data: np.array, order=5, K=2):\n    extrema = getHigherHighs(data, order, K)\n    idx = np.array([i[-1] + order for i in extrema])\n    return idx[np.where(idx<len(data))]\n\ndef getLHIndex(data: np.array, order=5, K=2):\n    extrema = getLowerHighs(data, order, K)\n    idx = np.array([i[-1] + order for i in extrema])\n    return idx[np.where(idx<len(data))]\n\ndef getLLIndex(data: np.array, order=5, K=2):\n    extrema = getLowerLows(data, order, K)\n    idx = np.array([i[-1] + order for i in extrema])\n    return idx[np.where(idx<len(data))]\n\ndef getHLIndex(data: np.array, order=5, K=2):\n    extrema = getHigherLows(data, order, K)\n    idx = np.array([i[-1] + order for i in extrema])\n    return idx[np.where(idx<len(data))]\n\ndef getPeaks(data, key='close', order=5, K=2):\n    vals = data[key].values\n    hh_idx = getHHIndex(vals, order, K)\n    lh_idx = getLHIndex(vals, order, K)\n    ll_idx = getLLIndex(vals, order, K)\n    hl_idx = getHLIndex(vals, order, K)\n    data[f'{key}_highs'] = np.nan\n    data[f'{key}_highs'][hh_idx] = 1\n    data[f'{key}_highs'][lh_idx] = -1\n    data[f'{key}_highs'] = data[f'{key}_highs'].ffill().fillna(0)\n    data[f'{key}_lows'] = np.nan\n    data[f'{key}_lows'][ll_idx] = 1\n    data[f'{key}_lows'][hl_idx] = -1\n    data[f'{key}_lows'] = data[f'{key}_highs'].ffill().fillna(0)\n    return data\n"
  },
  {
    "path": "strategies/ReinforcedAverageStrategy/ReinforcedAverageStrategy.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, merge, DatetimeIndex\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom technical.util import resample_to_interval, resampled_merge\nfrom freqtrade.exchange import timeframe_to_minutes\n\n\nclass ReinforcedAverageStrategy(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n        buys and sells on crossovers - doesn't really perfom that well and its just a proof of concept\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.5\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.2\n\n    # Optimal timeframe for the strategy\n    timeframe = '4h'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = False\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['maShort'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['maMedium'] = ta.EMA(dataframe, timeperiod=21)\n        ##################################################################################\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n        self.resample_interval = timeframe_to_minutes(self.timeframe) * 12\n        dataframe_long = resample_to_interval(dataframe, self.resample_interval)\n        dataframe_long['sma'] = ta.SMA(dataframe_long, timeperiod=50, price='close')\n        dataframe = resampled_merge(dataframe, dataframe_long, fill_na=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['maShort'], dataframe['maMedium']) &\n                (dataframe['close'] > dataframe[f'resample_{self.resample_interval}_sma']) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['maMedium'], dataframe['maShort']) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/ReinforcedQuickie/ReinforcedQuickie.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\nclass ReinforcedQuickie(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    works on new objectify branch!\n\n    idea:\n        only buy on an upward tending market\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # resample factor to establish our general trend. Basically don't buy if a trend is not given\n    resample_factor = 12\n\n    EMA_SHORT_TERM = 5\n    EMA_MEDIUM_TERM = 12\n    EMA_LONG_TERM = 21\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = self.resample(dataframe, self.timeframe, self.resample_factor)\n\n        ##################################################################################\n        # buy and sell indicators\n\n        dataframe['ema_{}'.format(self.EMA_SHORT_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_SHORT_TERM\n        )\n        dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_MEDIUM_TERM\n        )\n        dataframe['ema_{}'.format(self.EMA_LONG_TERM)] = ta.EMA(\n            dataframe, timeperiod=self.EMA_LONG_TERM\n        )\n\n        bollinger = qtpylib.bollinger_bands(\n            qtpylib.typical_price(dataframe), window=20, stds=2\n        )\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['min'] = ta.MIN(dataframe, timeperiod=self.EMA_MEDIUM_TERM)\n        dataframe['max'] = ta.MAX(dataframe, timeperiod=self.EMA_MEDIUM_TERM)\n\n        dataframe['cci'] = ta.CCI(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=7)\n\n        dataframe['average'] = (dataframe['close'] + dataframe['open'] + dataframe['high'] + dataframe['low']) / 4\n\n        ##################################################################################\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (\n                            (\n                                    (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_SHORT_TERM)]) &\n                                    (dataframe['close'] < dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)]) &\n                                    (dataframe['close'] == dataframe['min']) &\n                                    (dataframe['close'] <= dataframe['bb_lowerband'])\n                            )\n                            |\n                            # simple v bottom shape (lopsided to the left to increase reactivity)\n                            # which has to be below a very slow average\n                            # this pattern only catches a few, but normally very good buy points\n                            (\n                                    (dataframe['average'].shift(5) > dataframe['average'].shift(4))\n                                    & (dataframe['average'].shift(4) > dataframe['average'].shift(3))\n                                    & (dataframe['average'].shift(3) > dataframe['average'].shift(2))\n                                    & (dataframe['average'].shift(2) > dataframe['average'].shift(1))\n                                    & (dataframe['average'].shift(1) < dataframe['average'].shift(0))\n                                    & (dataframe['low'].shift(1) < dataframe['bb_middleband'])\n                                    & (dataframe['cci'].shift(1) < -100)\n                                    & (dataframe['rsi'].shift(1) < 30)\n                                    & (dataframe['mfi'].shift(1) < 30)\n\n                            )\n                    )\n                    # safeguard against down trending markets and a pump and dump\n                    &\n                    (\n                            (dataframe['volume'] < (dataframe['volume'].rolling(window=30).mean().shift(1) * 20)) &\n                            (dataframe['resample_sma'] < dataframe['close']) &\n                            (dataframe['resample_sma'].shift(1) < dataframe['resample_sma'])\n                    )\n            )\n            ,\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                    (dataframe['close'] > dataframe['ema_{}'.format(self.EMA_SHORT_TERM)]) &\n                    (dataframe['close'] > dataframe['ema_{}'.format(self.EMA_MEDIUM_TERM)]) &\n                    (dataframe['close'] >= dataframe['max']) &\n                    (dataframe['close'] >= dataframe['bb_upperband']) &\n                    (dataframe['mfi'] > 80)\n            ) |\n\n            # always sell on eight green candles\n            # with a high rsi\n            (\n                    (dataframe['open'] < dataframe['close']) &\n                    (dataframe['open'].shift(1) < dataframe['close'].shift(1)) &\n                    (dataframe['open'].shift(2) < dataframe['close'].shift(2)) &\n                    (dataframe['open'].shift(3) < dataframe['close'].shift(3)) &\n                    (dataframe['open'].shift(4) < dataframe['close'].shift(4)) &\n                    (dataframe['open'].shift(5) < dataframe['close'].shift(5)) &\n                    (dataframe['open'].shift(6) < dataframe['close'].shift(6)) &\n                    (dataframe['open'].shift(7) < dataframe['close'].shift(7)) &\n                    (dataframe['rsi'] > 70)\n            )\n            ,\n            'sell'\n        ] = 1\n        return dataframe\n\n    def resample(self, dataframe, interval, factor):\n        # defines the reinforcement logic\n        # resampled dataframe to establish if we are in an uptrend, downtrend or sideways trend\n        df = dataframe.copy()\n        df = df.set_index(DatetimeIndex(df['date']))\n        ohlc_dict = {\n            'open': 'first',\n            'high': 'max',\n            'low': 'min',\n            'close': 'last'\n        }\n        df = df.resample(str(int(interval[:-1]) * factor) + 'min',\n                         label=\"right\").agg(ohlc_dict).dropna(how='any')\n        df['resample_sma'] = ta.SMA(df, timeperiod=25, price='close')\n        df = df.drop(columns=['open', 'high', 'low', 'close'])\n        df = df.resample(interval[:-1] + 'min')\n        df = df.interpolate(method='time')\n        df['date'] = df.index\n        df.index = range(len(df))\n        dataframe = merge(dataframe, df, on='date', how='left')\n        return dataframe\n"
  },
  {
    "path": "strategies/ReinforcedSmoothScalp/ReinforcedSmoothScalp.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import timeframe_to_minutes\nfrom pandas import DataFrame\nfrom technical.util import resample_to_interval, resampled_merge\nimport numpy  # noqa\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass ReinforcedSmoothScalp(IStrategy):\n    \"\"\"\n        this strategy is based around the idea of generating a lot of potentatils buys and make tiny profits on each trade\n\n        we recommend to have at least 60 parallel trades at any time to cover non avoidable losses\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.02\n    }\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # should not be below 3% loss\n\n    stoploss = -0.1\n    # Optimal timeframe for the strategy\n    # the shorter the better\n    timeframe = '1m'\n\n    # resample factor to establish our general trend. Basically don't buy if a trend is not given\n    resample_factor = 5\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tf_res = timeframe_to_minutes(self.timeframe) * 5\n        df_res = resample_to_interval(dataframe, tf_res)\n        df_res['sma'] = ta.SMA(df_res, 50, price='close')\n        dataframe = resampled_merge(dataframe, df_res, fill_na=True)\n        dataframe['resample_sma'] = dataframe[f'resample_{tf_res}_sma']\n\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=20)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                        (dataframe['open'] < dataframe['ema_low']) &\n                        (dataframe['adx'] > 30) &\n                        (dataframe['mfi'] < 30) &\n                        (\n                                (dataframe['fastk'] < 30) &\n                                (dataframe['fastd'] < 30) &\n                                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                        ) &\n                        (dataframe['resample_sma'] < dataframe['close'])\n                )\n                # |\n                # # try to get some sure things independent of resample\n                # ((dataframe['rsi'] - dataframe['mfi']) < 10) &\n                # (dataframe['mfi'] < 30) &\n                # (dataframe['cci'] < -200)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (\n                            (\n                                (dataframe['open'] >= dataframe['ema_high'])\n\n                            ) |\n                            (\n                                    (qtpylib.crossed_above(dataframe['fastk'], 70)) |\n                                    (qtpylib.crossed_above(dataframe['fastd'], 70))\n\n                            )\n                    ) & (dataframe['cci'] > 100)\n            )\n            ,\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Renko/Renko.py",
    "content": "import talib.abstract as ta\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nimport pandas as pd\nimport numpy as np\n#import pdb \nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy \npd.set_option(\"display.precision\", 10) \n\nclass Renko(IStrategy):\n \n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -100\n\n    timeframe = '15m'    \n    \n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.1\n    ignore_roi_if_buy_signal = True\n \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['ATR'] = ta.ATR(dataframe, timeperiod=5)\n        brick_size = np.mean(dataframe['ATR'])\n        columns = ['date', 'open', 'high', 'low', 'close', 'volume', 'ATR']\n        df = dataframe[columns] \n        cdf = pd.DataFrame(\n            columns=columns,\n            data=[],\n        ) \n        cdf.loc[0] = df.loc[0]\n        close = df.loc[0]['close'] \n        volume = df.loc[0]['volume'] \n        cdf.iloc[0, 1:] = [close - brick_size, close, close - brick_size, close, volume, brick_size]\n        cdf['trend'] = True  \n        columns = ['date', 'open', 'high', 'low', 'close', 'volume', 'ATR', 'trend']\n\n        for index, row in df.iterrows():  \n            if not np.isnan(row['ATR']): brick_size = row['ATR'] \n            close = row['close']\n            date = row['date'] \n            volume = row['volume'] \n            row_p1 = cdf.iloc[-1] \n            trend = row_p1['trend']\n            close_p1 = row_p1['close'] \n            bricks = int(np.nan_to_num((close - close_p1) / brick_size))\n            data = [] \n            if trend and bricks >= 1:\n                for i in range(bricks):\n                    r = [date, close_p1, close_p1 + brick_size, close_p1, close_p1 + brick_size, volume, brick_size, trend]\n                    data.append(r)\n                    close_p1 += brick_size\n            elif trend and bricks <= -2:\n                trend = not trend\n                bricks += 1\n                close_p1 -= brick_size\n                for i in range(abs(bricks)):\n                    r = [date, close_p1, close_p1, close_p1 - brick_size, close_p1 - brick_size, volume, brick_size, trend]\n                    data.append(r)\n                    close_p1 -= brick_size\n            elif not trend and bricks <= -1:\n                for i in range(abs(bricks)):\n                    r = [date, close_p1, close_p1, close_p1 - brick_size, close_p1 - brick_size, volume, brick_size, trend]\n                    data.append(r)\n                    close_p1 -= brick_size\n            elif not trend and bricks >= 2:\n                trend = not trend\n                bricks -= 1\n                close_p1 += brick_size\n                for i in range(abs(bricks)):\n                    r = [date, close_p1, close_p1 + brick_size, close_p1, close_p1 + brick_size, volume, brick_size, trend]\n                    data.append(r)\n                    close_p1 += brick_size\n            else:\n                continue\n\n            sdf = pd.DataFrame(data=data, columns=columns)\n            cdf = pd.concat([cdf, sdf]) \n\n        renko_df = cdf.groupby(['date']).last()\n        renko_df = renko_df.reset_index() \n        renko_df['previous-trend'] = renko_df.trend.shift(1)   \n        renko_df['previous-trend2'] = renko_df.trend.shift(2)   \n\n        return renko_df\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        for index, row in dataframe.iterrows():  \n            if row['previous-trend'] == False and row['trend'] == True:\n                last_row = dataframe.loc[dataframe['date'] == row['date']][-1:] \n                dataframe.loc[dataframe.index== last_row.index.values[0], 'buy'] = 1\n            if row['previous-trend'] == True and row['trend'] == True:\n                last_row = dataframe.loc[dataframe['date'] == row['date']][-1:] \n                dataframe.loc[dataframe.index== last_row.index.values[0], 'buy'] = 1\n            else:\n                last_row = dataframe.loc[dataframe['date'] == row['date']][-1:] \n                dataframe.loc[dataframe.index== last_row.index.values[0], 'sell'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        return dataframe"
  },
  {
    "path": "strategies/RobotradingBody/RobotradingBody.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n   \n    # https://www.tradingview.com/script/zUaR3Vbb-robotrading-body/  \n    # translated for freqtrade: viksal1982  viktors.s@gmail.com\n    #  A timeframe of 4 hours to 1 day\n\n\n\nclass RobotradingBody(IStrategy):\n   \n    INTERFACE_VERSION = 2\n\n   \n    minimal_roi = {\n        \"0\": 0.9\n    }\n\n \n    stoploss = -0.99\n\n    for_mult = IntParameter(1, 20, default=3, space='buy', optimize=True)\n    for_sma_length = IntParameter(20, 200, default=100, space='buy', optimize=True)\n\n    trailing_stop = False\n\n    timeframe = '4h'\n\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 100\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n\n    def informative_pairs(self):\n       \n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe['body'] = (dataframe['close'] - dataframe['open']).abs()\n        dataframe['body_sma'] = (ta.SMA(dataframe['body'], timeperiod=int(self.for_sma_length.value))) * int(self.for_mult.value)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['open'] > dataframe['close'] ) &   \n                (dataframe['body'] > dataframe['body_sma'] ) &   \n                (dataframe['volume'] > 0)  \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['open'] ) &   \n                (dataframe['volume'] > 0) \n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/Roth01/Roth01.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Roth01(IStrategy):\n    # Buy hyperspace params:\n    buy_params = {\n        'adx-enabled': False,\n        'adx-value': 31,\n        'cci-enabled': False,\n        'cci-value': -74,\n        'fastd-enabled': False,\n        'fastd-value': 41,\n        'mfi-enabled': True,\n        'mfi-value': 20,\n        'rsi-enabled': False,\n        'rsi-value': 34,\n        'trigger': 'bb_lower'\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-adx-enabled': True,\n        'sell-adx-value': 69,\n        'sell-cci-enabled': False,\n        'sell-cci-value': 60,\n        'sell-fastd-enabled': False,\n        'sell-fastd-value': 77,\n        'sell-mfi-enabled': True,\n        'sell-mfi-value': 92,\n        'sell-rsi-enabled': True,\n        'sell-rsi-value': 75,\n        'sell-trigger': 'sell-bb_upper'\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.14696,\n        \"29\": 0.06698,\n        \"75\": 0.02449,\n        \"181\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.29585\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['cci'] = ta.CCI(dataframe)\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_low'] = bollinger['lower']\n        dataframe['bb_mid'] = bollinger['mid']\n        dataframe['bb_upper'] = bollinger['upper']\n        dataframe['bb_perc'] = (dataframe['close'] - dataframe['bb_low']) / (\n                    dataframe['bb_upper'] - dataframe['bb_low'])\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['mfi'] < 24) &\n                (dataframe['close'] < dataframe['bb_low']) &\n                (dataframe['cci'] <= -57.0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['sar'] > dataframe['close']) &\n                #(dataframe['adx'] > 69) &\n                (dataframe['rsi'] > 75) &\n                (dataframe['close'] > dataframe['bb_upper']) &\n                (dataframe['cci'] >= 83.0) &\n                (dataframe['mfi'] < 92) &\n                (dataframe['sar'])\n                #(dataframe['fastk'] < 51)\n\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Roth03/Roth03.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Roth03(IStrategy):\n\n    #  7205/10000:    499 trades. 251/240/8 Wins/Draws/Losses. Avg profit   0.51%. Median profit   0.01%. Total profit  0.00137449 BTC ( 254.47Î£%). Avg duration 746.7 min. Objective: 0.15177\n\n    # Buy hyperspace params:\n    buy_params = {\n        'adx-enabled': False,\n        'adx-value': 50,\n        'cci-enabled': False,\n        'cci-value': -196,\n        'fastd-enabled': True,\n        'fastd-value': 37,\n        'mfi-enabled': True,\n        'mfi-value': 20,\n        'rsi-enabled': False,\n        'rsi-value': 26,\n        'trigger': 'bb_lower'\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        'sell-adx-enabled': False,\n        'sell-adx-value': 73,\n        'sell-cci-enabled': False,\n        'sell-cci-value': 189,\n        'sell-fastd-enabled': True,\n        'sell-fastd-value': 79,\n        'sell-mfi-enabled': True,\n        'sell-mfi-value': 86,\n        'sell-rsi-enabled': True,\n        'sell-rsi-value': 69,\n        'sell-trigger': 'sell-sar_reversal'\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.24553,\n        \"33\": 0.07203,\n        \"90\": 0.01452,\n        \"111\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.31939\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['cci'] = ta.CCI(dataframe)\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_low'] = bollinger['lower']\n        dataframe['bb_mid'] = bollinger['mid']\n        dataframe['bb_upper'] = bollinger['upper']\n        dataframe['bb_perc'] = (dataframe['close'] - dataframe['bb_low']) / (\n                    dataframe['bb_upper'] - dataframe['bb_low'])\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['bb_low']) &\n                (dataframe['fastd'] > 37) &\n                (dataframe['mfi'] < 20.0)\n                # (dataframe['cci'] <= -57.0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['sar'] > dataframe['close']) &\n                # (dataframe['adx'] > 52) &\n                # (dataframe['cci'] >= 50.0) &\n                # (dataframe['close'] > dataframe['bb_upper'])\n\n                (dataframe['rsi'] > 69) &\n                (dataframe['mfi'] > 86) &\n                (dataframe['fastd'] > 79)\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SAR/SAR.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass Sar(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) /\n        #     dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30\n                (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70\n                (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAIP3/SMAIP3.py",
    "content": "# --- Do not remove these libs ---\n# --------------------------------\n\nfrom datetime import datetime, timedelta\n\nimport talib.abstract as ta\nfrom pandas import DataFrame\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import CategoricalParameter\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\n\n# author @tirail\n\nma_types = {\n    'SMA': ta.SMA,\n    'EMA': ta.EMA,\n}\n\n\nclass SMAIP3(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # hyperopt and paste results here\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 18,\n        \"buy_trigger\": \"SMA\",\n        \"low_offset\": 0.968,\n        \"pair_is_bad_1_threshold\": 0.130,\n        \"pair_is_bad_2_threshold\": 0.075,\n    }\n\n    # #########################################################\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 55,\n        \"high_offset\": 1.07,\n        \"sell_trigger\": \"EMA\",\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.135,\n        \"35\": 0.061,\n        \"86\": 0.037,\n        \"167\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.331\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.098\n    trailing_stop_positive_offset = 0.159\n    trailing_only_offset_is_reached = True\n\n    base_nb_candles_buy = IntParameter(\n        16, 60, default=buy_params['base_nb_candles_buy'], space='buy')\n    base_nb_candles_sell = IntParameter(\n        16, 60, default=sell_params['base_nb_candles_sell'], space='sell')\n    low_offset = DecimalParameter(\n        0.8, 0.99, default=buy_params['low_offset'], space='buy')\n    high_offset = DecimalParameter(\n        0.8, 1.1, default=sell_params['high_offset'], space='sell')\n    buy_trigger = CategoricalParameter(\n        ma_types.keys(), default=buy_params['buy_trigger'], space='buy')\n    sell_trigger = CategoricalParameter(\n        ma_types.keys(), default=sell_params['sell_trigger'], space='sell')\n\n    pair_is_bad_1_threshold = DecimalParameter(\n        0.00, 0.30, default=0.200, space='buy')\n    pair_is_bad_2_threshold = DecimalParameter(\n        0.00, 0.25, default=0.072, space='buy')\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if not self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe,\n                                                                          int(self.base_nb_candles_buy.value)) * self.low_offset.value\n            dataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe,\n                                                                            int(self.base_nb_candles_sell.value)) * self.high_offset.value\n\n            dataframe['pair_is_bad'] = (\n                (((dataframe['open'].shift(12) - dataframe['close']) / dataframe[\n                    'close']) >= self.pair_is_bad_1_threshold.value) |\n                (((dataframe['open'].shift(6) - dataframe['close']) / dataframe[\n                    'close']) >= self.pair_is_bad_2_threshold.value)).astype('int')\n\n            dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n            dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe,\n                                                                          int(self.base_nb_candles_buy.value)) * self.low_offset.value\n            dataframe['pair_is_bad'] = (\n                (((dataframe['open'].shift(12) - dataframe['close']) / dataframe[\n                    'close']) >= self.pair_is_bad_1_threshold.value) |\n                (((dataframe['open'].shift(6) - dataframe['close']) / dataframe[\n                    'close']) >= self.pair_is_bad_2_threshold.value)).astype('int')\n\n            dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n            dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        dataframe.loc[\n            (\n                (dataframe['ema_50'] > dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_200']) &\n                (dataframe['pair_is_bad'] < 1) &\n                (dataframe['close'] < dataframe['ma_offset_buy']) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe,\n                                                                            int(self.base_nb_candles_sell.value)) * self.high_offset.value\n\n        dataframe.loc[\n            (\n                (dataframe['close'] > dataframe['ma_offset_sell']) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAIP3v2/SMAIP3v2.py",
    "content": "# --- Do not remove these libs ---\n# --------------------------------\n\nfrom datetime import datetime, timedelta\n\nimport talib.abstract as ta\nfrom pandas import DataFrame\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import CategoricalParameter\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\n\n# author @tirail\n\nma_types = {\n    'SMA': ta.SMA,\n    'EMA': ta.EMA,\n}\n\n\nclass SMAIP3v2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # hyperopt and paste results here\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 18,\n        \"buy_trigger\": \"SMA\",\n        \"low_offset\": 0.968,\n        \"pair_is_bad_1_threshold\": 0.130,\n        \"pair_is_bad_2_threshold\": 0.075,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 26,\n        \"high_offset\": 0.985,\n        \"sell_trigger\": \"EMA\",\n    }\n\n    # Stoploss:\n    stoploss = -0.23\n#    stoploss = -0.15\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.026\n    }\n\n    base_nb_candles_buy = IntParameter(16, 60, default=buy_params['base_nb_candles_buy'], space='buy')\n    base_nb_candles_sell = IntParameter(16, 60, default=sell_params['base_nb_candles_sell'], space='sell')\n    low_offset = DecimalParameter(0.8, 0.99, default=buy_params['low_offset'], space='buy')\n    high_offset = DecimalParameter(0.8, 1.1, default=sell_params['high_offset'], space='sell')\n    buy_trigger = CategoricalParameter(ma_types.keys(), default=buy_params['buy_trigger'], space='buy')\n    sell_trigger = CategoricalParameter(ma_types.keys(), default=sell_params['sell_trigger'], space='sell')\n\n    pair_is_bad_1_threshold = DecimalParameter(0.00, 0.30, default=0.200, space='buy')\n    pair_is_bad_2_threshold = DecimalParameter(0.00, 0.25, default=0.072, space='buy')\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.003\n    trailing_stop_positive_offset = 0.018\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        previous_candle_1 = dataframe.iloc[-2]\n\n        if (last_candle is not None):\n            if (sell_reason in ['roi','sell_signal','trailing_stop_loss']):\n                if (last_candle['open'] > previous_candle_1['open']) and (last_candle['rsi'] > 50) and (last_candle['rsi'] > previous_candle_1['rsi']):\n                    return False\n        return True\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # confirm_trade_exit\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=2)\n\n        if not self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe,\n                                                                          int(self.base_nb_candles_buy.value)) * self.low_offset.value\n            dataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe,\n                                                                            int(self.base_nb_candles_sell.value)) * self.high_offset.value\n\n            dataframe['pair_is_bad'] = (\n                    (((dataframe['open'].shift(12) - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_1_threshold.value) |\n                    (((dataframe['open'].shift(6) - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_2_threshold.value)).astype('int')\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe,\n                                                                          int(self.base_nb_candles_buy.value)) * self.low_offset.value\n            dataframe['pair_is_bad'] = (\n                    (((dataframe['open'].shift(12) - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_1_threshold.value) |\n                    (((dataframe['open'].shift(6) - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_2_threshold.value)).astype('int')\n\n        dataframe.loc[\n            (\n                    (dataframe['ema_50'] > dataframe['ema_200']) &\n                    (dataframe['close'] > dataframe['ema_200']) &\n                    (dataframe['pair_is_bad'] < 1) &\n                    (dataframe['close'] < dataframe['ma_offset_buy']) &\n                    (dataframe['volume'] > 0)\n#                    & dataframe['btc_up']\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe,\n                                                                            int(self.base_nb_candles_sell.value)) * self.high_offset.value\n\n        dataframe.loc[\n            (\n                    (dataframe['close'] > dataframe['ma_offset_sell']) &\n                    (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOG/SMAOG.py",
    "content": "from datetime import datetime, timedelta\nimport talib.abstract as ta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import CategoricalParameter\nfrom freqtrade.strategy import DecimalParameter, IntParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# og        @tirail\n# author    @Jooopieeert#0239\n\nma_types = {\n    'SMA': ta.SMA,\n    'EMA': ta.EMA,\n}\nclass SMAOG(IStrategy):\n    INTERFACE_VERSION = 2\n    buy_params = {\n        \"base_nb_candles_buy\": 26,\n        \"buy_trigger\": \"SMA\",\n        \"low_offset\": 0.968,\n        \"pair_is_bad_0_threshold\": 0.555,\n        \"pair_is_bad_1_threshold\": 0.172,\n        \"pair_is_bad_2_threshold\": 0.198,\n    }\n    sell_params = {\n        \"base_nb_candles_sell\": 28,\n        \"high_offset\": 0.985,\n        \"sell_trigger\": \"EMA\",\n    }\n    base_nb_candles_buy = IntParameter(16, 45, default=buy_params['base_nb_candles_buy'], space='buy', optimize=False, load=True)\n    base_nb_candles_sell = IntParameter(16, 45, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False, load=True)\n    low_offset = DecimalParameter(0.8, 0.99, default=buy_params['low_offset'], space='buy', optimize=False, load=True)\n    high_offset = DecimalParameter(0.8, 1.1, default=sell_params['high_offset'], space='sell', optimize=False, load=True)\n    buy_trigger = CategoricalParameter(ma_types.keys(), default=buy_params['buy_trigger'], space='buy', optimize=False, load=True)\n    sell_trigger = CategoricalParameter(ma_types.keys(), default=sell_params['sell_trigger'], space='sell', optimize=False, load=True)\n    pair_is_bad_0_threshold = DecimalParameter(0.0, 0.600, default=0.220, space='buy', optimize=True, load=True)\n    pair_is_bad_1_threshold = DecimalParameter(0.0, 0.350, default=0.090, space='buy', optimize=True, load=True)\n    pair_is_bad_2_threshold = DecimalParameter(0.0, 0.200, default=0.060, space='buy', optimize=True, load=True)\n\n    timeframe = '5m'\n    stoploss = -0.23\n    minimal_roi = {\"0\": 10,}\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.02\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    process_only_new_candles = True\n    startup_candle_count = 400\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if not self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe, int(self.base_nb_candles_buy.value)) * self.low_offset.value\n            dataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe, int(self.base_nb_candles_sell.value)) * self.high_offset.value\n            dataframe['pair_is_bad'] = (\n                    (((dataframe['open'].rolling(144).min() - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_0_threshold.value) |\n                    (((dataframe['open'].rolling(12).min() - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_1_threshold.value) |\n                    (((dataframe['open'].rolling(2).min() - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_2_threshold.value)).astype('int')\n            dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n            dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n            dataframe['rsi_exit'] = ta.RSI(dataframe, timeperiod=2)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe, int(self.base_nb_candles_buy.value)) * self.low_offset.value\n            dataframe['pair_is_bad'] = (\n                    (((dataframe['open'].rolling(144).min() - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_0_threshold.value) |\n                    (((dataframe['open'].rolling(12).min() - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_1_threshold.value) |\n                    (((dataframe['open'].rolling(2).min() - dataframe['close']) / dataframe[\n                        'close']) >= self.pair_is_bad_2_threshold.value)).astype('int')\n            dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n            dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        dataframe.loc[\n            (\n                    (dataframe['ema_50'] > dataframe['ema_200']) &\n                    (dataframe['close'] > dataframe['ema_200']) &\n                    (dataframe['pair_is_bad'] < 1) &\n                    (dataframe['close'] < dataframe['ma_offset_buy']) &\n                    (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if self.config['runmode'].value == 'hyperopt':\n            dataframe['ma_offset_sell'] = ta.EMA(dataframe, int(self.base_nb_candles_sell.value)) * self.high_offset.value\n        dataframe.loc[\n            (\n                    (dataframe['close'] > dataframe['ma_offset_sell']) &\n                    (\n                        (dataframe['open'] < dataframe['open'].shift(1)) |\n                        (dataframe['rsi_exit'] < 50) |\n                        (dataframe['rsi_exit'] < dataframe['rsi_exit'].shift(1))\n                    ) &\n                    (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOPv1_TTF/SMAOPv1_TTF.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 16,\n    \"ewo_high\": 5.638,\n    \"ewo_low\": -19.993,\n    \"low_offset\": 0.978,\n    \"rsi_buy\": 61,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 49,\n    \"high_offset\": 1.006,\n}\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOPv1_TTF(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    #TTF\n    ttf_length       = IntParameter(1, 50, default=15)\n    ttf_upperTrigger = IntParameter(1, 400, default=100)\n    ttf_lowerTrigger = IntParameter(1, -400, default=-100)\n\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        #TTF\n        dataframe['ttf'] = ttf(dataframe, int(self.ttf_length.value))\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi'] < self.rsi_buy.value) \n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0) \n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        \n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) \n            )\n        )\n        \n        \n        conditions.append(\n            (\n                \n                (qtpylib.crossed_above(dataframe['ttf'], self.ttf_upperTrigger.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\ndef ttf(df, ttf_length):\n    df = df.copy()\n    high, low = df['high'], df['low']\n    buyPower = high.rolling(ttf_length).max() - low.shift(ttf_length).fillna(99999).rolling(ttf_length).min()\n    sellPower = high.shift(ttf_length).fillna(0).rolling(ttf_length).max() - low.rolling(ttf_length).min()\n    \n    ttf = 200 * (buyPower - sellPower) / (buyPower + sellPower)\n    return ttf\n"
  },
  {
    "path": "strategies/SMAOffset/SMAOffset.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\n\n# author @tirail\n\nma_types = {\n\t'SMA': ta.SMA,\n\t'EMA': ta.EMA,\n}\n\nclass SMAOffset(IStrategy):\n\tINTERFACE_VERSION = 2\n\n\t# hyperopt and paste results here\n\t# Buy hyperspace params:\n\tbuy_params = {\n\t\t\"base_nb_candles_buy\": 30,\n\t\t\"buy_trigger\": 'SMA',\n\t\t\"low_offset\": 0.958,\n\t}\n\n\t# Sell hyperspace params:\n\tsell_params = {\n\t\t\"base_nb_candles_sell\": 30,\n\t\t\"high_offset\": 1.012,\n\t\t\"sell_trigger\": 'EMA',\n\t}\n\n\t# Stoploss:\n\tstoploss = -0.5\n\n\t# ROI table:\n\tminimal_roi = {\n\t\t\"0\": 1,\n\t}\n\n\tbase_nb_candles_buy = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy')\n\tbase_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell')\n\tlow_offset = DecimalParameter(0.8, 0.99, default=buy_params['low_offset'], space='buy')\n\thigh_offset = DecimalParameter(0.8, 1.1, default=sell_params['high_offset'], space='sell')\n\tbuy_trigger = CategoricalParameter(ma_types.keys(), default=buy_params['buy_trigger'], space='buy')\n\tsell_trigger = CategoricalParameter(ma_types.keys(), default=sell_params['sell_trigger'], space='sell')\n\n\t# Trailing stop:\n\ttrailing_stop = False\n\ttrailing_stop_positive = 0.0001\n\ttrailing_stop_positive_offset = 0\n\ttrailing_only_offset_is_reached = False\n\n\t# Optimal timeframe for the strategy\n\ttimeframe = '5m'\n\n\tuse_sell_signal = True\n\tsell_profit_only = False\n\n\tprocess_only_new_candles = True\n\tstartup_candle_count = 30\n\n\tplot_config = {\n\t\t'main_plot': {\n\t\t\t'ma_offset_buy': {'color': 'orange'},\n\t\t\t'ma_offset_sell': {'color': 'orange'},\n\t\t},\n\t}\n\n\tuse_custom_stoploss = False\n\n\tdef custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n\t\t\t\t\t\tcurrent_rate: float, current_profit: float, **kwargs) -> float:\n\t\treturn 1\n\n\tdef populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\t\tif not self.config['runmode'].value == 'hyperopt':\n\t\t\tdataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe, int(self.base_nb_candles_buy.value)) * self.low_offset.value\n\t\t\tdataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe, int(self.base_nb_candles_sell.value)) * self.high_offset.value\n\t\treturn dataframe\n\n\tdef populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\t\tif self.config['runmode'].value == 'hyperopt':\n\t\t\tdataframe['ma_offset_buy'] = ma_types[self.buy_trigger.value](dataframe, int(self.base_nb_candles_buy.value)) * self.low_offset.value\n\n\t\tdataframe.loc[\n\t\t\t(\n\t\t\t\t\t(dataframe['close'] < dataframe['ma_offset_buy']) &\n\t\t\t\t\t(dataframe['volume'] > 0)\n\t\t\t),\n\t\t\t'buy'] = 1\n\t\treturn dataframe\n\n\tdef populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\t\tif self.config['runmode'].value == 'hyperopt':\n\t\t\tdataframe['ma_offset_sell'] = ma_types[self.sell_trigger.value](dataframe, int(self.base_nb_candles_sell.value)) * self.high_offset.value\n\n\t\tdataframe.loc[\n\t\t\t(\n\t\t\t\t\t(dataframe['close'] > dataframe['ma_offset_sell']) &\n\t\t\t\t\t(dataframe['volume'] > 0)\n\t\t\t),\n\t\t\t'sell'] = 1\n\t\treturn dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOpt/SMAOffsetProtectOpt.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params: orginal\n# buy_params = {\n#     \"base_nb_candles_buy\": 16,\n#     \"ewo_high\": 5.638,\n#     \"ewo_low\": -19.993,\n#     \"low_offset\": 0.978,\n#     \"rsi_buy\": 61,\n#    \"fast_ewo\": 50,  # value loaded from strategy\n#    \"slow_ewo\": 200,  # value loaded from strategy\n# }\n# Buy hyperspace params: from v0\nbuy_params = {\n    \"base_nb_candles_buy\": 20,\n    \"ewo_high\": 5.499,\n    \"ewo_low\": -19.881,\n    \"low_offset\": 0.975,\n    \"rsi_buy\": 67,\n    \"fast_ewo\": 50,  # value loaded from strategy\n    \"slow_ewo\": 200,  # value loaded from strategy\n\n}\n# Sell hyperspace params:orginal\n# sell_params = {\n#     \"base_nb_candles_sell\": 49,\n#     \"high_offset\": 1.006,\n# }\n# Sell hyperspace params:  from v0\nsell_params = {\n    \"base_nb_candles_sell\": 24,\n    \"high_offset\": 1.012,\n}\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOpt(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.20,\n        \"38\": 0.074,\n        \"78\": 0.025,\n        \"194\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = IntParameter(\n        10, 50, default=buy_params['fast_ewo'], space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=buy_params['slow_ewo'], space='buy', optimize=False)\n    # fast_ewo = 50\n    # slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    # trailing_stop = False\n    # trailing_stop_positive = 0.001\n    # trailing_stop_positive_offset = 0.01\n    # trailing_only_offset_is_reached = True\n\n    # Sell signal\n    # use_sell_signal = True\n    # sell_profit_only = False\n    # sell_profit_offset = 0.01\n    # ignore_roi_if_buy_signal = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 200\n\n    # plot_config = {\n    #     'main_plot': {\n    #         'ma_buy': {'color': 'orange'},\n    #         'ma_sell': {'color': 'orange'},\n    #     },\n    # }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe['ma_buy'] = (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)\n\n        conditions.append(\n            (\n                # (dataframe['close'].shift(1) < dataframe['ma_buy']) &\n                # (dataframe['low'] < dataframe['ma_buy']) &\n                # (dataframe['close'] > dataframe['ma_buy']) &\n                # (qtpylib.crossed_above(dataframe['close'], dataframe['ma_buy'])) &\n                (dataframe['close'] < dataframe['ma_buy']) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                # (dataframe['close'].shift(1) < dataframe['ma_buy']) &\n                # (dataframe['low'] < dataframe['ma_buy']) &\n                # (dataframe['close'] > dataframe['ma_buy']) &\n                # (qtpylib.crossed_above(dataframe['close'], dataframe['ma_buy'])) &\n                (dataframe['close'] < dataframe['ma_buy']) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe['ma_sell']= (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)\n        conditions.append(\n            (\n                #(dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (qtpylib.crossed_below(dataframe['close'], dataframe['ma_sell'])) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOptV0/SMAOffsetProtectOptV0.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n\nSMA = 'SMA'\nEMA = 'EMA'\n\n# Buy hyperspace params:\n#buy_params = {\n#    \"base_nb_candles_buy\": 20,\n#    \"ewo_high\": 6,\n#    \"fast_ewo\": 50,\n#    \"slow_ewo\": 200,\n#    \"low_offset\": 0.958,\n#    \"buy_trigger\": \"EMA\",\n#    \"ewo_high\": 2.0,\n#    \"ewo_low\": -16.062,\n#    \"rsi_buy\": 51,\n#}\n\nbuy_params = {\n    \"base_nb_candles_buy\": 20,\n    \"ewo_high\": 5.499,\n    \"ewo_low\": -19.881,\n    \"low_offset\": 0.975,\n    \"rsi_buy\": 67,\n    \"buy_trigger\": \"EMA\",  # value loaded from strategy\n    \"fast_ewo\": 50,  # value loaded from strategy\n    \"slow_ewo\": 200,  # value loaded from strategy\n    \"buy_trigger\": \"EMA\",\n}\n\n# Sell hyperspace params:\n#sell_params = {\n#    \"base_nb_candles_sell\": 20,\n#    \"high_offset\": 1.012,\n#    \"sell_trigger\": \"EMA\",\n#}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 24,\n    \"high_offset\": 1.012,\n    \"sell_trigger\": \"EMA\",\n}\n\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOptV0(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    buy_trigger = CategoricalParameter(\n        [SMA, EMA], default=buy_params['buy_trigger'], space='buy', optimize=False)\n    sell_trigger = CategoricalParameter(\n        [SMA, EMA], default=sell_params['sell_trigger'], space='sell', optimize=False)\n\n    # Protection\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    fast_ewo = IntParameter(\n        10, 50, default=buy_params['fast_ewo'], space='buy', optimize=False)\n    slow_ewo = IntParameter(\n        100, 200, default=buy_params['slow_ewo'], space='buy', optimize=False)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n    # slow_ema = IntParameter(\n    #     10, 50, default=buy_params['fast_ewo'], space='buy', optimize=True)\n    # fast_ema = IntParameter(\n    #     100, 200, default=buy_params['slow_ewo'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    use_sell_signal = True\n    sell_profit_only = False\n\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_offset_buy': {'color': 'orange'},\n            'ma_offset_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        # EMA\n        informative_pairs['ema_50'] = ta.EMA(informative_pairs, timeperiod=50)\n        informative_pairs['ema_100'] = ta.EMA(informative_pairs, timeperiod=100)\n        informative_pairs['ema_200'] = ta.EMA(informative_pairs, timeperiod=200)\n        # SMA\n        informative_pairs['sma_200'] = ta.SMA(informative_pairs, timeperiod=200)\n        informative_pairs['sma_200_dec'] = informative_pairs['sma_200'] < informative_pairs['sma_200'].shift(\n            20)\n        # RSI\n        informative_pairs['rsi'] = ta.RSI(informative_pairs, timeperiod=14)\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # informative = self.get_informative_indicators(metadata)\n        # dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe,\n        #                                    ffill=True)\n\n        # Calculate all base_nb_candles_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all base_nb_candles_buy values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n\n        # ---------------- original code -------------------\n        ##SMAOffset\n        #if self.buy_trigger.value == 'EMA':\n        #    dataframe['ma_buy'] = ta.EMA(dataframe, timeperiod=self.base_nb_candles_buy.value)\n        #else:\n        #    dataframe['ma_buy'] = ta.SMA(dataframe, timeperiod=self.base_nb_candles_buy.value)\n        #\n        #if self.sell_trigger.value == 'EMA':\n        #    dataframe['ma_sell'] = ta.EMA(dataframe, timeperiod=self.base_nb_candles_sell.value)\n        #else:\n        #    dataframe['ma_sell'] = ta.SMA(dataframe, timeperiod=self.base_nb_candles_sell.value)\n        #\n        #dataframe['ma_offset_buy'] = dataframe['ma_buy'] * self.low_offset.value\n        #dataframe['ma_offset_sell'] = dataframe['ma_sell'] * self.high_offset.value\n        # ------------ end original code --------------------\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo.value, self.slow_ewo.value)\n        \n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        # ---------------- original code -------------------\n        #conditions.append(\n        #    (\n        #        (dataframe['close'] < dataframe['ma_offset_buy']) &\n        #        (dataframe['EWO'] > self.ewo_high.value) &\n        #        (dataframe['rsi'] < self.rsi_buy.value) &\n        #        (dataframe['volume'] > 0)\n        #    )\n        #)\n\n        #conditions.append(\n        #    (\n        #        (dataframe['close'] < dataframe['ma_offset_buy']) &\n        #        (dataframe['EWO'] < self.ewo_low.value) &\n        #        (dataframe['volume'] > 0)\n        #    )\n        #)\n        # ------------ end original code --------------------\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n\n        # ---------------- original code -------------------\n        #conditions.append(\n        #    (\n        #        (dataframe['close'] > dataframe['ma_offset_sell']) &\n        #        (dataframe['volume'] > 0)\n        #    )\n        #)\n        # ------------ end original code --------------------\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOptV1/SMAOffsetProtectOptV1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 16,\n    \"ewo_high\": 5.638,\n    \"ewo_low\": -19.993,\n    \"low_offset\": 0.978,\n    \"rsi_buy\": 61,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 49,\n    \"high_offset\": 1.006,\n}\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOptV1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOptV1HO1/SMAOffsetProtectOptV1HO1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 17,\n    \"ewo_high\": 2.139,\n    \"ewo_low\": -19.767,\n    \"low_offset\": 0.98,\n    \"rsi_buy\": 65,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 17,\n    \"high_offset\": 0.99,\n}\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOptV1HO1(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.114,\n        \"36\": 0.063,\n        \"95\": 0.037,\n        \"157\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOptV1Mod/SMAOffsetProtectOptV1Mod.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n######################################## Warning ########################################\n# You won't get a lot of benefits by simply changing to this strategy                   #\n# with the HyperOpt values changed.                                                     #\n#                                                                                       #\n# You should test it closely, trying backtesting and dry running, and we recommend      #\n# customizing the terms of sale and purchase as well.                                   #\n#                                                                                       #\n# You should always be careful in real trading!                                         #\n#########################################################################################\n\n# Modified Buy / Sell params - 20210619\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 16,\n    \"ewo_high\": 5.672,\n    \"ewo_low\": -19.931,\n    \"low_offset\": 0.973,\n    \"rsi_buy\": 59,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 20,\n    \"high_offset\": 1.010,\n}\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOptV1Mod(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Modified ROI - 20210619\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,\n        \"12\": 0.016,\n        \"37\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count: int = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOptV1Mod2/SMAOffsetProtectOptV1Mod2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n######################################## Warning ########################################\n# You won't get a lot of benefits by simply changing to this strategy                   #\n# with the HyperOpt values changed.                                                     #\n#                                                                                       #\n# You should test it closely, trying backtesting and dry running, and we recommend      #\n# customizing the terms of sale and purchase as well.                                   #\n#                                                                                       #\n# You should always be careful in real trading!                                         #\n#########################################################################################\n\n# Modified Buy / Sell params - 20210619\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 16,\n    \"ewo_high\": 5.672,\n    \"ewo_low\": -19.931,\n    \"low_offset\": 0.973,\n    \"rsi_buy\": 59,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 20,\n    \"high_offset\": 1.010,\n}\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOptV1Mod2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Modified ROI - 20210620\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,\n        \"10\": 0.018,\n        \"30\": 0.010,\n        \"40\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    antipump_threshold = DecimalParameter(0, 0.4, default=0.25, space='buy', optimize=True)\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count: int = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy_16': {'color': 'orange'},\n            'ma_sell_20': {'color': 'purple'},\n        },\n            'pump_strength': {\n                'pump_strength': {'color': 'yellow'}\n            },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        #pump stregth\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        #pump stregth\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\nclass SMAOffsetProtectOptV1Mod2_antipump(SMAOffsetProtectOptV1Mod2):\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (dataframe['pump_strength'] > self.antipump_threshold.value)\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SMAOffsetProtectOptV1_kkeue_20210619/SMAOffsetProtectOptV1_kkeue_20210619.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n######################################## Warning ########################################\n# You won't get a lot of benefits by simply changing to this strategy                   #\n# with the HyperOpt values changed.                                                     #\n#                                                                                       #\n# You should test it closely, trying backtesting and dry running, and we recommend      #\n# customizing the terms of sale and purchase as well.                                   #\n#                                                                                       #\n# You should always be careful in real trading!                                         #\n#########################################################################################\n\n\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    #df = dataframe.copy()\n    ema1 = ta.EMA(dataframe, timeperiod=ema_length)\n    ema2 = ta.EMA(dataframe, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / dataframe['close'] * 100\n    return emadif\n\n\nclass SMAOffsetProtectOptV1_kkeue_20210619(IStrategy):\n    # Modified Buy / Sell params - 20210619\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 16,\n        \"ewo_high\": 5.672,\n        \"ewo_low\": -19.931,\n        \"low_offset\": 0.973,\n        \"rsi_buy\": 59,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 20,\n        \"high_offset\": 1.010,\n    }\n    INTERFACE_VERSION = 2\n\n    # Modified ROI - 20210620\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,\n        \"10\": 0.018,\n        \"30\": 0.010,\n        \"40\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count: int = 30\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n        \n        \nclass SMAOffsetProtectOptV1_1(SMAOffsetProtectOptV1_kkeue_20210619):\n    #Epoch details:\n\n    #271/512:    468 trades. 453/0/15 Wins/Draws/Losses. Avg profit   1.11%. Median profit   1.14%. Total profit  129.62363315 BUSD ( 103.70%). Avg duration 2:07:00 min. Objective: -50137.47104\n\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"base_nb_candles_buy\": 5,\n        \"ewo_high\": 3.944,\n        \"ewo_low\": -12.07,\n        \"low_offset\": 0.987,\n        \"rsi_buy\": 69,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"base_nb_candles_sell\": 53,\n        \"high_offset\": 1.044,\n    }\n\n    # ROI table:  # value loaded from strategy\n    minimal_roi = {\n        \"0\": 0.028,\n        \"10\": 0.018,\n        \"30\": 0.01,\n        \"40\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.5  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = False  # value loaded from strategy\n    trailing_stop_positive = 0.001  # value loaded from strategy\n    trailing_stop_positive_offset = 0.01  # value loaded from strategy\n    trailing_only_offset_is_reached = True  # value loaded from strategy"
  },
  {
    "path": "strategies/SMAOffsetV2/SMAOffsetV2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\n\n\n# thanks tirail for original SMAOffset sharing\n# added trend detection and stoploss\n\n\nclass SMAOffsetV2(IStrategy):\n    minimal_roi = {\n        \"0\": 1,\n    }\n\n    stoploss = -0.20\n    timeframe = '5m'\n    informative_timeframe = '1h'\n    use_sell_signal = True\n    sell_profit_only = False\n    process_only_new_candles = True\n\n    use_custom_stoploss = True\n    startup_candle_count = 200\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if current_time - timedelta(minutes=40) > trade.open_date_utc and current_profit < -0.1:\n            return -0.01\n\n        return -0.99\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    @staticmethod\n    def get_informative_indicators(dataframe: DataFrame, metadata: dict):\n\n        dataframe['ema_fast'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=25)\n\n        dataframe['go_long'] = (\n               (dataframe['ema_fast'] > dataframe['ema_slow'])\n       ).astype('int') * 2\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if not self.dp:\n            return dataframe\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        informative = self.get_informative_indicators(informative.copy(), metadata)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe,\n                                           ffill=True)\n        # don't overwrite the base dataframe's HLCV information\n        skip_columns = [(s + \"_\" + self.informative_timeframe) for s in\n                        ['date', 'open', 'high', 'low', 'close', 'volume']]\n        dataframe.rename(\n            columns=lambda s: s.replace(\"_{}\".format(self.informative_timeframe), \"\") if (not s in skip_columns) else s,\n            inplace=True)\n\n        # ---------------------------------------------------------------------------------\n\n        sma_offset = (1 - 0.04)\n        sma_offset_pos = (1 + 0.012)\n        base_nb_candles = 20\n\n        dataframe['sma_30_offset'] = ta.SMA(dataframe, timeperiod=base_nb_candles) * sma_offset\n        dataframe['sma_30_offset_pos'] = ta.SMA(dataframe, timeperiod=base_nb_candles) * sma_offset_pos\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['go_long'] > 0)\n                &\n                (dataframe['close'] < dataframe['sma_30_offset'])\n                &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    (dataframe['go_long'] == 0)\n                    |\n                    (dataframe['close'] > dataframe['sma_30_offset_pos'])\n                )\n                &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n\n    plot_config = {\n        'main_plot': {\n            'sma_30_offset': {'color': 'orange'},\n            'sma_30_offset_pos': {'color': 'orange'},\n            'ema_fast': {'color': 'blue'},\n            'ema_slow': {'color': 'green'},\n        },\n    }\n"
  },
  {
    "path": "strategies/SMA_BBRSI/SMA_BBRSI.py",
    "content": "# -*- coding: utf-8 -*-\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, Series\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\nimport math\nimport pandas_ta as pta\n\n######################################## Warning ########################################\n# You won't get a lot of benefits by simply changing to this strategy                   #\n# with the HyperOpt values changed.                                                     #\n#                                                                                       #\n# You should test it closely, trying backtesting and dry running, and we recommend      #\n# customizing the terms of sale and purchase as well.                                   #\n#                                                                                       #\n# You should always be careful in real trading!                                         #\n#########################################################################################\n\n# Modified Buy / Sell params - 20210619\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 16,\n    \"ewo_high\": 5.672,\n    \"ewo_low\": -19.931,\n    \"low_offset\": 0.973,\n    \"rsi_buy\": 59,\n    \"ewo_high_bb\": 4.86,\n    \"for_ma_length\": 22,\n    \"for_sigma\": 1.74,\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 20,\n    \"high_offset\": 1.010,\n    \"pHSL\": -0.178,\n    \"pPF_1\": 0.01,\n    \"pPF_2\": 0.048,\n    \"pSL_1\": 0.009,\n    \"pSL_2\": 0.043,\n    \"for_ma_length_sell\": 65,\n    \"for_sigma_sell\": 1.895,\n    \"rsi_high\": 72,\n}\n\n# Volume Weighted Moving Average\ndef vwma(dataframe: DataFrame, length: int = 10):\n    \"\"\"Indicator: Volume Weighted Moving Average (VWMA)\"\"\"\n    # Calculate Result\n    pv = dataframe['close'] * dataframe['volume']\n    vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))\n    return vwma\n\n\n# Modified Elder Ray Index\ndef moderi(dataframe: DataFrame, len_slow_ma: int = 32) -> Series:\n    slow_ma = Series(ta.EMA(vwma(dataframe, length=len_slow_ma), timeperiod=len_slow_ma))\n    return slow_ma >= slow_ma.shift(1)  # we just need true & false for ERI trend\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\n\nclass SMA_BBRSI(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # Modified ROI - 20210620\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.028,\n        \"10\": 0.018,\n        \"30\": 0.010,\n        \"40\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.5\n\n    antipump_threshold = DecimalParameter(0, 0.4, default=0.25, space='buy', optimize=True)\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.01\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count: int = 200\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy_16': {'color': 'orange'},\n            'ma_sell_20': {'color': 'purple'},\n        },\n            'pump_strength': {\n                'pump_strength': {'color': 'yellow'}\n            },\n    }\n\n    protections = [\n        #   {\n        #       \"method\": \"StoplossGuard\",\n        #       \"lookback_period_candles\": 12,\n        #       \"trade_limit\": 1,\n        #       \"stop_duration_candles\": 6,\n        #       \"only_per_pair\": True\n        #   },\n        #   {\n        #       \"method\": \"StoplossGuard\",\n        #       \"lookback_period_candles\": 12,\n        #       \"trade_limit\": 2,\n        #       \"stop_duration_candles\": 6,\n        #       \"only_per_pair\": False\n        #   },\n        {\n            \"method\": \"LowProfitPairs\",\n            \"lookback_period_candles\": 60,\n            \"trade_limit\": 1,\n            \"stop_duration\": 60,\n            \"required_profit\": -0.05\n        },\n        {\n            \"method\": \"MaxDrawdown\",\n            \"lookback_period_candles\": 24,\n            \"trade_limit\": 1,\n            \"stop_duration_candles\": 12,\n            \"max_allowed_drawdown\": 0.2\n        },\n    ]\n\n    ewo_high_bb = DecimalParameter(0, 7.0, default=buy_params['ewo_high_bb'], space='buy', optimize=True)\n    for_sigma = DecimalParameter(0, 10.0, default=buy_params['for_sigma'], space='buy', optimize=True)\n    for_sigma_sell = DecimalParameter(0, 10.0, default=sell_params['for_sigma_sell'], space='sell', optimize=True)\n    rsi_high = IntParameter(60, 100, default=sell_params['rsi_high'], space='sell', optimize=True)\n    for_ma_length = IntParameter(5, 80, default=buy_params['for_ma_length'], space='buy', optimize=True)\n    for_ma_length_sell = IntParameter(5, 80, default=sell_params['for_ma_length_sell'], space='sell', optimize=True)\n\n\n    is_optimize_trailing = True\n    pHSL = DecimalParameter(-0.200, -0.040, default=-0.08, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', optimize=is_optimize_trailing , load=True)\n\n    use_custom_stoploss = True\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # //@version=3\n        # study(\" RSI + BB (EMA) + Dispersion (2.0)\", overlay=false)\n        #\n        # // Инициализация параметров\n        # src = input(title=\"Source\", type=source, defval=close) // Устанавливаем тип цены для расчетов\n        src = 'close'\n        # for_rsi = input(title=\"RSI_period\", type=integer, defval=14) // Период для RSI\n        for_rsi = 14\n        # for_ma = input(title=\"Basis_BB\", type=integer, defval=20) // Период для MA внутри BB\n        # for_ma = 20\n        # for_mult = input(title=\"Stdev\", type=integer, defval=2, minval=1, maxval=5) // Число стандартных отклонений для BB\n        for_mult = 2\n        # for_sigma = input(title=\"Dispersion\", type=float, defval=0.1, minval=0.01, maxval=1) // Дисперсия вокруг MA\n        for_sigma = 0.1\n        #\n        # // Условия работы скрипта\n        # current_rsi = rsi(src, for_rsi) // Текущее положение индикатора RSI\n        dataframe['rsi'] = ta.RSI(dataframe[src], for_rsi)\n        dataframe['rsi_4'] = ta.RSI(dataframe[src], 4)\n        if self.config['runmode'].value == 'hyperopt':\n            for for_ma in range(5, 81):\n                # basis = ema(current_rsi, for_ma)\n                dataframe[f'basis_{for_ma}'] = ta.EMA(dataframe['rsi'], for_ma)\n                # dev = for_mult * stdev(current_rsi, for_ma)\n                dataframe[f'dev_{for_ma}'] = ta.STDDEV(dataframe['rsi'], for_ma)\n                # upper = basis + dev\n                #dataframe[f'upper_{for_ma}'] = (dataframe[f'basis_{for_ma}'] + (dataframe[f'dev_{for_ma}'] * for_mult))\n                # lower = basis - dev\n                #dataframe[f'lower_{for_ma}'] = dataframe[f'basis_{for_ma}'] - (dataframe[f'dev_{for_ma}'] * for_mult)\n                # disp_up = basis + ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (сверху)\n                # dataframe[f'disp_up_{for_ma}'] = dataframe[f'basis_{for_ma}'] + ((dataframe[f'upper_{for_ma}'] - dataframe[f'lower_{for_ma}']) * for_sigma)\n                # disp_down = basis - ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (снизу)\n                # dataframe[f'disp_down_{for_ma}'] = dataframe[f'basis_{for_ma}'] - ((dataframe[f'upper_{for_ma}'] - dataframe[f'lower_{for_ma}']) * for_sigma)\n                # color_rsi = current_rsi >= disp_up ? lime : current_rsi <= disp_down ? red : #ffea00 // Текущий цвет RSI, в зависимости от его местоположения внутри BB\n        else:\n            dataframe[f'basis_{self.for_ma_length.value}'] = ta.EMA(dataframe['rsi'], self.for_ma_length.value)\n            dataframe[f'basis_{self.for_ma_length_sell.value}'] = ta.EMA(dataframe['rsi'], self.for_ma_length_sell.value)\n            # dev = for_mult * stdev(current_rsi, for_ma)\n            dataframe[f'dev_{self.for_ma_length.value}'] = ta.STDDEV(dataframe['rsi'], self.for_ma_length.value)\n            dataframe[f'dev_{self.for_ma_length_sell.value}'] = ta.STDDEV(dataframe['rsi'], self.for_ma_length_sell.value)\n\n        #\n        # // Дополнительные линии и заливка для областей для RSI\n        # h1 = hline(70, color=#d4d4d4, linestyle=dotted, linewidth=1)\n        h1 = 70\n        # h2 = hline(30, color=#d4d4d4, linestyle=dotted, linewidth=1)\n        h2 = 30\n        # fill (h1, h2, transp=95)\n        #\n        # // Алерты и условия срабатывания\n        # rsi_Green = crossover(current_rsi, disp_up)\n        # rsi_Red = crossunder(current_rsi, disp_down)\n\n        # alertcondition(condition=rsi_Green,\n        #      title=\"RSI cross Above Dispersion Area\",\n        #      message=\"The RSI line closing crossed above the Dispersion area.\")\n        #\n        # alertcondition(condition=rsi_Red,\n        #      title=\"RSI cross Under Dispersion Area\",\n        #      message=\"The RSI line closing crossed below the Dispersion area\")\n        #\n        # // Результаты и покраска\n        # plot(basis, color=black)\n        # plot(upper, color=#00fff0, linewidth=2)\n        # plot(lower, color=#00fff0, linewidth=2)\n        # s1 = plot(disp_up, color=white)\n        # s2 = plot(disp_down, color=white)\n        # fill(s1, s2, color=white, transp=80)\n        # plot(current_rsi, color=color_rsi, linewidth=2)\n\n        #ATR\n        dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)\n        dataframe['atr_high'] = (dataframe['high'] - (dataframe['atr'] * 3.5)).rolling(2).max()\n        dataframe['ema_atr'] = ta.EMA(dataframe['atr'], timeperiod=14)\n\n#        #HLC3\n#        dataframe['hlc3'] = (dataframe['high'] + dataframe['low'] + dataframe['close']) / 3\n\n#        #OTF\n#        dataframe['hlc3OTF'] = OTF(dataframe, source='close')\n\n#        #ZLEMA BUY\n#        dataframe['zlema_1'] = dataframe['hlc3OTF']\n#        dataframe['zlema_1_std'] =  dataframe['close']\n#        dataframe['ema_data'] = dataframe['hlc3OTF']  + (dataframe['hlc3OTF']  - dataframe['hlc3OTF'].shift(2))\n#        dataframe['ema_data_2'] = dataframe['hlc3OTF']  + (dataframe['hlc3OTF']  - dataframe['hlc3OTF'].shift(1))\n#        dataframe['zlema_4'] = ta.EMA(dataframe['ema_data'], timeperiod = 4)\n#        dataframe['zlema_2'] = ta.EMA(dataframe['ema_data_2'], timeperiod = 2)\n#        dataframe['ema_data_4_std'] = dataframe['close']  + (dataframe['close']  - dataframe['close'].shift(2))\n#        dataframe['zlema_4_std'] = ta.EMA(dataframe['ema_data_4_std'], timeperiod = 4)\n\n        # Modified Elder Ray Index\n        dataframe['moderi_96'] = moderi(dataframe, 96)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        #CCI\n        dataframe['cci_slow'] = pta.cci(high=dataframe['high'], low=dataframe['low'], close=dataframe['close'], length=240)\n        dataframe['cci_fast'] = pta.cci(high=dataframe['high'], low=dataframe['low'], close=dataframe['close'], length=20)\n\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n\n        #pump stregth\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dont_buy_conditions = []\n\n        dont_buy_conditions.append(\n            (dataframe['pump_strength'] > self.antipump_threshold.value)\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['rsi'] < (dataframe[f'basis_{self.for_ma_length.value}'] - (dataframe[f'dev_{self.for_ma_length.value}'] * self.for_sigma.value)))\n                &\n                (\n                    (\n                        (dataframe['EWO'] > self.ewo_high_bb.value)\n                        &\n                        (dataframe['EWO'] < 10)\n                    )\n                    |\n                    (\n                        (dataframe['EWO'] >= 10)\n                        &\n                        (dataframe['rsi'] < 40)\n                    )\n                )\n                &\n                (dataframe['rsi_4'] < 25)\n                &\n                (dataframe['volume'] > 0)\n                &\n                (dataframe['cci_fast'] < 100)\n#                &\n#                (qtpylib.crossed_above(dataframe['hlc3OTF'], dataframe['zlema_4']))\n                # &\n                # (dataframe[\"roc_bbwidth_max\"] < 70)\n            ) & (dataframe['moderi_96'] == True)\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        if dont_buy_conditions:\n            for condition in dont_buy_conditions:\n                dataframe.loc[condition, 'buy'] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (((\n                    (dataframe['rsi'] > self.rsi_high.value) |\n                    # upper = basis + dev\n                    # lower = basis - dev\n                    # disp_down = basis - ((upper - lower) * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (снизу)\n                    # disp_down = basis - ((2* dev * for_sigma) // Минимально-допустимый порог в области мувинга, который должен преодолеть RSI (снизу)\n                    (dataframe['rsi'] > dataframe[f'basis_{self.for_ma_length_sell.value}'] + ((dataframe[f'dev_{self.for_ma_length_sell.value}'] * self.for_sigma_sell.value)))\n                ) & (dataframe['moderi_96'] == True)) |\n                (\n                    (qtpylib.crossed_below(dataframe['close'], dataframe['atr_high']))\n                ))&\n                (dataframe['volume'] > 0)\n\n            )\n\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SRsi/SRsi.py",
    "content": "import talib.abstract as ta\nfrom pandas import DataFrame\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\n\nclass SRsi(IStrategy):\n\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.012\n    }\n\n    stoploss = -0.15\n\n    timeframe = '1m'\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    startup_candle_count: int = 120\n\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def informative_pairs(self):\n\n        return []\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        p = 14\n        d = 3\n        k = 3\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=30)\n        srsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(p).min()) / (dataframe['rsi'].rolling(p).max() - dataframe['rsi'].rolling(p).min())\n        dataframe['k'] = srsi.rolling(k).mean() * 100\n        dataframe['d'] = dataframe['k'].rolling(d).mean()\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n        (\n                (dataframe['k'] < 15) &\n                (dataframe['k'] >= dataframe['d'])\n                \n\t    ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['k'] > 75) &\n                (dataframe['d'] >= dataframe['k'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/STRATEGY_RSI_BB_BOUNDS_CROSS/STRATEGY_RSI_BB_BOUNDS_CROSS.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n_trend_length = 14\n_bb_smooth_length=4\n\ndef iff(a,b,c):\n    if a:\n        return b\n    else:\n        return c\n\nclass STRATEGY_RSI_BB_BOUNDS_CROSS(IStrategy):\n    \"\"\"\n    Strategy RSI_BB_BOUNDS_CROSS\n    author@: Fractate_Dev\n    github@: https://github.com/Fractate/freqbot\n    How to use it?\n    > python3 ./freqtrade/main.py -s RSI_BB_BOUNDS_CROSS\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n            'bb_ub': {'color': 'green'},\n            'bb_lb': {'color': 'green'},\n            'bb_lb_smoothed': {'color': 'red'},\n            'rsi_ub': {'color': 'black'},\n            'rsi_lb': {'color': 'black'},\n            'rsi_lb_smoothed': {'color': 'orange'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            # \"MACD\": {\n            #     'macd': {'color': 'blue'},\n            #     'macdsignal': {'color': 'orange'},\n            # },\n            # \"BB\": {\n            #     'bb_percent': {'color': 'red'},\n            #     '1': {},\n            #     '0': {},\n            # },\n            # \"RSI\": {\n            #     'rsi': {'color': 'red'},\n            #     '70': {},\n            #     '30': {},\n            # },\n            # \"RSI_Percent\": {\n            #     'rsi_percent': {'color': 'red'},\n            #     '1': {},\n            #     '0': {},\n            # },\n            # \"bb_above\": {\n            #     'bb_above_rsi': {}\n            # },\n            # \"bb_below\": {\n            #     'bb_below_rsi': {}\n            # },\n            # \"bb_minus_rsi_percent\": {\n            #     'bb_minus_rsi_percent': {},\n            #     '0': {},\n            # },\n            \"bb_rsi_count\": {\n                'ub_bb_over_rsi_trend': {},\n                'lb_bb_under_rsi_trend': {},\n            },\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # remove later\n        for i in range(1):\n            print(\"\")\n\n        # Logic\n        # Bollinger Band getting less than RSI should occur after a certain number of candles pass\n        # time frame of 1 hour\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=14, stds=2)\n        dataframe['bb_lb'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_ub'] = bollinger['upper']\n\n        dataframe['bb_lb_smoothed'] = 0\n        for i in range(_bb_smooth_length):\n            dataframe['bb_lb_smoothed'] += dataframe['bb_lb'].shift(i)/_bb_smooth_length\n        \n        dataframe['bb_percent'] = (dataframe['close'] - bollinger['lower']) / (bollinger['upper'] - bollinger['lower'])\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe) # rsi(prices, period \\\\ 14)\n        dataframe['70'] = 70\n        dataframe['30'] = 30\n        dataframe['1'] = 1\n        dataframe['0'] = 0\n        \n        rsi_limit = 30\n        dataframe['rsi_percent'] = (dataframe['rsi'] - rsi_limit) / (100 - rsi_limit * 2)\n\n        # Convert RSI Percentage to actual value in candlestick data\n\n        # ep = 2 * length - 1\n        # auc = ema( max( src - src[1], 0 ), ep )\n        # adc = ema( max( src[1] - src, 0 ), ep )\n        # x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)\n        # ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )\n        # x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)\n        # lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )\n\n        length = 14\n\n        ep = 2 * length - 1\n\n        dataframe.loc[(dataframe['close'] - dataframe['close'].shift(1)) > 0, 'auc1'] = (dataframe['close'] - dataframe['close'].shift(1))\n        dataframe.loc[(dataframe['close'] - dataframe['close'].shift(1)) <= 0, 'auc1'] = 0\n        dataframe['auc'] = ta.EMA(dataframe['auc1'], ep)\n\n        # dataframe['adc'] = ta.EMA(ta.MAX(dataframe['close'].shift(1) - dataframe['close']), ep)\n        dataframe.loc[(dataframe['close'].shift(1) - dataframe['close']) > 0, 'adc1'] = (dataframe['close'].shift(1) - dataframe['close'])\n        dataframe.loc[(dataframe['close'].shift(1) - dataframe['close']) <= 0, 'adc1'] = 0\n        dataframe['adc'] = ta.EMA(dataframe['adc1'], ep)\n\n        dataframe['x1'] = (length - 1) * ( dataframe['adc'] * 70 / (100-70) - dataframe['auc'] )\n        dataframe['x1'] = np.nan_to_num(dataframe['x1'])\n\n        # dataframe['ub'] = iff( dataframe['x1'] >= 0, dataframe['close'] + dataframe['x1'], dataframe['close'] + dataframe['x1'] * (100-70)/70 )\n        dataframe.loc[dataframe['x1'] >= 0, 'rsi_ub'] = dataframe['close'] + dataframe['x1']\n        dataframe.loc[dataframe['x1'] < 0, 'rsi_ub'] = dataframe['close'] + dataframe['x1'] * (100-70)/70\n        \n        dataframe['x2'] = (length - 1) * ( dataframe['adc'] * 30 / (100-30) - dataframe['auc'] )\n        dataframe.loc[dataframe['x2'] >= 0, 'rsi_lb'] = dataframe['close'] + dataframe['x2']\n        dataframe.loc[dataframe['x2'] < 0, 'rsi_lb'] = dataframe['close'] + dataframe['x2'] * (100-30)/30\n        \n        dataframe['rsi_lb_smoothed'] = 0\n        for i in range(_bb_smooth_length):\n            dataframe['rsi_lb_smoothed'] += dataframe['rsi_lb'].shift(i)/_bb_smooth_length\n        \n\n        # auc = ema( max( src - src[1], 0 ), ep )\n        # adc = ema( max( src[1] - src, 0 ), ep )\n        # x1 = (length - 1) * ( adc * obLevel / (100-obLevel) - auc)\n        # ub = iff( x1 >= 0, src + x1, src + x1 * (100-obLevel)/obLevel )\n        # x2 = (length - 1) * ( adc * osLevel / (100-osLevel) - auc)\n        # lb = iff( x2 >= 0, src + x2, src + x2 * (100-osLevel)/osLevel )\n\n\n        dataframe['bb_minus_rsi_percent'] = dataframe['bb_percent'] - dataframe['rsi_percent']\n\n        dataframe['ub_bb_over_rsi'] = dataframe['bb_ub'] > dataframe['rsi_ub']\n        dataframe['lb_bb_under_rsi'] = dataframe['bb_lb'] < dataframe['rsi_lb']\n\n        dataframe['ub_bb_over_rsi_trend'] = True\n        dataframe['lb_bb_under_rsi_trend'] = True\n\n        # Verify RSI positivity or negativity over trend\n        # dataframe['bb_above_rsi_count'] = True\n        # dataframe['bb_below_rsi_count'] = True\n        for i in range(_trend_length):\n            # dataframe['bb_above_rsi_count'] = (dataframe['bb_minus_rsi_percent'].shift(i) > 0) & dataframe['bb_above_rsi_count']\n            # dataframe['bb_below_rsi_count'] = (dataframe['bb_minus_rsi_percent'].shift(i) < 0) & dataframe['bb_below_rsi_count']\n            dataframe['ub_bb_over_rsi_trend'] = dataframe['ub_bb_over_rsi'].shift(i) & dataframe['ub_bb_over_rsi_trend']\n            dataframe['lb_bb_under_rsi_trend'] = dataframe['lb_bb_under_rsi'].shift(i) & dataframe['lb_bb_under_rsi_trend']\n\n        \n\n        dataframe['ema14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema2'] = ta.EMA(dataframe, timeperiod=2)\n                \n        ## old method\n        # bb_above_rsi = False\n        # bb_below_rsi = False\n        # dataframe['bb_above_rsi_count'] = 0\n        # dataframe['bb_below_rsi_count'] = 0\n\n        \n        # for i in range(_trend_length):\n        #     if np.where(dataframe['bb_percent'].shift(i) < dataframe['rsi_percent'].shift(i)):\n        #         dataframe['bb_below_rsi_count'] += 1\n        #     if np.where(dataframe['bb_percent'].shift(i) > dataframe['rsi_percent'].shift(i)):\n        #         dataframe['bb_above_rsi_count'] += 1\n\n\n        # if bb_above_rsi == True & bb_below_rsi == False:\n        # dataframe['bb_above_rsi'] = 1\n        # if bb_above_rsi == False & bb_below_rsi == True:\n        #     dataframe['bb_below_rsi'] = 1\n\n\n        # print(type(dataframe['bb_below_rsi']))\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30\n                # (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                # (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                # (dataframe['volume'] > 0)  # Make sure Volume is not 0\n                # qtpylib.crossed_above(dataframe['bb_lb'], dataframe['rsi_lb']) &\n\n                # if rsi trend has been above or low for a certain amount of time\n                (dataframe['lb_bb_under_rsi_trend']) &\n\n                # # if close is higher than rsi lower bound\n                # (dataframe['close'] > dataframe['rsi_lb']) &\n                # (dataframe['close'].shift(1) < dataframe['rsi_lb'].shift(1)) &\n\n                # if bb lower bound is less than rsi lower bound\n                (dataframe['bb_lb'] < dataframe['rsi_lb']) &\n                (dataframe['bb_lb'].shift(1) < dataframe['rsi_lb'].shift(1)) &\n\n                # # if bb lb is higher than it was before\n                # (dataframe['bb_lb'] > dataframe['bb_lb'].shift(1)) &\n                # (dataframe['bb_lb'].shift(1) < dataframe['bb_lb'].shift(2)) &\n                \n                # if ema2 is rising\n                (dataframe['ema2'] > dataframe['ema2'].shift(1))\n\n                # # dataframes are less than 5 percent, though this shouldn't matter due to ema2 comparison\n                # (dataframe['bb_percent'] < 0.5) & \n                # (dataframe['rsi_percent'] < 0.5)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70\n                # (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                # (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                # (dataframe['volume'] > 0)  # Make sure Volume is not 0\n                # qtpylib.crossed_below(dataframe['bb_percent'], dataframe['rsi_percent']) &\n                # qtpylib.crossed_below(dataframe['bb_ub'], dataframe['rsi_ub']) &\n\n                # (dataframe['close'] < dataframe['rsi_ub']) &\n                # (dataframe['close'].shift(1) > dataframe['rsi_ub'].shift(1)) &\n\n                # (dataframe['bb_ub'] > dataframe['rsi_ub']) &\n                # (dataframe['bb_ub'].shift(1) > dataframe['rsi_ub'].shift(1)) \n\n                # (dataframe['bb_percent'] > 0.5) & \n                # (dataframe['rsi_percent'] > 0.5) &\n                # (dataframe['ub_bb_over_rsi_trend'].shift(1))\n\n                # (qtpylib.crossed_above(dataframe['rsi'], 50))  # Signal: RSI crosses above 70\n                # (qtpylib.crossed_above(dataframe['close'], dataframe['ema14']))  # Signal: RSI crosses above 70\n\n                # if ema2 is falling\n                (dataframe['ema2'] < dataframe['ema2'].shift(1))\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/STRATEGY_RSI_BB_CROSS/STRATEGY_RSI_BB_CROSS.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n_trend_length = 14\n\nclass STRATEGY_RSI_BB_CROSS(IStrategy):\n    \"\"\"\n    Strategy RSI_BB_CROSS\n    author@: Fractate_Dev\n    github@: https://github.com/Fractate/freqbot\n    How to use it?\n    > python3 ./freqtrade/main.py -s RSI_BB_CROSS\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            # \"MACD\": {\n            #     'macd': {'color': 'blue'},\n            #     'macdsignal': {'color': 'orange'},\n            # },\n            \"BB\": {\n                'bb_percent': {'color': 'red'},\n                '1': {},\n                '0': {},\n            },\n            # \"RSI\": {\n            #     'rsi': {'color': 'red'},\n            #     '70': {},\n            #     '30': {},\n            # },\n            \"RSI_Percent\": {\n                'rsi_percent': {'color': 'red'},\n                '1': {},\n                '0': {},\n            },\n            # \"bb_above\": {\n            #     'bb_above_rsi': {}\n            # },\n            # \"bb_below\": {\n            #     'bb_below_rsi': {}\n            # },\n            \"bb_minus_rsi_percent\": {\n                'bb_minus_rsi_percent': {},\n                '0': {},\n            },\n            \"bb_rsi_count\": {\n                'bb_above_rsi_count': {},\n                'bb_below_rsi_count': {},\n            },\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # remove later\n        for i in range(1):\n            print(\"\")\n\n        # Logic\n        # Bollinger Band getting less than RSI should occur after a certain number of candles pass\n        # time frame of 1 hour\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        dataframe['bb_percent'] = (dataframe['close'] - bollinger['lower']) / (bollinger['upper'] - bollinger['lower'])\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['70'] = 70\n        dataframe['30'] = 30\n        dataframe['1'] = 1\n        dataframe['0'] = 0\n\n        rsi_limit = 30\n        dataframe['rsi_percent'] = (dataframe['rsi'] - rsi_limit) / (100 - rsi_limit * 2)\n\n        dataframe['bb_minus_rsi_percent'] = dataframe['bb_percent'] - dataframe['rsi_percent']\n\n        # Verify RSI positivity or negativity over trend\n        dataframe['bb_above_rsi_count'] = True\n        dataframe['bb_below_rsi_count'] = True\n        for i in range(_trend_length):\n            \n            dataframe['bb_above_rsi_count'] = (dataframe['bb_minus_rsi_percent'].shift(i) > 0) & dataframe['bb_above_rsi_count']\n                # dataframe['bb_above_rsi_count'] += 1\n            dataframe['bb_below_rsi_count'] = (dataframe['bb_minus_rsi_percent'].shift(i) < 0) & dataframe['bb_below_rsi_count']\n                # dataframe['bb_below_rsi_count'] += 1\n\n        \n\n                \n        ## old method\n        # bb_above_rsi = False\n        # bb_below_rsi = False\n        # dataframe['bb_above_rsi_count'] = 0\n        # dataframe['bb_below_rsi_count'] = 0\n\n        \n        # for i in range(_trend_length):\n        #     if np.where(dataframe['bb_percent'].shift(i) < dataframe['rsi_percent'].shift(i)):\n        #         dataframe['bb_below_rsi_count'] += 1\n        #     if np.where(dataframe['bb_percent'].shift(i) > dataframe['rsi_percent'].shift(i)):\n        #         dataframe['bb_above_rsi_count'] += 1\n\n\n        # if bb_above_rsi == True & bb_below_rsi == False:\n        # dataframe['bb_above_rsi'] = 1\n        # if bb_above_rsi == False & bb_below_rsi == True:\n        #     dataframe['bb_below_rsi'] = 1\n\n\n        # print(type(dataframe['bb_below_rsi']))\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30\n                # (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                # (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                # (dataframe['volume'] > 0)  # Make sure Volume is not 0\n                qtpylib.crossed_above(dataframe['bb_percent'], dataframe['rsi_percent']) &\n                (dataframe['bb_percent'] < 0.5) & \n                (dataframe['rsi_percent'] < 0.5) &\n                (dataframe['bb_below_rsi_count'].shift(1))\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70\n                # (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                # (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                # (dataframe['volume'] > 0)  # Make sure Volume is not 0\n                qtpylib.crossed_below(dataframe['bb_percent'], dataframe['rsi_percent']) &\n                (dataframe['bb_percent'] > 0.5) & \n                (dataframe['rsi_percent'] > 0.5) &\n                (dataframe['bb_above_rsi_count'].shift(1))\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/SampleStrategy/SampleStrategy.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import (merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, timedelta\nfrom technical.indicators import zema\n\n\n###########################################################################################################\n##                NostalgiaForInfinityV7 by iterativ                                                     ##\n##                                                                                                       ##\n##    Strategy for Freqtrade https://github.com/freqtrade/freqtrade                                      ##\n##                                                                                                       ##\n###########################################################################################################\n##               GENERAL RECOMMENDATIONS                                                                 ##\n##                                                                                                       ##\n##   For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake.        ##\n##   A pairlist with 40 to 80 pairs. Volume pairlist works well.                                         ##\n##   Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs.                            ##\n##   Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc).                    ##\n##   Ensure that you don't override any variables in you config.json. Especially                         ##\n##   the timeframe (must be 5m).                                                                         ##\n##     use_sell_signal must set to true (or not set at all).                                             ##\n##     sell_profit_only must set to false (or not set at all).                                           ##\n##     ignore_roi_if_buy_signal must set to true (or not set at all).                                    ##\n##                                                                                                       ##\n###########################################################################################################\n##               DONATIONS                                                                               ##\n##                                                                                                       ##\n##   Absolutely not required. However, will be accepted as a token of appreciation.                      ##\n##                                                                                                       ##\n##   BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk                                                     ##\n##   ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91                                             ##\n##   BEP20/BSC (ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe                               ##\n##                                                                                                       ##\n###########################################################################################################\n\n\nclass SampleStrategy(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # # ROI table:\n    minimal_roi = {\n        \"0\": 10,\n    }\n\n    stoploss = -0.99\n\n    # Trailing stoploss (not used)\n    trailing_stop = False\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.03\n\n    use_custom_stoploss = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 400\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'trailing_stop_loss': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False\n    }\n\n    #############################################################\n\n    buy_params = {\n        #############\n        # Enable/Disable conditions\n        \"buy_condition_1_enable\": True,\n        \"buy_condition_2_enable\": True,\n        \"buy_condition_3_enable\": True,\n        \"buy_condition_4_enable\": True,\n        \"buy_condition_5_enable\": True,\n        \"buy_condition_6_enable\": True,\n        \"buy_condition_7_enable\": True,\n        \"buy_condition_8_enable\": True,\n        \"buy_condition_9_enable\": True,\n        \"buy_condition_10_enable\": True,\n        \"buy_condition_11_enable\": True,\n        \"buy_condition_12_enable\": True,\n        \"buy_condition_13_enable\": True,\n        \"buy_condition_14_enable\": True,\n        \"buy_condition_15_enable\": True,\n        \"buy_condition_16_enable\": True,\n        \"buy_condition_17_enable\": True,\n        \"buy_condition_18_enable\": True,\n        \"buy_condition_19_enable\": True,\n        \"buy_condition_20_enable\": True,\n        \"buy_condition_21_enable\": True,\n        \"buy_condition_22_enable\": True,\n        \"buy_condition_23_enable\": True,\n        \"buy_condition_24_enable\": True,\n        \"buy_condition_25_enable\": True,\n        \"buy_condition_26_enable\": True,\n        #############\n    }\n\n    sell_params = {\n        #############\n        # Enable/Disable conditions\n        \"sell_condition_1_enable\": True,\n        \"sell_condition_2_enable\": True,\n        \"sell_condition_3_enable\": True,\n        \"sell_condition_4_enable\": True,\n        \"sell_condition_5_enable\": True,\n        \"sell_condition_6_enable\": True,\n        \"sell_condition_7_enable\": True,\n        \"sell_condition_8_enable\": True,\n        #############\n    }\n\n    #############################################################\n    buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"26\", space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"28\", space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_01_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"80\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_01_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_02_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_02_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips                = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_03_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_03_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"40\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"110\", space='buy', optimize=False, load=True)\n    buy_04_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_04_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"20\", space='buy', optimize=False, load=True)\n\n    buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast                 = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow                 = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_05_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_05_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n\n    buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_06_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"20\", space='buy', optimize=False, load=True)\n    buy_06_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_07_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_07_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"12\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_08_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_09_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_10_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_11_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_12_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_12_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"24\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_13_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_14_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"70\", space='buy', optimize=False, load=True)\n    buy_14_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_15_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_15_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_15_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"36\", space='buy', optimize=False, load=True)\n\n    buy_condition_16_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_16_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_16_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_17_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_17_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"120\", space='buy', optimize=False, load=True)\n    buy_17_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_18_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"44\", space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"72\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"60\", space='buy', optimize=False, load=True)\n    buy_18_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_19_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_19_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_19_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_20_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_20_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_20_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_21_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow             = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"90\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_21_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_22_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_22_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_23_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising        = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_23_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_24_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_fast_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow             = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__ema_slow_len         = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_fast_len  = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow      = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__close_above_ema_slow_len  = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising        = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_rising_val    = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising     = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__sma200_1h_rising_val = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"36\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips            = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_dips_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump            = CategoricalParameter([True, False], default=False, space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_type       = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"50\", space='buy', optimize=False, load=True)\n    buy_24_protection__safe_pump_period     = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"24\", space='buy', optimize=False, load=True)\n\n    buy_condition_26_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)\n\n    buy_26_protection__optimize = False\n    buy_26_parameters__optimize = False\n\n    buy_26_protection__ema_fast                 = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_fast_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow                 = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__ema_slow_len             = CategoricalParameter([\"26\",\"50\",\"100\",\"200\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_fast_len = CategoricalParameter([\"12\",\"20\",\"26\",\"50\",\"100\",\"200\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow     = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__close_above_ema_slow_len = CategoricalParameter([\"15\",\"50\",\"200\"], default=\"200\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising            = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_rising_val        = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"30\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising         = CategoricalParameter([True, False], default=False, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__sma200_1h_rising_val     = CategoricalParameter([\"20\",\"30\",\"36\",\"44\",\"50\"], default=\"50\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_dips_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"10\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump                = CategoricalParameter([True, False], default=True, space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_type           = CategoricalParameter([\"10\",\"50\",\"100\"], default=\"100\", space='buy', optimize=buy_26_protection__optimize, load=True)\n    buy_26_protection__safe_pump_period         = CategoricalParameter([\"24\",\"36\",\"48\"], default=\"48\", space='buy', optimize=buy_26_protection__optimize, load=True)\n\n    # Strict dips - level 10\n    buy_dip_threshold_10_1 = DecimalParameter(0.001, 0.05, default=0.015, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_2 = DecimalParameter(0.01, 0.2, default=0.1, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_3 = DecimalParameter(0.1, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_10_4 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 20\n    buy_dip_threshold_20_1 = DecimalParameter(0.001, 0.05, default=0.016, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_2 = DecimalParameter(0.01, 0.2, default=0.11, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_3 = DecimalParameter(0.1, 0.4, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_20_4 = DecimalParameter(0.36, 0.56, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 30\n    buy_dip_threshold_30_1 = DecimalParameter(0.001, 0.05, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_2 = DecimalParameter(0.01, 0.2, default=0.12, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_3 = DecimalParameter(0.1, 0.4, default=0.28, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_30_4 = DecimalParameter(0.36, 0.56, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # Strict dips - level 40\n    buy_dip_threshold_40_1 = DecimalParameter(0.001, 0.05, default=0.019, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_2 = DecimalParameter(0.01, 0.2, default=0.13, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_3 = DecimalParameter(0.1, 0.4, default=0.3, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_40_4 = DecimalParameter(0.36, 0.56, default=0.48, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 50\n    buy_dip_threshold_50_1 = DecimalParameter(0.001, 0.05, default=0.02, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_2 = DecimalParameter(0.01, 0.2, default=0.14, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_3 = DecimalParameter(0.05, 0.4, default=0.32, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_50_4 = DecimalParameter(0.2, 0.5, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 60\n    buy_dip_threshold_60_1 = DecimalParameter(0.001, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_2 = DecimalParameter(0.1, 0.22, default=0.18, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_3 = DecimalParameter(0.2, 0.4, default=0.34, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_60_4 = DecimalParameter(0.4, 0.6, default=0.56, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_70_1 = DecimalParameter(0.001, 0.05, default=0.023, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_2 = DecimalParameter(0.16, 0.28, default=0.2, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_3 = DecimalParameter(0.2, 0.4, default=0.36, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_70_4 = DecimalParameter(0.5, 0.7, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 80\n    buy_dip_threshold_80_1 = DecimalParameter(0.001, 0.05, default=0.024, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_2 = DecimalParameter(0.16, 0.28, default=0.22, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_3 = DecimalParameter(0.2, 0.4, default=0.38, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_80_4 = DecimalParameter(0.5, 0.7, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # Normal dips - level 70\n    buy_dip_threshold_90_1 = DecimalParameter(0.001, 0.05, default=0.025, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_2 = DecimalParameter(0.16, 0.28, default=0.23, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_3 = DecimalParameter(0.3, 0.5, default=0.4, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_90_4 = DecimalParameter(0.6, 0.8, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 100\n    buy_dip_threshold_100_1 = DecimalParameter(0.001, 0.05, default=0.026, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_2 = DecimalParameter(0.16, 0.3, default=0.24, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_3 = DecimalParameter(0.3, 0.5, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_100_4 = DecimalParameter(0.6, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n    # Loose dips - level 110\n    buy_dip_threshold_110_1 = DecimalParameter(0.001, 0.05, default=0.027, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_2 = DecimalParameter(0.16, 0.3, default=0.26, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_3 = DecimalParameter(0.3, 0.5, default=0.44, space='buy', decimals=3, optimize=False, load=True)\n    buy_dip_threshold_110_4 = DecimalParameter(0.6, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 10\n    buy_pump_pull_threshold_10_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_24 = DecimalParameter(0.4, 1.0, default=0.42, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 10\n    buy_pump_pull_threshold_10_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_36 = DecimalParameter(0.4, 1.0, default=0.58, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 10\n    buy_pump_pull_threshold_10_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_10_48 = DecimalParameter(0.4, 1.0, default=0.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 20\n    buy_pump_pull_threshold_20_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_24 = DecimalParameter(0.4, 1.0, default=0.46, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 20\n    buy_pump_pull_threshold_20_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_36 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 20\n    buy_pump_pull_threshold_20_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_20_48 = DecimalParameter(0.4, 1.0, default=0.81, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 30\n    buy_pump_pull_threshold_30_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_24 = DecimalParameter(0.4, 1.0, default=0.5, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 30\n    buy_pump_pull_threshold_30_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_36 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 30\n    buy_pump_pull_threshold_30_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_30_48 = DecimalParameter(0.4, 1.0, default=0.82, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 40\n    buy_pump_pull_threshold_40_24 = DecimalParameter(1.5, 3.0, default=2.2, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_24 = DecimalParameter(0.4, 1.0, default=0.54, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 40\n    buy_pump_pull_threshold_40_36 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_36 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 40\n    buy_pump_pull_threshold_40_48 = DecimalParameter(1.5, 3.0, default=2.0, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_40_48 = DecimalParameter(0.4, 1.0, default=0.84, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 50\n    buy_pump_pull_threshold_50_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_24 = DecimalParameter(0.4, 1.0, default=0.6, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 50\n    buy_pump_pull_threshold_50_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_36 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 50\n    buy_pump_pull_threshold_50_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_50_48 = DecimalParameter(0.4, 1.0, default=0.85, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 60\n    buy_pump_pull_threshold_60_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_24 = DecimalParameter(0.4, 1.0, default=0.62, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 60\n    buy_pump_pull_threshold_60_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_36 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 60\n    buy_pump_pull_threshold_60_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_60_48 = DecimalParameter(0.4, 1.0, default=0.9, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 70\n    buy_pump_pull_threshold_70_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_24 = DecimalParameter(0.4, 1.0, default=0.63, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 70\n    buy_pump_pull_threshold_70_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_36 = DecimalParameter(0.4, 1.0, default=0.67, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 70\n    buy_pump_pull_threshold_70_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_70_48 = DecimalParameter(0.4, 1.0, default=0.95, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 80\n    buy_pump_pull_threshold_80_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_24 = DecimalParameter(0.4, 1.0, default=0.64, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 80\n    buy_pump_pull_threshold_80_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_36 = DecimalParameter(0.4, 1.0, default=0.68, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 80\n    buy_pump_pull_threshold_80_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_80_48 = DecimalParameter(0.8, 1.1, default=1.0, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 90\n    buy_pump_pull_threshold_90_24 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_24 = DecimalParameter(0.4, 1.0, default=0.65, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 90\n    buy_pump_pull_threshold_90_36 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_36 = DecimalParameter(0.4, 1.0, default=0.69, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 90\n    buy_pump_pull_threshold_90_48 = DecimalParameter(1.5, 3.0, default=1.75, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_90_48 = DecimalParameter(0.8, 1.2, default=1.1, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 100\n    buy_pump_pull_threshold_100_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_24 = DecimalParameter(0.4, 1.0, default=0.66, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 100\n    buy_pump_pull_threshold_100_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_36 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 100\n    buy_pump_pull_threshold_100_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_100_48 = DecimalParameter(0.4, 1.8, default=1.6, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 110\n    buy_pump_pull_threshold_110_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_24 = DecimalParameter(0.4, 1.0, default=0.7, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 110\n    buy_pump_pull_threshold_110_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_36 = DecimalParameter(0.4, 1.0, default=0.74, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 110\n    buy_pump_pull_threshold_110_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_110_48 = DecimalParameter(1.4, 2.0, default=1.8, space='buy', decimals=3, optimize=False, load=True)\n\n    # 24 hours - level 120\n    buy_pump_pull_threshold_120_24 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_24 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 36 hours - level 120\n    buy_pump_pull_threshold_120_36 = DecimalParameter(1.5, 3.0, default=1.7, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_36 = DecimalParameter(0.4, 1.0, default=0.78, space='buy', decimals=3, optimize=False, load=True)\n    # 48 hours - level 120\n    buy_pump_pull_threshold_120_48 = DecimalParameter(1.3, 2.0, default=1.4, space='buy', decimals=2, optimize=False, load=True)\n    buy_pump_threshold_120_48 = DecimalParameter(1.4, 2.8, default=2.0, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_min_inc_1 = DecimalParameter(0.01, 0.05, default=0.022, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_1 = DecimalParameter(25.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_1 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_1 = DecimalParameter(20.0, 40.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_1h_min_2 = DecimalParameter(30.0, 40.0, default=32.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_2 = DecimalParameter(70.0, 95.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_diff_2 = DecimalParameter(30.0, 50.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_2 = DecimalParameter(30.0, 56.0, default=49.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_2 = DecimalParameter(0.97, 0.999, default=0.983, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb40_bbdelta_close_3 = DecimalParameter(0.005, 0.06, default=0.059, space='buy', optimize=False, load=True)\n    buy_bb40_closedelta_close_3 = DecimalParameter(0.01, 0.03, default=0.023, space='buy', optimize=False, load=True)\n    buy_bb40_tail_bbdelta_3 = DecimalParameter(0.15, 0.45, default=0.418, space='buy', optimize=False, load=True)\n    buy_ema_rel_3 = DecimalParameter(0.97, 0.999, default=0.986, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_bb20_close_bblowerband_4 = DecimalParameter(0.96, 0.99, default=0.98, space='buy', optimize=False, load=True)\n    buy_bb20_volume_4 = DecimalParameter(1.0, 20.0, default=10.0, space='buy', decimals=2, optimize=False, load=True)\n\n    buy_ema_open_mult_5 = DecimalParameter(0.016, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_5 = DecimalParameter(0.98, 1.0, default=0.996, space='buy', decimals=3, optimize=False, load=True)\n    buy_ema_rel_5 = DecimalParameter(0.97, 0.999, default=0.944, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_6 = DecimalParameter(0.02, 0.03, default=0.021, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_6 = DecimalParameter(0.98, 0.999, default=0.984, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_7 = DecimalParameter(0.02, 0.04, default=0.03, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_7 = DecimalParameter(24.0, 50.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_8 = DecimalParameter(1.0, 6.0, default=2.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_8 = DecimalParameter(16.0, 30.0, default=29.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_tail_diff_8 = DecimalParameter(3.0, 10.0, default=3.5, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_9 = DecimalParameter(0.91, 0.94, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_9 = DecimalParameter(0.96, 0.98, default=0.942, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_9 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_9 = DecimalParameter(70.0, 90.0, default=88.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_9 = DecimalParameter(36.0, 56.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_10 = DecimalParameter(0.93, 0.97, default=0.948, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_10 = DecimalParameter(0.97, 0.99, default=0.985, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_10 = DecimalParameter(20.0, 40.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_11 = DecimalParameter(0.93, 0.99, default=0.934, space='buy', decimals=3, optimize=False, load=True)\n    buy_min_inc_11 = DecimalParameter(0.005, 0.05, default=0.01, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_1h_min_11 = DecimalParameter(40.0, 60.0, default=55.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_max_11 = DecimalParameter(70.0, 90.0, default=84.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_11 = DecimalParameter(34.0, 50.0, default=48.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_mfi_11 = DecimalParameter(30.0, 46.0, default=36.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_12 = DecimalParameter(0.93, 0.97, default=0.922, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_12 = DecimalParameter(26.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_12 = DecimalParameter(1.0, 6.0, default=1.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_13 = DecimalParameter(0.93, 0.98, default=0.99, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_13 = DecimalParameter(-14.0, -7.0, default=-11.4, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ema_open_mult_14 = DecimalParameter(0.01, 0.03, default=0.014, space='buy', decimals=3, optimize=False, load=True)\n    buy_bb_offset_14 = DecimalParameter(0.98, 1.0, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_14 = DecimalParameter(0.93, 0.99, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ema_open_mult_15 = DecimalParameter(0.01, 0.03, default=0.018, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_15 = DecimalParameter(0.93, 0.99, default=0.954, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_15 = DecimalParameter(20.0, 36.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ema_rel_15 = DecimalParameter(0.97, 0.999, default=0.988, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_ma_offset_16 = DecimalParameter(0.93, 0.97, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_rsi_16 = DecimalParameter(26.0, 50.0, default=31.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_ewo_16 = DecimalParameter(2.0, 6.0, default=2.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_ma_offset_17 = DecimalParameter(0.93, 0.98, default=0.952, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_17 = DecimalParameter(-18.0, -10.0, default=-12.8, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_18 = DecimalParameter(16.0, 32.0, default=26.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_18 = DecimalParameter(0.98, 1.0, default=0.982, space='buy', decimals=3, optimize=False, load=True)\n\n    buy_rsi_1h_min_19 = DecimalParameter(40.0, 70.0, default=50.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_chop_min_19 = DecimalParameter(20.0, 60.0, default=24.1, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_20 = DecimalParameter(20.0, 36.0, default=27.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_20 = DecimalParameter(14.0, 30.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_rsi_21 = DecimalParameter(10.0, 28.0, default=23.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_21 = DecimalParameter(18.0, 40.0, default=24.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_volume_22 = DecimalParameter(0.5, 6.0, default=3.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_bb_offset_22 = DecimalParameter(0.98, 1.0, default=0.98, space='buy', decimals=3, optimize=False, load=True)\n    buy_ma_offset_22 = DecimalParameter(0.93, 0.98, default=0.94, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_22 = DecimalParameter(2.0, 10.0, default=4.2, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_22 = DecimalParameter(26.0, 56.0, default=37.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_bb_offset_23 = DecimalParameter(0.97, 1.0, default=0.987, space='buy', decimals=3, optimize=False, load=True)\n    buy_ewo_23 = DecimalParameter(2.0, 10.0, default=7.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_23 = DecimalParameter(20.0, 40.0, default=30.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_rsi_1h_23 = DecimalParameter(60.0, 80.0, default=70.0, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_24_rsi_max = DecimalParameter(26.0, 60.0, default=60.0, space='buy', decimals=1, optimize=False, load=True)\n    buy_24_rsi_1h_min = DecimalParameter(40.0, 90.0, default=66.9, space='buy', decimals=1, optimize=False, load=True)\n\n    buy_26_zema_low_offset = DecimalParameter(0.90, 0.99, default=0.93, space='buy', optimize=buy_26_parameters__optimize, load=True)\n\n    # Sell\n\n    sell_condition_1_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_2_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_3_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_4_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_5_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_6_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_7_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n    sell_condition_8_enable = CategoricalParameter([True, False], default=True, space='sell', optimize=False, load=True)\n\n    # 48h for pump sell checks\n    sell_pump_threshold_48_1 = DecimalParameter(0.5, 1.2, default=0.9, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_2 = DecimalParameter(0.4, 0.9, default=0.7, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_48_3 = DecimalParameter(0.3, 0.7, default=0.5, space='sell', decimals=2, optimize=False, load=True)\n\n    # 36h for pump sell checks\n    sell_pump_threshold_36_1 = DecimalParameter(0.5, 0.9, default=0.72, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_2 = DecimalParameter(3.0, 6.0, default=4.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_36_3 = DecimalParameter(0.8, 1.6, default=1.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # 24h for pump sell checks\n    sell_pump_threshold_24_1 = DecimalParameter(0.5, 0.9, default=0.68, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_2 = DecimalParameter(0.3, 0.6, default=0.62, space='sell', decimals=2, optimize=False, load=True)\n    sell_pump_threshold_24_3 = DecimalParameter(0.2, 0.5, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    sell_rsi_bb_1 = DecimalParameter(60.0, 80.0, default=79.5, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_bb_2 = DecimalParameter(72.0, 90.0, default=81, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_main_3 = DecimalParameter(77.0, 90.0, default=82, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_dual_rsi_rsi_4 = DecimalParameter(72.0, 84.0, default=73.4, space='sell', decimals=1, optimize=False, load=True)\n    sell_dual_rsi_rsi_1h_4 = DecimalParameter(78.0, 92.0, default=79.6, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_ema_relative_5 = DecimalParameter(0.005, 0.05, default=0.024, space='sell', optimize=False, load=True)\n    sell_rsi_diff_5 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    sell_rsi_under_6 = DecimalParameter(72.0, 90.0, default=79.0, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_rsi_1h_7 = DecimalParameter(80.0, 95.0, default=81.7, space='sell', decimals=1, optimize=False, load=True)\n\n    sell_bb_relative_8 = DecimalParameter(1.05, 1.3, default=1.1, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_profit_0 = DecimalParameter(0.01, 0.1, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_0 = DecimalParameter(30.0, 40.0, default=34.0, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_profit_1 = DecimalParameter(0.01, 0.1, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_1 = DecimalParameter(30.0, 50.0, default=35.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_2 = DecimalParameter(0.01, 0.1, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_2 = DecimalParameter(30.0, 50.0, default=37.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_3 = DecimalParameter(0.01, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_3 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_4 = DecimalParameter(0.01, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_4 = DecimalParameter(35.0, 50.0, default=43.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_5 = DecimalParameter(0.01, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_5 = DecimalParameter(35.0, 50.0, default=45.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_6 = DecimalParameter(0.01, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_6 = DecimalParameter(38.0, 55.0, default=48.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_7 = DecimalParameter(0.01, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_7 = DecimalParameter(40.0, 58.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_8 = DecimalParameter(0.06, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_8 = DecimalParameter(40.0, 50.0, default=55.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_9 = DecimalParameter(0.05, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_10 = DecimalParameter(0.1, 0.14, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_10 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_profit_11 = DecimalParameter(0.16, 0.45, default=0.20, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_rsi_11 = DecimalParameter(28.0, 40.0, default=34.0, space='sell', decimals=2, optimize=False, load=True)\n\n    # Profit under EMA200\n    sell_custom_under_profit_0 = DecimalParameter(0.01, 0.4, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_0 = DecimalParameter(28.0, 40.0, default=35.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_1 = DecimalParameter(0.01, 0.10, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_1 = DecimalParameter(36.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_2 = DecimalParameter(0.01, 0.10, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_2 = DecimalParameter(46.0, 66.0, default=57.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_3 = DecimalParameter(0.01, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_3 = DecimalParameter(50.0, 68.0, default=58.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_4 = DecimalParameter(0.02, 0.1, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_4 = DecimalParameter(50.0, 68.0, default=59.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_5 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_5 = DecimalParameter(46.0, 62.0, default=60.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_6 = DecimalParameter(0.03, 0.1, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_6 = DecimalParameter(44.0, 60.0, default=56.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_7 = DecimalParameter(0.04, 0.1, default=0.08, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_7 = DecimalParameter(46.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_8 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_8 = DecimalParameter(40.0, 58.0, default=55.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_9 = DecimalParameter(0.08, 0.14, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_9 = DecimalParameter(40.0, 60.0, default=54.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_10 = DecimalParameter(0.1, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_10 = DecimalParameter(30.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_under_profit_11 = DecimalParameter(0.16, 0.3, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_under_rsi_11 = DecimalParameter(24.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 48h 1\n    sell_custom_pump_profit_1_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_3 = DecimalParameter(38.0, 50.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_1_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_1_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 36h 1\n    sell_custom_pump_profit_2_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_2 = DecimalParameter(36.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_2_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_2_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit targets for pumped pairs 24h 1\n    sell_custom_pump_profit_3_1 = DecimalParameter(0.01, 0.03, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_1 = DecimalParameter(26.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_2 = DecimalParameter(0.01, 0.6, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_2 = DecimalParameter(34.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_3 = DecimalParameter(0.02, 0.10, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_3 = DecimalParameter(38.0, 50.0, default=40.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_4 = DecimalParameter(0.06, 0.12, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_4 = DecimalParameter(36.0, 48.0, default=42.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_profit_3_5 = DecimalParameter(0.14, 0.24, default=0.2, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_rsi_3_5 = DecimalParameter(20.0, 40.0, default=34.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # SMA descending\n    sell_custom_dec_profit_min_1 = DecimalParameter(0.01, 0.10, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under EMA100\n    sell_custom_dec_profit_min_2 = DecimalParameter(0.05, 0.12, default=0.07, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_dec_profit_max_2 = DecimalParameter(0.06, 0.2, default=0.16, space='sell', decimals=3, optimize=False, load=True)\n\n    # Trail 1\n    sell_trail_profit_min_1 = DecimalParameter(0.1, 0.2, default=0.16, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_profit_max_1 = DecimalParameter(0.4, 0.7, default=0.6, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_1 = DecimalParameter(0.01, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 2\n    sell_trail_profit_min_2 = DecimalParameter(0.08, 0.16, default=0.1, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_2 = DecimalParameter(0.3, 0.5, default=0.4, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_2 = DecimalParameter(0.02, 0.08, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_rsi_min_2 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_trail_rsi_max_2 = DecimalParameter(30.0, 50.0, default=50.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Trail 3\n    sell_trail_profit_min_3 = DecimalParameter(0.01, 0.12, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_trail_profit_max_3 = DecimalParameter(0.1, 0.3, default=0.2, space='sell', decimals=2, optimize=False, load=True)\n    sell_trail_down_3 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n\n    # Under & near EMA200, accept profit\n    sell_custom_profit_under_rel_1 = DecimalParameter(0.01, 0.04, default=0.024, space='sell', optimize=False, load=True)\n    sell_custom_profit_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.4, space='sell', optimize=False, load=True)\n\n    # Under & near EMA200, take the loss\n    sell_custom_stoploss_under_rel_1 = DecimalParameter(0.001, 0.02, default=0.004, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_under_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=10.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 1\n    sell_custom_stoploss_long_profit_min_1 = DecimalParameter(-0.1, -0.02, default=-0.08, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_profit_max_1 = DecimalParameter(-0.06, -0.01, default=-0.04, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_recover_1 = DecimalParameter(0.05, 0.15, default=0.1, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_1 = DecimalParameter(0.0, 20.0, default=4.0, space='sell', optimize=False, load=True)\n\n    # Long duration/recover stoploss 2\n    sell_custom_stoploss_long_recover_2 = DecimalParameter(0.03, 0.15, default=0.06, space='sell', optimize=False, load=True)\n    sell_custom_stoploss_long_rsi_diff_2 = DecimalParameter(30.0, 50.0, default=40.0, space='sell', optimize=False, load=True)\n\n    # Pumped, descending SMA\n    sell_custom_pump_dec_profit_min_1 = DecimalParameter(0.001, 0.04, default=0.005, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_1 = DecimalParameter(0.03, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_2 = DecimalParameter(0.01, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_2 = DecimalParameter(0.04, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_3 = DecimalParameter(0.02, 0.1, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_3 = DecimalParameter(0.06, 0.12, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_min_4 = DecimalParameter(0.01, 0.05, default=0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_dec_profit_max_4 = DecimalParameter(0.02, 0.1, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped 48h 1, under EMA200\n    sell_custom_pump_under_profit_min_1 = DecimalParameter(0.02, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_under_profit_max_1 = DecimalParameter(0.04, 0.1, default=0.09, space='sell', decimals=3, optimize=False, load=True)\n\n    # Pumped trail 1\n    sell_custom_pump_trail_profit_min_1 = DecimalParameter(0.01, 0.12, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_profit_max_1 = DecimalParameter(0.06, 0.16, default=0.07, space='sell', decimals=2, optimize=False, load=True)\n    sell_custom_pump_trail_down_1 = DecimalParameter(0.01, 0.06, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_min_1 = DecimalParameter(16.0, 36.0, default=20.0, space='sell', decimals=1, optimize=False, load=True)\n    sell_custom_pump_trail_rsi_max_1 = DecimalParameter(30.0, 50.0, default=70.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_1 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_min_1 = DecimalParameter(-0.1, -0.01, default=-0.02, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_max_1 = DecimalParameter(-0.1, -0.01, default=-0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_1 = DecimalParameter(0.7, 0.99, default=0.94, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 48h 1\n    sell_custom_stoploss_pump_max_profit_2 = DecimalParameter(0.01, 0.04, default=0.025, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_2 = DecimalParameter(-0.1, -0.01, default=-0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_2 = DecimalParameter(0.7, 0.99, default=0.92, space='sell', decimals=2, optimize=False, load=True)\n\n    # Stoploss, pumped, 36h 3\n    sell_custom_stoploss_pump_max_profit_3 = DecimalParameter(0.01, 0.04, default=0.008, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_loss_3 = DecimalParameter(-0.16, -0.06, default=-0.12, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_stoploss_pump_ma_offset_3 = DecimalParameter(0.7, 0.99, default=0.88, space='sell', decimals=2, optimize=False, load=True)\n\n    # Recover\n    sell_custom_recover_profit_1 = DecimalParameter(0.01, 0.06, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_1 = DecimalParameter(0.06, 0.16, default=0.12, space='sell', decimals=3, optimize=False, load=True)\n\n    sell_custom_recover_profit_min_2 = DecimalParameter(0.01, 0.04, default=0.01, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_profit_max_2 = DecimalParameter(0.02, 0.08, default=0.05, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_min_loss_2 = DecimalParameter(0.04, 0.16, default=0.06, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_recover_rsi_2 = DecimalParameter(32.0, 52.0, default=46.0, space='sell', decimals=1, optimize=False, load=True)\n\n    # Profit for long duration trades\n    sell_custom_long_profit_min_1 = DecimalParameter(0.01, 0.04, default=0.03, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_profit_max_1 = DecimalParameter(0.02, 0.08, default=0.04, space='sell', decimals=3, optimize=False, load=True)\n    sell_custom_long_duration_min_1 = IntParameter(700, 2000, default=900, space='sell', optimize=False, load=True)\n\n    #############################################################\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        if (last_candle is not None):\n            if (current_profit > self.sell_custom_profit_11.value) & (last_candle['rsi'] < self.sell_custom_rsi_11.value):\n                return 'signal_profit_11'\n            if (self.sell_custom_profit_11.value > current_profit > self.sell_custom_profit_10.value) & (last_candle['rsi'] < self.sell_custom_rsi_10.value):\n                return 'signal_profit_10'\n            if (self.sell_custom_profit_10.value > current_profit > self.sell_custom_profit_9.value) & (last_candle['rsi'] < self.sell_custom_rsi_9.value):\n                return 'signal_profit_9'\n            if (self.sell_custom_profit_9.value > current_profit > self.sell_custom_profit_8.value) & (last_candle['rsi'] < self.sell_custom_rsi_8.value):\n                return 'signal_profit_8'\n            if (self.sell_custom_profit_8.value > current_profit > self.sell_custom_profit_7.value) & (last_candle['rsi'] < self.sell_custom_rsi_7.value):\n                return 'signal_profit_7'\n            if (self.sell_custom_profit_7.value > current_profit > self.sell_custom_profit_6.value) & (last_candle['rsi'] < self.sell_custom_rsi_6.value):\n                return 'signal_profit_6'\n            if (self.sell_custom_profit_6.value > current_profit > self.sell_custom_profit_5.value) & (last_candle['rsi'] < self.sell_custom_rsi_5.value):\n                return 'signal_profit_5'\n            elif (self.sell_custom_profit_5.value > current_profit > self.sell_custom_profit_4.value) & (last_candle['rsi'] < self.sell_custom_rsi_4.value):\n                return 'signal_profit_4'\n            elif (self.sell_custom_profit_4.value > current_profit > self.sell_custom_profit_3.value) & (last_candle['rsi'] < self.sell_custom_rsi_3.value):\n                return 'signal_profit_3'\n            elif (self.sell_custom_profit_3.value > current_profit > self.sell_custom_profit_2.value) & (last_candle['rsi'] < self.sell_custom_rsi_2.value):\n                return 'signal_profit_2'\n            elif (self.sell_custom_profit_2.value > current_profit > self.sell_custom_profit_1.value) & (last_candle['rsi'] < self.sell_custom_rsi_1.value):\n                return 'signal_profit_1'\n            elif (self.sell_custom_profit_1.value > current_profit > self.sell_custom_profit_0.value) & (last_candle['rsi'] < self.sell_custom_rsi_0.value):\n                return 'signal_profit_0'\n\n            # check if close is under EMA200\n            elif (current_profit > self.sell_custom_under_profit_11.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_11.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_11'\n            elif (self.sell_custom_under_profit_11.value > current_profit > self.sell_custom_under_profit_10.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_10.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_10'\n            elif (self.sell_custom_under_profit_10.value > current_profit > self.sell_custom_under_profit_9.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_9.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_9'\n            elif (self.sell_custom_under_profit_9.value > current_profit > self.sell_custom_under_profit_8.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_8.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_8'\n            elif (self.sell_custom_under_profit_8.value > current_profit > self.sell_custom_under_profit_7.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_7.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_7'\n            elif (self.sell_custom_under_profit_7.value > current_profit > self.sell_custom_under_profit_6.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_6.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_6'\n            elif (self.sell_custom_under_profit_6.value > current_profit > self.sell_custom_under_profit_5.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_5.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_5'\n            elif (self.sell_custom_under_profit_5.value > current_profit > self.sell_custom_under_profit_4.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_4.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_4'\n            elif (self.sell_custom_under_profit_4.value > current_profit > self.sell_custom_under_profit_3.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_3.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_3'\n            elif (self.sell_custom_under_profit_3.value > current_profit > self.sell_custom_under_profit_2.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_2.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_2'\n            elif (self.sell_custom_under_profit_2.value > current_profit > self.sell_custom_under_profit_1.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_1.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_1'\n            elif (self.sell_custom_under_profit_1.value > current_profit > self.sell_custom_under_profit_0.value) & (last_candle['rsi'] < self.sell_custom_under_rsi_0.value) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_u_0'\n\n            # check if the pair is \"pumped\"\n\n            elif (last_candle['sell_pump_48_1_1h']) & (current_profit > self.sell_custom_pump_profit_1_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_5.value):\n                return 'signal_profit_p_1_5'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_5.value > current_profit > self.sell_custom_pump_profit_1_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_4.value):\n                return 'signal_profit_p_1_4'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_4.value > current_profit > self.sell_custom_pump_profit_1_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_3.value):\n                return 'signal_profit_p_1_3'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_3.value > current_profit > self.sell_custom_pump_profit_1_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_2.value):\n                return 'signal_profit_p_1_2'\n            elif (last_candle['sell_pump_48_1_1h']) & (self.sell_custom_pump_profit_1_2.value > current_profit > self.sell_custom_pump_profit_1_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_1_1.value):\n                return 'signal_profit_p_1_1'\n\n            elif (last_candle['sell_pump_36_1_1h']) & (current_profit > self.sell_custom_pump_profit_2_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_5.value):\n                return 'signal_profit_p_2_5'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_5.value > current_profit > self.sell_custom_pump_profit_2_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_4.value):\n                return 'signal_profit_p_2_4'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_4.value > current_profit > self.sell_custom_pump_profit_2_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_3.value):\n                return 'signal_profit_p_2_3'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_3.value > current_profit > self.sell_custom_pump_profit_2_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_2.value):\n                return 'signal_profit_p_2_2'\n            elif (last_candle['sell_pump_36_1_1h']) & (self.sell_custom_pump_profit_2_2.value > current_profit > self.sell_custom_pump_profit_2_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_2_1.value):\n                return 'signal_profit_p_2_1'\n\n            elif (last_candle['sell_pump_24_1_1h']) & (current_profit > self.sell_custom_pump_profit_3_5.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_5.value):\n                return 'signal_profit_p_3_5'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_5.value > current_profit > self.sell_custom_pump_profit_3_4.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_4.value):\n                return 'signal_profit_p_3_4'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_4.value > current_profit > self.sell_custom_pump_profit_3_3.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_3.value):\n                return 'signal_profit_p_3_3'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_3.value > current_profit > self.sell_custom_pump_profit_3_2.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_2.value):\n                return 'signal_profit_p_3_2'\n            elif (last_candle['sell_pump_24_1_1h']) & (self.sell_custom_pump_profit_3_2.value > current_profit > self.sell_custom_pump_profit_3_1.value) & (last_candle['rsi'] < self.sell_custom_pump_rsi_3_1.value):\n                return 'signal_profit_p_3_1'\n\n            elif (self.sell_custom_dec_profit_max_1.value > current_profit > self.sell_custom_dec_profit_min_1.value) & (last_candle['sma_200_dec_20']):\n                return 'signal_profit_d_1'\n            elif (self.sell_custom_dec_profit_max_2.value > current_profit > self.sell_custom_dec_profit_min_2.value) & (last_candle['close'] < last_candle['ema_100']):\n                return 'signal_profit_d_2'\n\n            # Trailing\n            elif (self.sell_trail_profit_max_1.value > current_profit > self.sell_trail_profit_min_1.value) & (self.sell_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_trail_down_1.value)):\n                return 'signal_profit_t_1'\n            elif (self.sell_trail_profit_max_2.value > current_profit > self.sell_trail_profit_min_2.value) & (self.sell_trail_rsi_min_2.value < last_candle['rsi'] < self.sell_trail_rsi_max_2.value) & (max_profit > (current_profit + self.sell_trail_down_2.value)):\n                return 'signal_profit_t_2'\n            elif (self.sell_trail_profit_max_3.value > current_profit > self.sell_trail_profit_min_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)) & (last_candle['sma_200_dec_20_1h']):\n                return 'signal_profit_t_3'\n\n            elif (last_candle['close'] < last_candle['ema_200']) & (current_profit > self.sell_trail_profit_min_3.value) & (current_profit < self.sell_trail_profit_max_3.value) & (max_profit > (current_profit + self.sell_trail_down_3.value)):\n                return 'signal_profit_u_t_1'\n\n            # elif (last_candle['sell_pump_48_1_1h']) & (0.06 > current_profit > 0.04) & (last_candle['rsi'] < 54.0) & (current_time - timedelta(minutes=30) < trade.open_date_utc):\n            #     return 'signal_profit_p_s_1'\n\n            elif (current_profit > 0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_profit_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_profit_under_rsi_diff_1.value):\n                return 'signal_profit_u_e_1'\n\n            elif (current_profit < -0.0) & (last_candle['close'] < last_candle['ema_200']) & (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.sell_custom_stoploss_under_rel_1.value) & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_under_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=720) > trade.open_date_utc):\n                return 'signal_stoploss_u_1'\n\n            elif (self.sell_custom_stoploss_long_profit_min_1.value < current_profit < self.sell_custom_stoploss_long_profit_max_1.value) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_1.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_1.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_1'\n\n            elif (current_profit < -0.0) & (current_profit > (-max_loss + self.sell_custom_stoploss_long_recover_2.value)) & (last_candle['close'] < last_candle['ema_200'])  & (last_candle['rsi'] > last_candle['rsi_1h'] + self.sell_custom_stoploss_long_rsi_diff_2.value) & (last_candle['sma_200_dec_24']) & (current_time - timedelta(minutes=1200) > trade.open_date_utc):\n                return 'signal_stoploss_l_r_u_2'\n\n            elif (self.sell_custom_pump_dec_profit_max_1.value > current_profit > self.sell_custom_pump_dec_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_1'\n            elif (self.sell_custom_pump_dec_profit_max_2.value > current_profit > self.sell_custom_pump_dec_profit_min_2.value) & (last_candle['sell_pump_48_2_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_2'\n            elif (self.sell_custom_pump_dec_profit_max_3.value > current_profit > self.sell_custom_pump_dec_profit_min_3.value) & (last_candle['sell_pump_48_3_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_d_3'\n            elif (self.sell_custom_pump_dec_profit_max_4.value > current_profit > self.sell_custom_pump_dec_profit_min_4.value) & (last_candle['sma_200_dec_20']) & (last_candle['sell_pump_24_2_1h']):\n                return 'signal_profit_p_d_4'\n\n            # Pumped 48h 1, under EMA200\n            elif (self.sell_custom_pump_under_profit_max_1.value > current_profit > self.sell_custom_pump_under_profit_min_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['close'] < last_candle['ema_200']):\n                return 'signal_profit_p_u_1'\n\n            # Pumped 36h 2, trail 1\n            elif (last_candle['sell_pump_36_2_1h']) & (self.sell_custom_pump_trail_profit_max_1.value > current_profit > self.sell_custom_pump_trail_profit_min_1.value) & (self.sell_custom_pump_trail_rsi_min_1.value < last_candle['rsi'] < self.sell_custom_pump_trail_rsi_max_1.value) & (max_profit > (current_profit + self.sell_custom_pump_trail_down_1.value)):\n                return 'signal_profit_p_t_1'\n\n            # elif (max_profit < self.sell_custom_stoploss_pump_max_profit_1.value) & (self.sell_custom_stoploss_pump_min_1.value < current_profit < self.sell_custom_stoploss_pump_max_1.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_1.value)):\n            #     return 'signal_stoploss_p_1'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_2.value) & (current_profit < self.sell_custom_stoploss_pump_loss_2.value) & (last_candle['sell_pump_48_1_1h']) & (last_candle['sma_200_dec_20_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_2.value)):\n                return 'signal_stoploss_p_2'\n\n            elif (max_profit < self.sell_custom_stoploss_pump_max_profit_3.value) & (current_profit < self.sell_custom_stoploss_pump_loss_3.value) & (last_candle['sell_pump_36_3_1h']) & (last_candle['close'] < (last_candle['ema_200'] * self.sell_custom_stoploss_pump_ma_offset_3.value)):\n                return 'signal_stoploss_p_3'\n\n            # Recover\n            elif (max_loss > self.sell_custom_recover_min_loss_1.value) & (current_profit > self.sell_custom_recover_profit_1.value):\n                return 'signal_profit_r_1'\n\n            elif (max_loss > self.sell_custom_recover_min_loss_2.value) & (self.sell_custom_recover_profit_max_2.value > current_profit > self.sell_custom_recover_profit_min_2.value) & (last_candle['rsi'] < self.sell_custom_recover_rsi_2.value):\n                return 'signal_profit_r_2'\n\n            # Take profit for long duration trades\n            elif (self.sell_custom_long_profit_min_1.value < current_profit < self.sell_custom_long_profit_max_1.value) & (current_time - timedelta(minutes=self.sell_custom_long_duration_min_1.value) > trade.open_date_utc):\n                return 'signal_profit_l_1'\n\n        return None\n\n    def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:\n        \"\"\"\n        Rolling Percentage Change Maximum across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param method: High to Low / Open to Close\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if method == 'HL':\n            return ((df['high'].rolling(length).max() - df['low'].rolling(length).min()) / df['low'].rolling(length).min())\n        elif method == 'OC':\n            return ((df['open'].rolling(length).max() - df['close'].rolling(length).min()) / df['close'].rolling(length).min())\n        else:\n            raise ValueError(f\"Method {method} not defined!\")\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n    def range_maxgap(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Maximum Price Gap across interval.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['open'].rolling(length).max() - df['close'].rolling(length).min())\n\n    def range_maxgap_adjusted(self, dataframe: DataFrame, length: int, adjustment: float) -> float:\n        \"\"\"\n        Maximum Price Gap across interval adjusted.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param adjustment: int The adjustment to be applied\n        \"\"\"\n        return (self.range_maxgap(dataframe,length) / adjustment)\n\n    def range_height(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Current close distance to range bottom.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        return (df['close'] - df['close'].rolling(length).min())\n\n    def safe_pump(self, dataframe: DataFrame, length: int, thresh: float, pull_thresh: float) -> bool:\n        \"\"\"\n        Determine if entry after a pump is safe.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        :param thresh: int Maximum percentage change threshold\n        :param pull_thresh: int Pullback from interval maximum threshold\n        \"\"\"\n        df = dataframe.copy()\n        return (df[f'oc_pct_change_{length}'] < thresh) | (self.range_maxgap_adjusted(df, length, pull_thresh) > self.range_height(df, length))\n\n    def safe_dips(self, dataframe: DataFrame, thresh_0, thresh_2, thresh_12, thresh_144) -> bool:\n        \"\"\"\n        Determine if dip is safe to enter.\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param thresh_0: Threshold value for 0 length top pct change\n        :param thresh_2: Threshold value for 2 length top pct change\n        :param thresh_12: Threshold value for 12 length top pct change\n        :param thresh_144: Threshold value for 144 length top pct change\n        \"\"\"\n        return ((dataframe['tpct_change_0'] < thresh_0) &\n                (dataframe['tpct_change_2'] < thresh_2) &\n                (dataframe['tpct_change_12'] < thresh_12) &\n                (dataframe['tpct_change_144'] < thresh_144))\n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)\n\n        # EMA\n        informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)\n        informative_1h['ema_15'] = ta.EMA(informative_1h, timeperiod=15)\n        informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)\n        informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)\n        informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)\n        informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)\n        informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)\n        informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)\n\n        # SMA\n        informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)\n        informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)\n\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n\n        # BB\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)\n        informative_1h['bb20_2_low'] = bollinger['lower']\n        informative_1h['bb20_2_mid'] = bollinger['mid']\n        informative_1h['bb20_2_upp'] = bollinger['upper']\n\n        # Chaikin Money Flow\n        informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)\n\n        # Pump protections\n        informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)\n        informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)\n        informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)\n\n        informative_1h['oc_pct_change_48'] = self.range_percent_change(informative_1h, 'OC', 48)\n        informative_1h['oc_pct_change_36'] = self.range_percent_change(informative_1h, 'OC', 36)\n        informative_1h['oc_pct_change_24'] = self.range_percent_change(informative_1h, 'OC', 24)\n\n        informative_1h['safe_pump_24_10'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_10_24.value, self.buy_pump_pull_threshold_10_24.value)\n        informative_1h['safe_pump_36_10'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_10_36.value, self.buy_pump_pull_threshold_10_36.value)\n        informative_1h['safe_pump_48_10'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_10_48.value, self.buy_pump_pull_threshold_10_48.value)\n\n        informative_1h['safe_pump_24_20'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_20_24.value, self.buy_pump_pull_threshold_20_24.value)\n        informative_1h['safe_pump_36_20'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_20_36.value, self.buy_pump_pull_threshold_20_36.value)\n        informative_1h['safe_pump_48_20'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_20_48.value, self.buy_pump_pull_threshold_20_48.value)\n\n        informative_1h['safe_pump_24_30'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_30_24.value, self.buy_pump_pull_threshold_30_24.value)\n        informative_1h['safe_pump_36_30'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_30_36.value, self.buy_pump_pull_threshold_30_36.value)\n        informative_1h['safe_pump_48_30'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_30_48.value, self.buy_pump_pull_threshold_30_48.value)\n\n        informative_1h['safe_pump_24_40'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_40_24.value, self.buy_pump_pull_threshold_40_24.value)\n        informative_1h['safe_pump_36_40'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_40_36.value, self.buy_pump_pull_threshold_40_36.value)\n        informative_1h['safe_pump_48_40'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_40_48.value, self.buy_pump_pull_threshold_40_48.value)\n\n        informative_1h['safe_pump_24_50'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_50_24.value, self.buy_pump_pull_threshold_50_24.value)\n        informative_1h['safe_pump_36_50'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_50_36.value, self.buy_pump_pull_threshold_50_36.value)\n        informative_1h['safe_pump_48_50'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_50_48.value, self.buy_pump_pull_threshold_50_48.value)\n\n        informative_1h['safe_pump_24_60'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_60_24.value, self.buy_pump_pull_threshold_60_24.value)\n        informative_1h['safe_pump_36_60'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_60_36.value, self.buy_pump_pull_threshold_60_36.value)\n        informative_1h['safe_pump_48_60'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_60_48.value, self.buy_pump_pull_threshold_60_48.value)\n\n        informative_1h['safe_pump_24_70'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_70_24.value, self.buy_pump_pull_threshold_70_24.value)\n        informative_1h['safe_pump_36_70'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_70_36.value, self.buy_pump_pull_threshold_70_36.value)\n        informative_1h['safe_pump_48_70'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_70_48.value, self.buy_pump_pull_threshold_70_48.value)\n\n        informative_1h['safe_pump_24_80'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_80_24.value, self.buy_pump_pull_threshold_80_24.value)\n        informative_1h['safe_pump_36_80'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_80_36.value, self.buy_pump_pull_threshold_80_36.value)\n        informative_1h['safe_pump_48_80'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_80_48.value, self.buy_pump_pull_threshold_80_48.value)\n\n        informative_1h['safe_pump_24_90'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_90_24.value, self.buy_pump_pull_threshold_90_24.value)\n        informative_1h['safe_pump_36_90'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_90_36.value, self.buy_pump_pull_threshold_90_36.value)\n        informative_1h['safe_pump_48_90'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_90_48.value, self.buy_pump_pull_threshold_90_48.value)\n\n        informative_1h['safe_pump_24_100'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_100_24.value, self.buy_pump_pull_threshold_100_24.value)\n        informative_1h['safe_pump_36_100'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_100_36.value, self.buy_pump_pull_threshold_100_36.value)\n        informative_1h['safe_pump_48_100'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_100_48.value, self.buy_pump_pull_threshold_100_48.value)\n\n        informative_1h['safe_pump_24_110'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_110_24.value, self.buy_pump_pull_threshold_110_24.value)\n        informative_1h['safe_pump_36_110'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_110_36.value, self.buy_pump_pull_threshold_110_36.value)\n        informative_1h['safe_pump_48_110'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_110_48.value, self.buy_pump_pull_threshold_110_48.value)\n\n        informative_1h['safe_pump_24_120'] = self.safe_pump(informative_1h, 24, self.buy_pump_threshold_120_24.value, self.buy_pump_pull_threshold_120_24.value)\n        informative_1h['safe_pump_36_120'] = self.safe_pump(informative_1h, 36, self.buy_pump_threshold_120_36.value, self.buy_pump_pull_threshold_120_36.value)\n        informative_1h['safe_pump_48_120'] = self.safe_pump(informative_1h, 48, self.buy_pump_threshold_120_48.value, self.buy_pump_pull_threshold_120_48.value)\n\n        informative_1h['sell_pump_48_1'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_1.value)\n        informative_1h['sell_pump_48_2'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_2.value)\n        informative_1h['sell_pump_48_3'] = (informative_1h['hl_pct_change_48'] > self.sell_pump_threshold_48_3.value)\n\n        informative_1h['sell_pump_36_1'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_1.value)\n        informative_1h['sell_pump_36_2'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_2.value)\n        informative_1h['sell_pump_36_3'] = (informative_1h['hl_pct_change_36'] > self.sell_pump_threshold_36_3.value)\n\n        informative_1h['sell_pump_24_1'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_1.value)\n        informative_1h['sell_pump_24_2'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_2.value)\n        informative_1h['sell_pump_24_3'] = (informative_1h['hl_pct_change_24'] > self.sell_pump_threshold_24_3.value)\n\n        return informative_1h\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # BB 40 - STD2\n        bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)\n        dataframe['bb40_2_low']= bb_40_std2['lower']\n        dataframe['bb40_2_mid'] = bb_40_std2['mid']\n        dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n        dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()\n\n        # BB 20 - STD2\n        bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb20_2_low'] = bb_20_std2['lower']\n        dataframe['bb20_2_mid'] = bb_20_std2['mid']\n        dataframe['bb20_2_upp'] = bb_20_std2['upper']\n\n        # EMA 200\n        dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)\n        dataframe['ema_15'] = ta.EMA(dataframe, timeperiod=15)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)\n        dataframe['ema_35'] = ta.EMA(dataframe, timeperiod=35)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n\n        # SMA\n        dataframe['sma_5'] = ta.SMA(dataframe, timeperiod=5)\n        dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)\n        dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)\n\n        dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)\n        dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # EWO\n        dataframe['ewo'] = EWO(dataframe, 50, 200)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Chopiness\n        dataframe['chop']= qtpylib.chopiness(dataframe, 14)\n\n        # Zero-Lag EMA\n        dataframe['zema'] = zema(dataframe, period=61)\n\n        # Dip protection\n        dataframe['tpct_change_0']   = self.top_percent_change(dataframe,0)\n        dataframe['tpct_change_2']   = self.top_percent_change(dataframe,2)\n        dataframe['tpct_change_12']  = self.top_percent_change(dataframe,12)\n        dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)\n\n        dataframe['safe_dips_10']  = self.safe_dips(dataframe, self.buy_dip_threshold_10_1.value, self.buy_dip_threshold_10_2.value, self.buy_dip_threshold_10_3.value, self.buy_dip_threshold_10_4.value)\n        dataframe['safe_dips_20']  = self.safe_dips(dataframe, self.buy_dip_threshold_20_1.value, self.buy_dip_threshold_20_2.value, self.buy_dip_threshold_20_3.value, self.buy_dip_threshold_20_4.value)\n        dataframe['safe_dips_30']  = self.safe_dips(dataframe, self.buy_dip_threshold_30_1.value, self.buy_dip_threshold_30_2.value, self.buy_dip_threshold_30_3.value, self.buy_dip_threshold_30_4.value)\n        dataframe['safe_dips_40']  = self.safe_dips(dataframe, self.buy_dip_threshold_40_1.value, self.buy_dip_threshold_40_2.value, self.buy_dip_threshold_40_3.value, self.buy_dip_threshold_40_4.value)\n        dataframe['safe_dips_50']  = self.safe_dips(dataframe, self.buy_dip_threshold_50_1.value, self.buy_dip_threshold_50_2.value, self.buy_dip_threshold_50_3.value, self.buy_dip_threshold_50_4.value)\n        dataframe['safe_dips_60']  = self.safe_dips(dataframe, self.buy_dip_threshold_60_1.value, self.buy_dip_threshold_60_2.value, self.buy_dip_threshold_60_3.value, self.buy_dip_threshold_60_4.value)\n        dataframe['safe_dips_70']  = self.safe_dips(dataframe, self.buy_dip_threshold_70_1.value, self.buy_dip_threshold_70_2.value, self.buy_dip_threshold_70_3.value, self.buy_dip_threshold_70_4.value)\n        dataframe['safe_dips_80']  = self.safe_dips(dataframe, self.buy_dip_threshold_80_1.value, self.buy_dip_threshold_80_2.value, self.buy_dip_threshold_80_3.value, self.buy_dip_threshold_80_4.value)\n        dataframe['safe_dips_90']  = self.safe_dips(dataframe, self.buy_dip_threshold_90_1.value, self.buy_dip_threshold_90_2.value, self.buy_dip_threshold_90_3.value, self.buy_dip_threshold_90_4.value)\n        dataframe['safe_dips_100'] = self.safe_dips(dataframe, self.buy_dip_threshold_100_1.value, self.buy_dip_threshold_100_2.value, self.buy_dip_threshold_100_3.value, self.buy_dip_threshold_100_4.value)\n        dataframe['safe_dips_110'] = self.safe_dips(dataframe, self.buy_dip_threshold_110_1.value, self.buy_dip_threshold_110_2.value, self.buy_dip_threshold_110_3.value, self.buy_dip_threshold_110_4.value)\n\n        # Volume\n        dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)\n        dataframe['volume_mean_30'] = dataframe['volume'].rolling(30).mean()\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        # Protections\n        buy_01_protections = [True]\n        if self.buy_01_protection__ema_fast.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_01_protection__ema_slow.value:\n            buy_01_protections.append(dataframe[f\"ema_{self.buy_01_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_01_protection__close_above_ema_fast.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_01_protection__close_above_ema_slow.value:\n            buy_01_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_01_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_01_protection__sma200_rising.value:\n            buy_01_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_01_protection__sma200_rising_val.value)))\n        if self.buy_01_protection__sma200_1h_rising.value:\n            buy_01_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_01_protection__sma200_1h_rising_val.value)))\n        if self.buy_01_protection__safe_dips.value:\n            buy_01_protections.append(dataframe[f\"safe_dips_{self.buy_01_protection__safe_dips_type.value}\"])\n        if self.buy_01_protection__safe_pump.value:\n            buy_01_protections.append(dataframe[f\"safe_pump_{self.buy_01_protection__safe_pump_period.value}_{self.buy_01_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_01_logic = []\n        buy_01_logic.append(reduce(lambda x, y: x & y, buy_01_protections))\n        buy_01_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_1.value)\n        buy_01_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_1.value)\n        buy_01_logic.append(dataframe['rsi'] < self.buy_rsi_1.value)\n        buy_01_logic.append(dataframe['mfi'] < self.buy_mfi_1.value)\n        buy_01_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_01_trigger'] = reduce(lambda x, y: x & y, buy_01_logic)\n        if self.buy_condition_1_enable.value:\n            conditions.append(dataframe['buy_01_trigger'])\n\n        # Protections\n        buy_02_protections = [True]\n        if self.buy_02_protection__ema_fast.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_02_protection__ema_slow.value:\n            buy_02_protections.append(dataframe[f\"ema_{self.buy_02_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_02_protection__close_above_ema_fast.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_02_protection__close_above_ema_slow.value:\n            buy_02_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_02_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_02_protection__sma200_rising.value:\n            buy_02_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_02_protection__sma200_rising_val.value)))\n        if self.buy_02_protection__sma200_1h_rising.value:\n            buy_02_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_02_protection__sma200_1h_rising_val.value)))\n        if self.buy_02_protection__safe_dips.value:\n            buy_02_protections.append(dataframe[f\"safe_dips_{self.buy_02_protection__safe_dips_type.value}\"])\n        if self.buy_02_protection__safe_pump.value:\n            buy_02_protections.append(dataframe[f\"safe_pump_{self.buy_02_protection__safe_pump_period.value}_{self.buy_02_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_02_logic = []\n        buy_02_logic.append(reduce(lambda x, y: x & y, buy_02_protections))\n        #buy_02_logic.append(dataframe['volume_mean_4'] * self.buy_volume_2.value > dataframe['volume'])\n        buy_02_logic.append(dataframe['rsi'] < dataframe['rsi_1h'] - self.buy_rsi_1h_diff_2.value)\n        buy_02_logic.append(dataframe['mfi'] < self.buy_mfi_2.value)\n        buy_02_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_2.value))\n        buy_02_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_02_trigger'] = reduce(lambda x, y: x & y, buy_02_logic)\n        if self.buy_condition_2_enable.value:\n            conditions.append(dataframe['buy_02_trigger'])\n\n        # Protections\n        buy_03_protections = [True]\n        if self.buy_03_protection__ema_fast.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_03_protection__ema_slow.value:\n            buy_03_protections.append(dataframe[f\"ema_{self.buy_03_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_03_protection__close_above_ema_fast.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_03_protection__close_above_ema_slow.value:\n            buy_03_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_03_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_03_protection__sma200_rising.value:\n            buy_03_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_03_protection__sma200_rising_val.value)))\n        if self.buy_03_protection__sma200_1h_rising.value:\n            buy_03_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_03_protection__sma200_1h_rising_val.value)))\n        if self.buy_03_protection__safe_dips.value:\n            buy_03_protections.append(dataframe[f\"safe_dips_{self.buy_03_protection__safe_dips_type.value}\"])\n        if self.buy_03_protection__safe_pump.value:\n            buy_03_protections.append(dataframe[f\"safe_pump_{self.buy_03_protection__safe_pump_period.value}_{self.buy_03_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_03_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_3.value))\n\n        # Logic\n        buy_03_logic = []\n        buy_03_logic.append(reduce(lambda x, y: x & y, buy_03_protections))\n        buy_03_logic.append(dataframe['bb40_2_low'].shift().gt(0))\n        buy_03_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * self.buy_bb40_bbdelta_close_3.value))\n        buy_03_logic.append(dataframe['closedelta'].gt(dataframe['close'] * self.buy_bb40_closedelta_close_3.value))\n        buy_03_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * self.buy_bb40_tail_bbdelta_3.value))\n        buy_03_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))\n        buy_03_logic.append(dataframe['close'].le(dataframe['close'].shift()))\n        buy_03_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_03_trigger'] = reduce(lambda x, y: x & y, buy_03_logic)\n        if self.buy_condition_3_enable.value:\n            conditions.append(dataframe['buy_03_trigger'])\n\n        # Protections\n        buy_04_protections = [True]\n        if self.buy_04_protection__ema_fast.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_04_protection__ema_slow.value:\n            buy_04_protections.append(dataframe[f\"ema_{self.buy_04_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_04_protection__close_above_ema_fast.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_04_protection__close_above_ema_slow.value:\n            buy_04_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_04_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_04_protection__sma200_rising.value:\n            buy_04_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_04_protection__sma200_rising_val.value)))\n        if self.buy_04_protection__sma200_1h_rising.value:\n            buy_04_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_04_protection__sma200_1h_rising_val.value)))\n        if self.buy_04_protection__safe_dips.value:\n            buy_04_protections.append(dataframe[f\"safe_dips_{self.buy_04_protection__safe_dips_type.value}\"])\n        if self.buy_04_protection__safe_pump.value:\n            buy_04_protections.append(dataframe[f\"safe_pump_{self.buy_04_protection__safe_pump_period.value}_{self.buy_04_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_04_logic = []\n        buy_04_logic.append(reduce(lambda x, y: x & y, buy_04_protections))\n        buy_04_logic.append(dataframe['close'] < dataframe['ema_50'])\n        buy_04_logic.append(dataframe['close'] < self.buy_bb20_close_bblowerband_4.value * dataframe['bb20_2_low'])\n        buy_04_logic.append(dataframe['volume'] < (dataframe['volume_mean_30'].shift(1) * self.buy_bb20_volume_4.value))\n        # Populate\n        dataframe.loc[:, 'buy_04_trigger'] = reduce(lambda x, y: x & y, buy_04_logic)\n        if self.buy_condition_4_enable.value:\n            conditions.append(dataframe['buy_04_trigger'])\n\n\n        # Protections\n        buy_05_protections = [True]\n        if self.buy_05_protection__ema_fast.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_05_protection__ema_slow.value:\n            buy_05_protections.append(dataframe[f\"ema_{self.buy_05_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_05_protection__close_above_ema_fast.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_05_protection__close_above_ema_slow.value:\n            buy_05_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_05_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_05_protection__sma200_rising.value:\n            buy_05_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_05_protection__sma200_rising_val.value)))\n        if self.buy_05_protection__sma200_1h_rising.value:\n            buy_05_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_05_protection__sma200_1h_rising_val.value)))\n        if self.buy_05_protection__safe_dips.value:\n            buy_05_protections.append(dataframe[f\"safe_dips_{self.buy_05_protection__safe_dips_type.value}\"])\n        if self.buy_05_protection__safe_pump.value:\n            buy_05_protections.append(dataframe[f\"safe_pump_{self.buy_05_protection__safe_pump_period.value}_{self.buy_05_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_05_protections.append(dataframe['close'] > (dataframe['ema_200_1h'] * self.buy_ema_rel_5.value))\n\n        # Logic\n        buy_05_logic = []\n        buy_05_logic.append(reduce(lambda x, y: x & y, buy_05_protections))\n        buy_05_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_05_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_5.value))\n        buy_05_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_05_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_5.value))\n        buy_05_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_05_trigger'] = reduce(lambda x, y: x & y, buy_05_logic)\n        if self.buy_condition_5_enable.value:\n            conditions.append(dataframe['buy_05_trigger'])\n\n        # Protections\n        buy_06_protections = [True]\n        if self.buy_06_protection__ema_fast.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_06_protection__ema_slow.value:\n            buy_06_protections.append(dataframe[f\"ema_{self.buy_06_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_06_protection__close_above_ema_fast.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_06_protection__close_above_ema_slow.value:\n            buy_06_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_06_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_06_protection__sma200_rising.value:\n            buy_06_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_06_protection__sma200_rising_val.value)))\n        if self.buy_06_protection__sma200_1h_rising.value:\n            buy_06_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_06_protection__sma200_1h_rising_val.value)))\n        if self.buy_06_protection__safe_dips.value:\n            buy_06_protections.append(dataframe[f\"safe_dips_{self.buy_06_protection__safe_dips_type.value}\"])\n        if self.buy_06_protection__safe_pump.value:\n            buy_06_protections.append(dataframe[f\"safe_pump_{self.buy_06_protection__safe_pump_period.value}_{self.buy_06_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_06_logic = []\n        buy_06_logic.append(reduce(lambda x, y: x & y, buy_06_protections))\n        buy_06_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_06_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_6.value))\n        buy_06_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_06_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_6.value))\n        buy_06_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_06_trigger'] = reduce(lambda x, y: x & y, buy_06_logic)\n        if self.buy_condition_6_enable.value:\n            conditions.append(dataframe['buy_06_trigger'])\n\n        # Protections\n        buy_07_protections = [True]\n        if self.buy_07_protection__ema_fast.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_07_protection__ema_slow.value:\n            buy_07_protections.append(dataframe[f\"ema_{self.buy_07_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_07_protection__close_above_ema_fast.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_07_protection__close_above_ema_slow.value:\n            buy_07_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_07_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_07_protection__sma200_rising.value:\n            buy_07_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_07_protection__sma200_rising_val.value)))\n        if self.buy_07_protection__sma200_1h_rising.value:\n            buy_07_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_07_protection__sma200_1h_rising_val.value)))\n        if self.buy_07_protection__safe_dips.value:\n            buy_07_protections.append(dataframe[f\"safe_dips_{self.buy_07_protection__safe_dips_type.value}\"])\n        if self.buy_07_protection__safe_pump.value:\n            buy_07_protections.append(dataframe[f\"safe_pump_{self.buy_07_protection__safe_pump_period.value}_{self.buy_07_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_07_logic = []\n        buy_07_logic.append(reduce(lambda x, y: x & y, buy_07_protections))\n        #buy_07_logic.append(dataframe['volume'].rolling(4).mean() * self.buy_volume_7.value > dataframe['volume'])\n        buy_07_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_07_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_7.value))\n        buy_07_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_07_logic.append(dataframe['rsi'] < self.buy_rsi_7.value)\n        buy_07_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_07_trigger'] = reduce(lambda x, y: x & y, buy_07_logic)\n        if self.buy_condition_7_enable.value:\n            conditions.append(dataframe['buy_07_trigger'])\n\n        # Protections\n        buy_08_protections = [True]\n        if self.buy_08_protection__ema_fast.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_08_protection__ema_slow.value:\n            buy_08_protections.append(dataframe[f\"ema_{self.buy_08_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_08_protection__close_above_ema_fast.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_08_protection__close_above_ema_slow.value:\n            buy_08_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_08_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_08_protection__sma200_rising.value:\n            buy_08_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_08_protection__sma200_rising_val.value)))\n        if self.buy_08_protection__sma200_1h_rising.value:\n            buy_08_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_08_protection__sma200_1h_rising_val.value)))\n        if self.buy_08_protection__safe_dips.value:\n            buy_08_protections.append(dataframe[f\"safe_dips_{self.buy_08_protection__safe_dips_type.value}\"])\n        if self.buy_08_protection__safe_pump.value:\n            buy_08_protections.append(dataframe[f\"safe_pump_{self.buy_08_protection__safe_pump_period.value}_{self.buy_08_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_08_logic = []\n        buy_08_logic.append(reduce(lambda x, y: x & y, buy_08_protections))\n        buy_08_logic.append(dataframe['rsi'] < self.buy_rsi_8.value)\n        buy_08_logic.append(dataframe['volume'] > (dataframe['volume'].shift(1) * self.buy_volume_8.value))\n        buy_08_logic.append(dataframe['close'] > dataframe['open'])\n        buy_08_logic.append((dataframe['close'] - dataframe['low']) > ((dataframe['close'] - dataframe['open']) * self.buy_tail_diff_8.value))\n        buy_08_logic.append(dataframe['volume'] > 0)\n\n        # Populate\n        dataframe.loc[:, 'buy_08_trigger'] = reduce(lambda x, y: x & y, buy_08_logic)\n        if self.buy_condition_8_enable.value:\n            conditions.append(dataframe['buy_08_trigger'])\n\n        # Protections\n        buy_09_protections = [True]\n        if self.buy_09_protection__ema_fast.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_09_protection__ema_slow.value:\n            buy_09_protections.append(dataframe[f\"ema_{self.buy_09_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_09_protection__close_above_ema_fast.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_09_protection__close_above_ema_slow.value:\n            buy_09_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_09_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_09_protection__sma200_rising.value:\n            buy_09_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_09_protection__sma200_rising_val.value)))\n        if self.buy_09_protection__sma200_1h_rising.value:\n            buy_09_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_09_protection__sma200_1h_rising_val.value)))\n        if self.buy_09_protection__safe_dips.value:\n            buy_09_protections.append(dataframe[f\"safe_dips_{self.buy_09_protection__safe_dips_type.value}\"])\n        if self.buy_09_protection__safe_pump.value:\n            buy_09_protections.append(dataframe[f\"safe_pump_{self.buy_09_protection__safe_pump_period.value}_{self.buy_09_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_09_protections.append(dataframe['ema_50'] > dataframe['ema_200'])\n\n        # Logic\n        buy_09_logic = []\n        buy_09_logic.append(reduce(lambda x, y: x & y, buy_09_protections))\n        #buy_09_logic.append(dataframe['volume_mean_4'] * self.buy_volume_9.value > dataframe['volume'])\n        buy_09_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_9.value)\n        buy_09_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_9.value)\n        buy_09_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_9.value)\n        buy_09_logic.append(dataframe['mfi'] < self.buy_mfi_9.value)\n        buy_09_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_09_trigger'] = reduce(lambda x, y: x & y, buy_09_logic)\n        if self.buy_condition_9_enable.value:\n            conditions.append(dataframe['buy_09_trigger'])\n\n        # Protections\n        buy_10_protections = [True]\n        if self.buy_10_protection__ema_fast.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_10_protection__ema_slow.value:\n            buy_10_protections.append(dataframe[f\"ema_{self.buy_10_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_10_protection__close_above_ema_fast.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_10_protection__close_above_ema_slow.value:\n            buy_10_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_10_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_10_protection__sma200_rising.value:\n            buy_10_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_10_protection__sma200_rising_val.value)))\n        if self.buy_10_protection__sma200_1h_rising.value:\n            buy_10_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_10_protection__sma200_1h_rising_val.value)))\n        if self.buy_10_protection__safe_dips.value:\n            buy_10_protections.append(dataframe[f\"safe_dips_{self.buy_10_protection__safe_dips_type.value}\"])\n        if self.buy_10_protection__safe_pump.value:\n            buy_10_protections.append(dataframe[f\"safe_pump_{self.buy_10_protection__safe_pump_period.value}_{self.buy_10_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_10_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n\n        # Logic\n        buy_10_logic = []\n        buy_10_logic.append(reduce(lambda x, y: x & y, buy_10_protections))\n        buy_10_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_10.value)\n        buy_10_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * self.buy_bb_offset_10.value)\n        buy_10_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_10.value)\n        buy_10_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_10_trigger'] = reduce(lambda x, y: x & y, buy_10_logic)\n        if self.buy_condition_10_enable.value:\n            conditions.append(dataframe['buy_10_trigger'])\n\n        # Protections\n        buy_11_protections = [True]\n        if self.buy_11_protection__ema_fast.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_11_protection__ema_slow.value:\n            buy_11_protections.append(dataframe[f\"ema_{self.buy_11_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_11_protection__close_above_ema_fast.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_11_protection__close_above_ema_slow.value:\n            buy_11_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_11_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_11_protection__sma200_rising.value:\n            buy_11_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_11_protection__sma200_rising_val.value)))\n        if self.buy_11_protection__sma200_1h_rising.value:\n            buy_11_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_11_protection__sma200_1h_rising_val.value)))\n        if self.buy_11_protection__safe_dips.value:\n            buy_11_protections.append(dataframe[f\"safe_dips_{self.buy_11_protection__safe_dips_type.value}\"])\n        if self.buy_11_protection__safe_pump.value:\n            buy_11_protections.append(dataframe[f\"safe_pump_{self.buy_11_protection__safe_pump_period.value}_{self.buy_11_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_11_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        buy_11_protections.append(dataframe['safe_pump_36_50_1h'])\n        buy_11_protections.append(dataframe['safe_pump_48_100_1h'])\n\n        # Logic\n        buy_11_logic = []\n        buy_11_logic.append(reduce(lambda x, y: x & y, buy_11_protections))\n        buy_11_logic.append(((dataframe['close'] - dataframe['open'].rolling(36).min()) / dataframe['open'].rolling(36).min()) > self.buy_min_inc_11.value)\n        buy_11_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_11.value)\n        buy_11_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_max_11.value)\n        buy_11_logic.append(dataframe['rsi'] < self.buy_rsi_11.value)\n        buy_11_logic.append(dataframe['mfi'] < self.buy_mfi_11.value)\n        buy_11_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_11_trigger'] = reduce(lambda x, y: x & y, buy_11_logic)\n        if self.buy_condition_11_enable.value:\n            conditions.append(dataframe['buy_11_trigger'])\n\n        # Protections\n        buy_12_protections = [True]\n        if self.buy_12_protection__ema_fast.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_12_protection__ema_slow.value:\n            buy_12_protections.append(dataframe[f\"ema_{self.buy_12_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_12_protection__close_above_ema_fast.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_12_protection__close_above_ema_slow.value:\n            buy_12_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_12_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_12_protection__sma200_rising.value:\n            buy_12_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_12_protection__sma200_rising_val.value)))\n        if self.buy_12_protection__sma200_1h_rising.value:\n            buy_12_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_12_protection__sma200_1h_rising_val.value)))\n        if self.buy_12_protection__safe_dips.value:\n            buy_12_protections.append(dataframe[f\"safe_dips_{self.buy_12_protection__safe_dips_type.value}\"])\n        if self.buy_12_protection__safe_pump.value:\n            buy_12_protections.append(dataframe[f\"safe_pump_{self.buy_12_protection__safe_pump_period.value}_{self.buy_12_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_12_logic = []\n        buy_12_logic.append(reduce(lambda x, y: x & y, buy_12_protections))\n        #buy_12_logic.append((dataframe['volume_mean_4'] * self.buy_volume_12.value) > dataframe['volume'])\n        buy_12_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_12.value)\n        buy_12_logic.append(dataframe['ewo'] > self.buy_ewo_12.value)\n        buy_12_logic.append(dataframe['rsi'] < self.buy_rsi_12.value)\n        buy_12_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_12_trigger'] = reduce(lambda x, y: x & y, buy_12_logic)\n        if self.buy_condition_12_enable.value:\n            conditions.append(dataframe['buy_12_trigger'])\n\n        # Protections\n        buy_13_protections = [True]\n        if self.buy_13_protection__ema_fast.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_13_protection__ema_slow.value:\n            buy_13_protections.append(dataframe[f\"ema_{self.buy_13_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_13_protection__close_above_ema_fast.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_13_protection__close_above_ema_slow.value:\n            buy_13_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_13_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_13_protection__sma200_rising.value:\n            buy_13_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_13_protection__sma200_rising_val.value)))\n        if self.buy_13_protection__sma200_1h_rising.value:\n            buy_13_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_13_protection__sma200_1h_rising_val.value)))\n        if self.buy_13_protection__safe_dips.value:\n            buy_13_protections.append(dataframe[f\"safe_dips_{self.buy_13_protection__safe_dips_type.value}\"])\n        if self.buy_13_protection__safe_pump.value:\n            buy_13_protections.append(dataframe[f\"safe_pump_{self.buy_13_protection__safe_pump_period.value}_{self.buy_13_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_13_protections.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])\n        #buy_13_protections.append(dataframe['safe_pump_36_loose_1h'])\n\n        # Logic\n        buy_13_logic = []\n        buy_13_logic.append(reduce(lambda x, y: x & y, buy_13_protections))\n        #buy_13_logic.append((dataframe['volume_mean_4'] * self.buy_volume_13.value) > dataframe['volume'])\n        buy_13_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_13.value)\n        buy_13_logic.append(dataframe['ewo'] < self.buy_ewo_13.value)\n        buy_13_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_13_trigger'] = reduce(lambda x, y: x & y, buy_13_logic)\n        if self.buy_condition_13_enable.value:\n            conditions.append(dataframe['buy_13_trigger'])\n\n        # Protections\n        buy_14_protections = [True]\n        if self.buy_14_protection__ema_fast.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_14_protection__ema_slow.value:\n            buy_14_protections.append(dataframe[f\"ema_{self.buy_14_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_14_protection__close_above_ema_fast.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_14_protection__close_above_ema_slow.value:\n            buy_14_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_14_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_14_protection__sma200_rising.value:\n            buy_14_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_14_protection__sma200_rising_val.value)))\n        if self.buy_14_protection__sma200_1h_rising.value:\n            buy_14_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_14_protection__sma200_1h_rising_val.value)))\n        if self.buy_14_protection__safe_dips.value:\n            buy_14_protections.append(dataframe[f\"safe_dips_{self.buy_14_protection__safe_dips_type.value}\"])\n        if self.buy_14_protection__safe_pump.value:\n            buy_14_protections.append(dataframe[f\"safe_pump_{self.buy_14_protection__safe_pump_period.value}_{self.buy_14_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_14_logic = []\n        buy_14_logic.append(reduce(lambda x, y: x & y, buy_14_protections))\n        #buy_14_logic.append(dataframe['volume_mean_4'] * self.buy_volume_14.value > dataframe['volume'])\n        buy_14_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_14_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_14.value))\n        buy_14_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_14_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_14.value))\n        buy_14_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_14.value)\n        buy_14_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_14_trigger'] = reduce(lambda x, y: x & y, buy_14_logic)\n        if self.buy_condition_14_enable.value:\n            conditions.append(dataframe['buy_14_trigger'])\n\n        # Protections\n        buy_15_protections = [True]\n        if self.buy_15_protection__ema_fast.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_15_protection__ema_slow.value:\n            buy_15_protections.append(dataframe[f\"ema_{self.buy_15_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_15_protection__close_above_ema_fast.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_15_protection__close_above_ema_slow.value:\n            buy_15_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_15_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_15_protection__sma200_rising.value:\n            buy_15_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_15_protection__sma200_rising_val.value)))\n        if self.buy_15_protection__sma200_1h_rising.value:\n            buy_15_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_15_protection__sma200_1h_rising_val.value)))\n        if self.buy_15_protection__safe_dips.value:\n            buy_15_protections.append(dataframe[f\"safe_dips_{self.buy_15_protection__safe_dips_type.value}\"])\n        if self.buy_15_protection__safe_pump.value:\n            buy_15_protections.append(dataframe[f\"safe_pump_{self.buy_15_protection__safe_pump_period.value}_{self.buy_15_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_15_protections.append(dataframe['close'] > dataframe['ema_200_1h'] * self.buy_ema_rel_15.value)\n\n        # Logic\n        buy_15_logic = []\n        buy_15_logic.append(reduce(lambda x, y: x & y, buy_15_protections))\n        buy_15_logic.append(dataframe['ema_26'] > dataframe['ema_12'])\n        buy_15_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_ema_open_mult_15.value))\n        buy_15_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))\n        buy_15_logic.append(dataframe['rsi'] < self.buy_rsi_15.value)\n        buy_15_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_15.value)\n        buy_15_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_15_trigger'] = reduce(lambda x, y: x & y, buy_15_logic)\n        if self.buy_condition_15_enable.value:\n            conditions.append(dataframe['buy_15_trigger'])\n\n        # Protections\n        buy_16_protections = [True]\n        if self.buy_16_protection__ema_fast.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_16_protection__ema_slow.value:\n            buy_16_protections.append(dataframe[f\"ema_{self.buy_16_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_16_protection__close_above_ema_fast.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_16_protection__close_above_ema_slow.value:\n            buy_16_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_16_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_16_protection__sma200_rising.value:\n            buy_16_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_16_protection__sma200_rising_val.value)))\n        if self.buy_16_protection__sma200_1h_rising.value:\n            buy_16_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_16_protection__sma200_1h_rising_val.value)))\n        if self.buy_16_protection__safe_dips.value:\n            buy_16_protections.append(dataframe[f\"safe_dips_{self.buy_16_protection__safe_dips_type.value}\"])\n        if self.buy_16_protection__safe_pump.value:\n            buy_16_protections.append(dataframe[f\"safe_pump_{self.buy_16_protection__safe_pump_period.value}_{self.buy_16_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_16_logic = []\n        buy_16_logic.append(reduce(lambda x, y: x & y, buy_16_protections))\n        #buy_16_logic.append((dataframe['volume_mean_4'] * self.buy_volume_16.value) > dataframe['volume'])\n        buy_16_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_16.value)\n        buy_16_logic.append(dataframe['ewo'] > self.buy_ewo_16.value)\n        buy_16_logic.append(dataframe['rsi'] < self.buy_rsi_16.value)\n        buy_16_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_16_trigger'] = reduce(lambda x, y: x & y, buy_16_logic)\n        if self.buy_condition_16_enable.value:\n            conditions.append(dataframe['buy_16_trigger'])\n\n        # Protections\n        buy_17_protections = [True]\n        if self.buy_17_protection__ema_fast.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_17_protection__ema_slow.value:\n            buy_17_protections.append(dataframe[f\"ema_{self.buy_17_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_17_protection__close_above_ema_fast.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_17_protection__close_above_ema_slow.value:\n            buy_17_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_17_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_17_protection__sma200_rising.value:\n            buy_17_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_17_protection__sma200_rising_val.value)))\n        if self.buy_17_protection__sma200_1h_rising.value:\n            buy_17_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_17_protection__sma200_1h_rising_val.value)))\n        if self.buy_17_protection__safe_dips.value:\n            buy_17_protections.append(dataframe[f\"safe_dips_{self.buy_17_protection__safe_dips_type.value}\"])\n        if self.buy_17_protection__safe_pump.value:\n            buy_17_protections.append(dataframe[f\"safe_pump_{self.buy_17_protection__safe_pump_period.value}_{self.buy_17_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_17_logic = []\n        buy_17_logic.append(reduce(lambda x, y: x & y, buy_17_protections))\n        buy_17_logic.append(dataframe['close'] < dataframe['ema_20'] * self.buy_ma_offset_17.value)\n        buy_17_logic.append(dataframe['ewo'] < self.buy_ewo_17.value)\n        buy_17_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_17_trigger'] = reduce(lambda x, y: x & y, buy_17_logic)\n        if self.buy_condition_17_enable.value:\n            conditions.append(dataframe['buy_17_trigger'])\n\n        # Protections\n        buy_18_protections = [True]\n        if self.buy_18_protection__ema_fast.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_18_protection__ema_slow.value:\n            buy_18_protections.append(dataframe[f\"ema_{self.buy_18_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_18_protection__close_above_ema_fast.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_18_protection__close_above_ema_slow.value:\n            buy_18_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_18_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_18_protection__sma200_rising.value:\n            buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_18_protection__sma200_rising_val.value)))\n        if self.buy_18_protection__sma200_1h_rising.value:\n            buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_18_protection__sma200_1h_rising_val.value)))\n        if self.buy_18_protection__safe_dips.value:\n            buy_18_protections.append(dataframe[f\"safe_dips_{self.buy_18_protection__safe_dips_type.value}\"])\n        if self.buy_18_protection__safe_pump.value:\n            buy_18_protections.append(dataframe[f\"safe_pump_{self.buy_18_protection__safe_pump_period.value}_{self.buy_18_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        #buy_18_protections.append(dataframe['ema_100'] > dataframe['ema_200'])\n        buy_18_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(20))\n        buy_18_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(36))\n\n        # Logic\n        buy_18_logic = []\n        buy_18_logic.append(reduce(lambda x, y: x & y, buy_18_protections))\n        #buy_18_logic.append((dataframe['volume_mean_4'] * self.buy_volume_18.value) > dataframe['volume'])\n        buy_18_logic.append(dataframe['rsi'] < self.buy_rsi_18.value)\n        buy_18_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_18.value))\n        buy_18_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_18_trigger'] = reduce(lambda x, y: x & y, buy_18_logic)\n        if self.buy_condition_18_enable.value:\n            conditions.append(dataframe['buy_18_trigger'])\n\n        # Protections\n        buy_19_protections = [True]\n        if self.buy_19_protection__ema_fast.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_19_protection__ema_slow.value:\n            buy_19_protections.append(dataframe[f\"ema_{self.buy_19_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_19_protection__close_above_ema_fast.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_19_protection__close_above_ema_slow.value:\n            buy_19_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_19_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_19_protection__sma200_rising.value:\n            buy_19_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_19_protection__sma200_rising_val.value)))\n        if self.buy_19_protection__sma200_1h_rising.value:\n            buy_19_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_19_protection__sma200_1h_rising_val.value)))\n        if self.buy_19_protection__safe_dips.value:\n            buy_19_protections.append(dataframe[f\"safe_dips_{self.buy_19_protection__safe_dips_type.value}\"])\n        if self.buy_19_protection__safe_pump.value:\n            buy_19_protections.append(dataframe[f\"safe_pump_{self.buy_19_protection__safe_pump_period.value}_{self.buy_19_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_19_protections.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])\n\n        # Logic\n        buy_19_logic = []\n        buy_19_logic.append(reduce(lambda x, y: x & y, buy_19_protections))\n        buy_19_logic.append(dataframe['close'].shift(1) > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['low'] < dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['close'] > dataframe['ema_100_1h'])\n        buy_19_logic.append(dataframe['rsi_1h'] > self.buy_rsi_1h_min_19.value)\n        buy_19_logic.append(dataframe['chop'] < self.buy_chop_min_19.value)\n        buy_19_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_19_trigger'] = reduce(lambda x, y: x & y, buy_19_logic)\n        if self.buy_condition_19_enable.value:\n            conditions.append(dataframe['buy_19_trigger'])\n\n        # Protections\n        buy_20_protections = [True]\n        if self.buy_20_protection__ema_fast.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_20_protection__ema_slow.value:\n            buy_20_protections.append(dataframe[f\"ema_{self.buy_20_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_20_protection__close_above_ema_fast.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_20_protection__close_above_ema_slow.value:\n            buy_20_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_20_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_20_protection__sma200_rising.value:\n            buy_20_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_20_protection__sma200_rising_val.value)))\n        if self.buy_20_protection__sma200_1h_rising.value:\n            buy_20_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_20_protection__sma200_1h_rising_val.value)))\n        if self.buy_20_protection__safe_dips.value:\n            buy_20_protections.append(dataframe[f\"safe_dips_{self.buy_20_protection__safe_dips_type.value}\"])\n        if self.buy_20_protection__safe_pump.value:\n            buy_20_protections.append(dataframe[f\"safe_pump_{self.buy_20_protection__safe_pump_period.value}_{self.buy_20_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_20_logic = []\n        buy_20_logic.append(reduce(lambda x, y: x & y, buy_20_protections))\n        #buy_20_logic.append((dataframe['volume_mean_4'] * self.buy_volume_20.value) > dataframe['volume'])\n        buy_20_logic.append(dataframe['rsi'] < self.buy_rsi_20.value)\n        buy_20_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_20.value)\n        buy_20_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_20_trigger'] = reduce(lambda x, y: x & y, buy_20_logic)\n        if self.buy_condition_20_enable.value:\n            conditions.append(dataframe['buy_20_trigger'])\n\n        # Protections\n        buy_21_protections = [True]\n        if self.buy_21_protection__ema_fast.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_21_protection__ema_slow.value:\n            buy_21_protections.append(dataframe[f\"ema_{self.buy_21_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_21_protection__close_above_ema_fast.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_21_protection__close_above_ema_slow.value:\n            buy_21_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_21_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_21_protection__sma200_rising.value:\n            buy_21_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_21_protection__sma200_rising_val.value)))\n        if self.buy_21_protection__sma200_1h_rising.value:\n            buy_21_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_21_protection__sma200_1h_rising_val.value)))\n        if self.buy_21_protection__safe_dips.value:\n            buy_21_protections.append(dataframe[f\"safe_dips_{self.buy_21_protection__safe_dips_type.value}\"])\n        if self.buy_21_protection__safe_pump.value:\n            buy_21_protections.append(dataframe[f\"safe_pump_{self.buy_21_protection__safe_pump_period.value}_{self.buy_21_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_21_logic = []\n        buy_21_logic.append(reduce(lambda x, y: x & y, buy_21_protections))\n        #buy_21_logic.append((dataframe['volume_mean_4'] * self.buy_volume_21.value) > dataframe['volume'])\n        buy_21_logic.append(dataframe['rsi'] < self.buy_rsi_21.value)\n        buy_21_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_21.value)\n        buy_21_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_21_trigger'] = reduce(lambda x, y: x & y, buy_21_logic)\n        if self.buy_condition_21_enable.value:\n            conditions.append(dataframe['buy_21_trigger'])\n\n        # Protections\n        buy_22_protections = [True]\n        if self.buy_22_protection__ema_fast.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_22_protection__ema_slow.value:\n            buy_22_protections.append(dataframe[f\"ema_{self.buy_22_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_22_protection__close_above_ema_fast.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_22_protection__close_above_ema_slow.value:\n            buy_22_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_22_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_22_protection__sma200_rising.value:\n            buy_22_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_22_protection__sma200_rising_val.value)))\n        if self.buy_22_protection__sma200_1h_rising.value:\n            buy_22_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_22_protection__sma200_1h_rising_val.value)))\n        if self.buy_22_protection__safe_dips.value:\n            buy_22_protections.append(dataframe[f\"safe_dips_{self.buy_22_protection__safe_dips_type.value}\"])\n        if self.buy_22_protection__safe_pump.value:\n            buy_22_protections.append(dataframe[f\"safe_pump_{self.buy_22_protection__safe_pump_period.value}_{self.buy_22_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n        buy_22_protections.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))\n        buy_22_protections.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))\n\n        # Logic\n        buy_22_logic = []\n        buy_22_logic.append(reduce(lambda x, y: x & y, buy_22_protections))\n        buy_22_logic.append((dataframe['volume_mean_4'] * self.buy_volume_22.value) > dataframe['volume'])\n        buy_22_logic.append(dataframe['close'] < dataframe['sma_30'] * self.buy_ma_offset_22.value)\n        buy_22_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_22.value))\n        buy_22_logic.append(dataframe['ewo'] > self.buy_ewo_22.value)\n        buy_22_logic.append(dataframe['rsi'] < self.buy_rsi_22.value)\n        buy_22_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_22_trigger'] = reduce(lambda x, y: x & y, buy_22_logic)\n        if self.buy_condition_22_enable.value:\n            conditions.append(dataframe['buy_22_trigger'])\n\n            # Protections\n        buy_23_protections = [True]\n        if self.buy_23_protection__ema_fast.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_23_protection__ema_slow.value:\n            buy_23_protections.append(dataframe[f\"ema_{self.buy_23_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_23_protection__close_above_ema_fast.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_23_protection__close_above_ema_slow.value:\n            buy_23_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_23_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_23_protection__sma200_rising.value:\n            buy_23_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_23_protection__sma200_rising_val.value)))\n        if self.buy_23_protection__sma200_1h_rising.value:\n            buy_23_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_23_protection__sma200_1h_rising_val.value)))\n        if self.buy_23_protection__safe_dips.value:\n            buy_23_protections.append(dataframe[f\"safe_dips_{self.buy_23_protection__safe_dips_type.value}\"])\n        if self.buy_23_protection__safe_pump.value:\n            buy_23_protections.append(dataframe[f\"safe_pump_{self.buy_23_protection__safe_pump_period.value}_{self.buy_23_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_23_logic = []\n        buy_23_logic.append(reduce(lambda x, y: x & y, buy_23_protections))\n        buy_23_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * self.buy_bb_offset_23.value))\n        buy_23_logic.append(dataframe['ewo'] > self.buy_ewo_23.value)\n        buy_23_logic.append(dataframe['rsi'] < self.buy_rsi_23.value)\n        buy_23_logic.append(dataframe['rsi_1h'] < self.buy_rsi_1h_23.value)\n        buy_23_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_23_trigger'] = reduce(lambda x, y: x & y, buy_23_logic)\n        if self.buy_condition_23_enable.value:\n            conditions.append(dataframe['buy_23_trigger'])\n\n\n        # Protections\n        buy_24_protections = [True]\n        if self.buy_24_protection__ema_fast.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_24_protection__ema_slow.value:\n            buy_24_protections.append(dataframe[f\"ema_{self.buy_24_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_24_protection__close_above_ema_fast.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_24_protection__close_above_ema_slow.value:\n            buy_24_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_24_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_24_protection__sma200_rising.value:\n            buy_24_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_24_protection__sma200_rising_val.value)))\n        if self.buy_24_protection__sma200_1h_rising.value:\n            buy_24_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_24_protection__sma200_1h_rising_val.value)))\n        if self.buy_24_protection__safe_dips.value:\n            buy_24_protections.append(dataframe[f\"safe_dips_{self.buy_24_protection__safe_dips_type.value}\"])\n        if self.buy_24_protection__safe_pump.value:\n            buy_24_protections.append(dataframe[f\"safe_pump_{self.buy_24_protection__safe_pump_period.value}_{self.buy_24_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_24_logic = []\n        buy_24_logic.append(reduce(lambda x, y: x & y, buy_24_protections))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))\n        buy_24_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])\n        buy_24_logic.append(dataframe['cmf_1h'].shift(12) < 0)\n        buy_24_logic.append(dataframe['cmf_1h'] > 0)\n        buy_24_logic.append(dataframe['rsi'] < self.buy_24_rsi_max.value)\n        buy_24_logic.append(dataframe['rsi_1h'] > self.buy_24_rsi_1h_min.value)\n        buy_24_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:, 'buy_24_trigger'] = reduce(lambda x, y: x & y, buy_24_logic)\n        if self.buy_condition_24_enable.value:\n            conditions.append(dataframe['buy_24_trigger'])\n\n        # Protections\n        buy_26_protections = [True]\n        if self.buy_26_protection__ema_fast.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_fast_len.value}\"] > dataframe['ema_200'])\n        if self.buy_26_protection__ema_slow.value:\n            buy_26_protections.append(dataframe[f\"ema_{self.buy_26_protection__ema_slow_len.value}_1h\"] > dataframe['ema_200_1h'])\n        if self.buy_26_protection__close_above_ema_fast.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_fast_len.value}\"])\n        if self.buy_26_protection__close_above_ema_slow.value:\n            buy_26_protections.append(dataframe['close'] > dataframe[f\"ema_{self.buy_26_protection__close_above_ema_slow_len.value}_1h\"])\n        if self.buy_26_protection__sma200_rising.value:\n            buy_26_protections.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(self.buy_26_protection__sma200_rising_val.value)))\n        if self.buy_26_protection__sma200_1h_rising.value:\n            buy_26_protections.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(self.buy_26_protection__sma200_1h_rising_val.value)))\n        if self.buy_26_protection__safe_dips.value:\n            buy_26_protections.append(dataframe[f\"safe_dips_{self.buy_26_protection__safe_dips_type.value}\"])\n        if self.buy_26_protection__safe_pump.value:\n            buy_26_protections.append(dataframe[f\"safe_pump_{self.buy_26_protection__safe_pump_period.value}_{self.buy_26_protection__safe_pump_type.value}_1h\"])\n        # Non-Standard protections (add below)\n\n        # Logic\n        buy_26_logic = []\n        buy_26_logic.append(reduce(lambda x, y: x & y, buy_26_protections))\n        buy_26_logic.append(dataframe['close'] < (dataframe['zema'] * self.buy_26_zema_low_offset.value))\n        buy_26_logic.append(dataframe['volume'] > 0)\n        # Populate\n        dataframe.loc[:,'buy_26_trigger'] = reduce(lambda x, y: x & y, buy_26_logic)\n        if self.buy_condition_26_enable.value:\n            conditions.append(dataframe['buy_26_trigger'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                self.sell_condition_1_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_1.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['close'].shift(3) > dataframe['bb20_2_upp'].shift(3)) &\n                (dataframe['close'].shift(4) > dataframe['bb20_2_upp'].shift(4)) &\n                (dataframe['close'].shift(5) > dataframe['bb20_2_upp'].shift(5)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_2_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_bb_2.value) &\n                (dataframe['close'] > dataframe['bb20_2_upp']) &\n                (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) &\n                (dataframe['close'].shift(2) > dataframe['bb20_2_upp'].shift(2)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_3_enable.value &\n\n                (dataframe['rsi'] > self.sell_rsi_main_3.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_4_enable.value &\n\n                (dataframe['rsi'] > self.sell_dual_rsi_rsi_4.value) &\n                (dataframe['rsi_1h'] > self.sell_dual_rsi_rsi_1h_4.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_6_enable.value &\n\n                (dataframe['close'] < dataframe['ema_200']) &\n                (dataframe['close'] > dataframe['ema_50']) &\n                (dataframe['rsi'] > self.sell_rsi_under_6.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_7_enable.value &\n\n                (dataframe['rsi_1h'] > self.sell_rsi_1h_7.value) &\n                qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26']) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                self.sell_condition_8_enable.value &\n\n                (dataframe['close'] > dataframe['bb20_2_upp_1h'] * self.sell_bb_relative_8.value) &\n\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\n\n# Elliot Wave Oscillator\ndef EWO(dataframe, sma1_length=5, sma2_length=35):\n    df = dataframe.copy()\n    sma1 = ta.EMA(df, timeperiod=sma1_length)\n    sma2 = ta.EMA(df, timeperiod=sma2_length)\n    smadif = (sma1 - sma2) / df['close'] * 100\n    return smadif\n\n# Chaikin Money Flow\ndef chaikin_money_flow(dataframe, n=20, fillna=False):\n    \"\"\"Chaikin Money Flow (CMF)\n    It measures the amount of Money Flow Volume over a specific period.\n    http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf\n    Args:\n        dataframe(pandas.Dataframe): dataframe containing ohlcv\n        n(int): n period.\n        fillna(bool): if True, fill nan values.\n    Returns:\n        pandas.Series: New feature generated.\n    \"\"\"\n    df = dataframe.copy()\n    mfv = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])\n    mfv = mfv.fillna(0.0)  # float division by zero\n    mfv *= df['volume']\n    cmf = (mfv.rolling(n, min_periods=0).sum()\n           / df['volume'].rolling(n, min_periods=0).sum())\n    if fillna:\n        cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)\n    return Series(cmf, name='cmf')\n"
  },
  {
    "path": "strategies/SampleStrategyV2/SampleStrategyV2.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter, merge_informative_pair)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass SampleStrategyV2(IStrategy):\n  \n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.2\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.005\n    trailing_stop_positive_offset = 0.01\n\n    # Hyperoptable parameters\n    buy_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)\n    buy_trend_length = IntParameter(low=50, high=288, default=288, space='buy', optimize=True, load=True)\n    sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True)\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 1000\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {'color': 'blue'},\n            'bb_middleband': {'color': 'red'},\n            'ha_open_sma288': {'color': 'red'},\n            'ha_close_sma288': {'color': 'green'},\n        },\n        'subplots': {\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            },\n            \"trend_dir\": {\n                \"trend_dir\": {'color': 'green', 'type': 'bar'},\n            },\n            \"macd\": {\n                \"macd_1h\": {'color': 'blue'},\n                \"macdsignal_1h\": {'color': 'red'},\n                \"macdhist_1h\": {'color': 'green', 'type': 'bar'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        if not self.dp:\n            return dataframe\n\n        inf_tf = '1h'\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n        macd = ta.MACD(informative)\n        informative['macd'] = macd['macd']\n        informative['macdsignal'] = macd['macdsignal']\n        informative['macdhist'] = macd['macdhist']\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) /\n        #     dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # AVG True Range\n        dataframe['atr'] = ta.ATR(dataframe)\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n        dataframe['ha_open_sma288'] = ta.SMA(dataframe['ha_open'], timeperiod=self.buy_trend_length.value)\n        dataframe['ha_close_sma288'] = ta.SMA(dataframe['ha_close'], timeperiod=self.buy_trend_length.value)\n        dataframe['trend_dir'] = ta.SMA(ta.SMA(dataframe['ha_close_sma288'] - dataframe['ha_open_sma288'], timeperiod=5), timeperiod=5)\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 30\n                (qtpylib.crossed_above(dataframe['rsi'], self.buy_rsi.value)) &\n                (dataframe['trend_dir'] > 0) & # Guard: ha_close_sma288 > ha_open_sma288 uptrend\n                #(dataframe['trend_dir'].shift(12) > dataframe['trend_dir']) &\n                (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 70\n                (qtpylib.crossed_above(dataframe['rsi'], self.sell_rsi.value)) &\n                (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0            \n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Saturn5/Saturn5.py",
    "content": "from datetime import timedelta\nfrom functools import reduce\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.strategy import IStrategy\nfrom pandas import DataFrame\n\n\ndef to_minutes(**timdelta_kwargs):\n    return int(timedelta(**timdelta_kwargs).total_seconds() / 60)\n\n\nclass Saturn5(IStrategy):\n    # Strategy created by Shane Jones https://twitter.com/shanejones\n    #\n    # Assited by a number of contributors https://github.com/shanejones/goddard/graphs/contributors\n    #\n    # Original repo hosted at https://github.com/shanejones/goddard\n    timeframe = \"15m\"\n\n    # Stoploss\n    stoploss = -0.20\n    startup_candle_count: int = 480\n    trailing_stop = False\n    use_custom_stoploss = False\n    use_sell_signal = False\n\n    # signal controls\n    buy_signal_1 = True\n    buy_signal_2 = True\n    buy_signal_3 = True\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.05,\n    }\n\n    # Indicator values:\n\n    # Signal 1\n    s1_ema_xs = 3\n    s1_ema_sm = 5\n    s1_ema_md = 10\n    s1_ema_xl = 50\n    s1_ema_xxl = 240\n\n    # Signal 2\n    s2_ema_input = 50\n    s2_ema_offset_input = -1\n\n    s2_bb_sma_length = 49\n    s2_bb_std_dev_length = 64\n    s2_bb_lower_offset = 3\n\n    s2_fib_sma_len = 50\n    s2_fib_atr_len = 14\n\n    s2_fib_lower_value = 4.236\n\n    s3_ema_long = 50\n    s3_ema_short = 20\n    s3_ma_fast = 10\n    s3_ma_slow = 20\n\n    @property\n    def protections(self):\n        return [\n            {\n                # Don't enter a trade right after selling a trade.\n                \"method\": \"CooldownPeriod\",\n                \"stop_duration\": to_minutes(minutes=0),\n            },\n            {\n                # Stop trading if max-drawdown is reached.\n                \"method\": \"MaxDrawdown\",\n                \"lookback_period\": to_minutes(hours=12),\n                \"trade_limit\": 20,  # Considering all pairs that have a minimum of 20 trades\n                \"stop_duration\": to_minutes(hours=1),\n                \"max_allowed_drawdown\": 0.2,  # If max-drawdown is > 20% this will activate\n            },\n            {\n                # Stop trading if a certain amount of stoploss occurred within a certain time window.\n                \"method\": \"StoplossGuard\",\n                \"lookback_period\": to_minutes(hours=3),\n                \"trade_limit\": 4,  # Considering all pairs that have a minimum of 4 trades\n                \"stop_duration\": to_minutes(hours=6),\n                \"only_per_pair\": False,  # Looks at all pairs\n            },\n            {\n                # Lock pairs with low profits\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period\": to_minutes(hours=1, minutes=30),\n                \"trade_limit\": 2,  # Considering all pairs that have a minimum of 2 trades\n                \"stop_duration\": to_minutes(hours=15),\n                \"required_profit\": 0.02,  # If profit < 2% this will activate for a pair\n            },\n            {\n                # Lock pairs with low profits\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period\": to_minutes(hours=6),\n                \"trade_limit\": 4,  # Considering all pairs that have a minimum of 4 trades\n                \"stop_duration\": to_minutes(minutes=30),\n                \"required_profit\": 0.01,  # If profit < 1% this will activate for a pair\n            },\n        ]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Adding EMA's into the dataframe\n        dataframe[\"s1_ema_xs\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_xs)\n        dataframe[\"s1_ema_sm\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_sm)\n        dataframe[\"s1_ema_md\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_md)\n        dataframe[\"s1_ema_xl\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_xl)\n        dataframe[\"s1_ema_xxl\"] = ta.EMA(dataframe, timeperiod=self.s1_ema_xxl)\n\n        s2_ema_value = ta.EMA(dataframe, timeperiod=self.s2_ema_input)\n        s2_ema_xxl_value = ta.EMA(dataframe, timeperiod=200)\n        dataframe[\"s2_ema\"] = s2_ema_value - s2_ema_value * self.s2_ema_offset_input\n        dataframe[\"s2_ema_xxl_off\"] = s2_ema_xxl_value - s2_ema_xxl_value * self.s2_fib_lower_value\n        dataframe[\"s2_ema_xxl\"] = ta.EMA(dataframe, timeperiod=200)\n\n        s2_bb_sma_value = ta.SMA(dataframe, timeperiod=self.s2_bb_sma_length)\n        s2_bb_std_dev_value = ta.STDDEV(dataframe, self.s2_bb_std_dev_length)\n        dataframe[\"s2_bb_std_dev_value\"] = s2_bb_std_dev_value\n        dataframe[\"s2_bb_lower_band\"] = s2_bb_sma_value - (s2_bb_std_dev_value * self.s2_bb_lower_offset)\n\n        s2_fib_atr_value = ta.ATR(dataframe, timeframe=self.s2_fib_atr_len)\n        s2_fib_sma_value = ta.SMA(dataframe, timeperiod=self.s2_fib_sma_len)\n\n        dataframe[\"s2_fib_lower_band\"] = s2_fib_sma_value - s2_fib_atr_value * self.s2_fib_lower_value\n\n        s3_bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe[\"s3_bb_lowerband\"] = s3_bollinger[\"lower\"]\n\n        dataframe[\"s3_ema_long\"] = ta.EMA(dataframe, timeperiod=self.s3_ema_long)\n        dataframe[\"s3_ema_short\"] = ta.EMA(dataframe, timeperiod=self.s3_ema_short)\n        dataframe[\"s3_fast_ma\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], self.s3_ma_fast) / ta.EMA(\n            dataframe[\"volume\"], self.s3_ma_fast\n        )\n        dataframe[\"s3_slow_ma\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], self.s3_ma_slow) / ta.EMA(\n            dataframe[\"volume\"], self.s3_ma_slow\n        )\n\n        # Volume weighted MACD\n        dataframe[\"fastMA\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], 12) / ta.EMA(dataframe[\"volume\"], 12)\n        dataframe[\"slowMA\"] = ta.EMA(dataframe[\"volume\"] * dataframe[\"close\"], 26) / ta.EMA(dataframe[\"volume\"], 26)\n        dataframe[\"vwmacd\"] = dataframe[\"fastMA\"] - dataframe[\"slowMA\"]\n        dataframe[\"signal\"] = ta.EMA(dataframe[\"vwmacd\"], 9)\n        dataframe[\"hist\"] = dataframe[\"vwmacd\"] - dataframe[\"signal\"]\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # basic buy methods to keep the strategy simple\n\n        if self.buy_signal_1:\n            conditions = [\n                dataframe[\"vwmacd\"] < dataframe[\"signal\"],\n                dataframe[\"low\"] < dataframe[\"s1_ema_xxl\"],\n                dataframe[\"close\"] > dataframe[\"s1_ema_xxl\"],\n                qtpylib.crossed_above(dataframe[\"s1_ema_sm\"], dataframe[\"s1_ema_md\"]),\n                dataframe[\"s1_ema_xs\"] < dataframe[\"s1_ema_xl\"],\n                dataframe[\"volume\"] > 0,\n            ]\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"buy\", \"buy_tag\"]] = (1, \"buy_signal_1\")\n\n        if self.buy_signal_2:\n            conditions = [\n                qtpylib.crossed_above(dataframe[\"s2_fib_lower_band\"], dataframe[\"s2_bb_lower_band\"]),\n                dataframe[\"close\"] < dataframe[\"s2_ema\"],\n                dataframe[\"volume\"] > 0,\n            ]\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"buy\", \"buy_tag\"]] = (1, \"buy_signal_2\")\n\n        if self.buy_signal_3:\n            conditions = [\n                dataframe[\"low\"] < dataframe[\"s3_bb_lowerband\"],\n                dataframe[\"high\"] > dataframe[\"s3_slow_ma\"],\n                dataframe[\"high\"] < dataframe[\"s3_ema_long\"],\n                dataframe[\"volume\"] > 0,\n            ]\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), [\"buy\", \"buy_tag\"]] = (1, \"buy_signal_3\")\n\n        if not all([self.buy_signal_1, self.buy_signal_2, self.buy_signal_3]):\n            dataframe.loc[(), \"buy\"] = 0\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # This is essentailly ignored as we're using strict ROI / Stoploss / TTP sale scenarios\n        dataframe.loc[(), \"sell\"] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/Scalp/Scalp.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Scalp(IStrategy):\n    \"\"\"\n        this strategy is based around the idea of generating a lot of potentatils buys and make tiny profits on each trade\n\n        we recommend to have at least 60 parallel trades at any time to cover non avoidable losses.\n\n        Recommended is to only sell based on ROI for this strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # should not be below 3% loss\n\n    stoploss = -0.04\n    # Optimal timeframe for the strategy\n    # the shorter the better\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['open'] < dataframe['ema_low']) &\n                (dataframe['adx'] > 30) &\n                (\n                    (dataframe['fastk'] < 30) &\n                    (dataframe['fastd'] < 30) &\n                    (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                )\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['open'] >= dataframe['ema_high'])\n            ) |\n            (\n                (qtpylib.crossed_above(dataframe['fastk'], 70)) |\n                (qtpylib.crossed_above(dataframe['fastd'], 70))\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Schism/Schism.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\nclass Schism(IStrategy):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'rmi-slow': 20,\n        'rmi-fast': 20,\n        'mp': 50,\n        'inf-rsi': 30,\n        'inf-pct-adr': 0.8\n    }\n\n    sell_params = {}\n\n    minimal_roi = {\n        \"0\": 0.10,\n        \"15\": 0.05,\n        \"30\": 0.025,\n        \"60\": 0.01,\n        \"120\": 0.005,\n        \"1440\": 0\n    }\n\n    stoploss = -0.40\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=6)\n    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n        informative['1d_high'] = informative['close'].rolling(24).max()\n        informative['3d_low'] = informative['close'].rolling(72).min()\n        informative['adr'] = informative['1d_high'] - informative['3d_low']\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 300))\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n        else:\n            conditions.append(\n                (dataframe[f\"rsi_{self.inf_timeframe}\"] >= params['inf-rsi']) &\n                (dataframe['close'] <= dataframe[f\"3d_low_{self.inf_timeframe}\"] + (params['inf-pct-adr'] * dataframe[f\"adr_{self.inf_timeframe}\"])) &\n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['rmi-slow'] >= params['rmi-slow']) &\n                (dataframe['rmi-fast'] <= params['rmi-fast']) &\n                (dataframe['mp'] <= params['mp'])\n            )\n\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n        \n        if trade_data['active_trade']:\n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &  \n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['volume'].gt(0))\n            )\n            if trade_data['peak_profit'] > 0:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 50))\n            else:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 10))\n\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    hold_pct = (trade_data['free_slots'] / 100) * -1\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    def populate_trades(self, pair: str) -> dict:\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60 \n\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe)\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                total_other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(total_other_profit) \n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * trade_time))\n\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > rate * 1.01:\n            return False\n        return True"
  },
  {
    "path": "strategies/Schism2/Schism2.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom typing import Dict, List, Optional, Tuple\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\n\"\"\"\nSolipsis - By @werkkrew and @JimmyNixx\nThis strategy is an evolution of our previous framework \"Schism\" which we are happy to share by request. \n\nFEATURES:\n    - Sticking buy signal for extending ROI\n        - Idea is to use a completely different buy signal for active trades to force the \"ignore_roi_if_buy_signal = True\" setting to stop a sell to ROI\n          during a strong upward trend.\n            - This is not compatible with backtest or hyperopt and can only be tested in dry-run or live.\n    - Dynamic Sell\n        - Emulates a pre-stoploss bailout when market conditions meet specific criteria, including looking at profit factors, other trade status, etc.\n    - Dynamic informative indicators based on certain stake currences and whitelist contents.\n        - If your stake is BTC or ETH, use COIN/FIAT and BTC/FIAT as informatives.\n    - Full access to current trade and other trade data within buy and sell methods to use in decisions, this is not compatible with backtesting.\n    - Ability to provide custom parameters on a per-pair or group of pairs basis, this includes buy/sell/minimal_roi/dynamic_roi/custom_stop settings, if one desired.\n    - Stub Child strategies for stake specific settings and different settings for different instances.\n\nTODO: \n    - Continue to hunt for a better all around buy signal.\n    - Tweak ROI Ride\n        - Maybe use free_slots as a factor in how eager we are to sell?\n    - Tweak sell signal\n        - Continue to evaluate good circumstances to sell vs hold\n    - Figure out a way to directly feed a daily hyperopt output into a running strategy and reload it?\n    - Per-pair automatic ROI based on ADR or something similar?\n\"\"\"\n\nclass Schism2(IStrategy):\n    \"\"\"\n    Strategy Configuration Items\n    \"\"\"\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.83534,\n        'inf-rsi': 57,\n        'mp': 64,\n        'rmi-fast': 49,\n        'rmi-slow': 24,\n        'xinf-stake-rmi': 45,\n        'xtf-fiat-rsi': 28,\n        'xtf-stake-rsi': 90\n    }\n\n    sell_params = {}\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"10\": 0.025,\n        \"20\": 0.015,\n        \"30\": 0.01,\n        \"720\": 0.005,\n        \"1440\": 0\n    }\n\n    custom_pair_params = []\n\n    stoploss = -0.30\n\n    # Recommended\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    # Startegy Specific Variable Storage\n    custom_trade_info = {}\n    custom_fiat = \"USD\"\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n    \n    \"\"\"\n    Informative Pair Definitions\n    \"\"\"\n    def informative_pairs(self):\n        # add existing pairs from whitelist on the inf_timeframe\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        # add additional informative pairs based on certain stakes\n        if self.config['stake_currency'] in ('BTC', 'ETH'):\n            for pair in pairs:\n                # add in the COIN/FIAT pairs (e.g. XLM/USD) on base timeframe\n                coin, stake = pair.split('/')\n                coin_fiat = f\"{coin}/{self.custom_fiat}\"\n                informative_pairs += [(coin_fiat, self.timeframe)]\n\n            # add in the STAKE/FIAT pair (e.g. BTC/USD) on base and inf timeframes\n            stake_fiat = f\"{self.config['stake_currency']}/{self.custom_fiat}\"\n            informative_pairs += [(stake_fiat, self.timeframe)]\n            informative_pairs += [(stake_fiat, self.inf_timeframe)]\n\n        return informative_pairs\n\n    \"\"\"\n    Indicator Definitions\n    \"\"\" \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        # Set up primary indicators\n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n\n        # Momentum Pinball\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=6)\n\n        # Trend Calculations    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        # Informative for STAKE/FIAT and COIN/FIAT on default timeframe, only relevant if stake currency is BTC or ETH\n        if self.config['stake_currency'] in ('BTC', 'ETH'):\n            coin, stake = metadata['pair'].split('/')\n            fiat = self.custom_fiat\n            coin_fiat = f\"{coin}/{fiat}\"\n            stake_fiat = f\"{stake}/{fiat}\"\n\n            # COIN/FIAT (e.g. XLM/USD) - timeframe\n            coin_fiat_tf = self.dp.get_pair_dataframe(pair=coin_fiat, timeframe=self.timeframe)\n            dataframe[f\"{fiat}_rsi\"] = ta.RSI(coin_fiat_tf, timeperiod=14)\n\n            # STAKE/FIAT (e.g. BTC/USD) - inf_timeframe\n            stake_fiat_tf = self.dp.get_pair_dataframe(pair=stake_fiat, timeframe=self.timeframe)\n            stake_fiat_inf_tf = self.dp.get_pair_dataframe(pair=stake_fiat, timeframe=self.inf_timeframe)\n\n            dataframe[f\"{stake}_rsi\"] = ta.RSI(stake_fiat_tf, timeperiod=14)\n            dataframe[f\"{stake}_rmi_{self.inf_timeframe}\"] = RMI(stake_fiat_inf_tf, length=21, mom=5)\n\n        # Informative indicators for current pair on inf_timeframe\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n\n        informative['1d_high'] = informative['close'].rolling(24).max()\n        informative['3d_low'] = informative['close'].rolling(72).min()\n        informative['adr'] = informative['1d_high'] - informative['3d_low']\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    \"\"\"\n    Buy Trigger Signals\n    \"\"\"\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'buy')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # Persist a buy signal for existing trades to make use of ignore_roi_if_buy_signal = True\n        # when this buy signal is not present a sell can happen according to the defined ROI table\n        if trade_data['active_trade']:\n            # peak_profit factor f(x)=1-x/400, rmi 30 -> 0.925, rmi 80 -> 0.80\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 400))\n            # grow from 30 -> 70 after 720 minutes starting after 180 minutes\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n\n        # Normal buy triggers that apply to new trades we want to enter\n        else:\n            # Primary buy triggers\n            conditions.append(\n                # \"buy the dip\" based buy signal using momentum pinball and downward RMI\n                (dataframe['close'] <= dataframe[f\"3d_low_{self.inf_timeframe}\"] + (params['inf-pct-adr'] * dataframe[f\"adr_{self.inf_timeframe}\"])) &\n                (dataframe[f\"rsi_{self.inf_timeframe}\"] >= params['inf-rsi']) &\n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['rmi-slow'] >= params['rmi-slow']) &\n                (dataframe['rmi-fast'] <= params['rmi-fast']) &\n                (dataframe['mp'] <= params['mp'])\n            )\n\n            # If the stake is BTC or ETH apply additional conditions\n            if self.config['stake_currency'] in ('BTC', 'ETH'):\n                # default timeframe conditions\n                conditions.append(\n                    (dataframe[f\"{self.config['stake_currency']}_rsi\"] < params['xtf-stake-rsi']) | \n                    (dataframe[f\"{self.custom_fiat}_rsi\"] > params['xtf-fiat-rsi'])\n                )\n                # informative timeframe conditions\n                conditions.append(dataframe[f\"{self.config['stake_currency']}_rmi_{self.inf_timeframe}\"] < params['xinf-stake-rmi'])\n\n        # Anything below here applies to persisting and new buy signal\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Sell Trigger Signals\n    \"\"\"\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'sell')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # In this strategy all sells for profit happen according to ROI\n        # This sell signal is designed only as a \"dynamic stoploss\"\n\n        # if we are in an active trade for this pair\n        if trade_data['active_trade']:     \n            # grow from -0.03 -> 0 after 300 minutes starting immediately\n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            # if we are at a loss, consider what the trend looks and preempt the stoploss\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &  \n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['volume'].gt(0))\n            )\n            \n            # if the peak profit was positive at some point but never reached ROI, set a higher cross point for exit\n            if trade_data['peak_profit'] > 0:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 50))\n            # if the trade was always negative, the bounce we expected didn't happen\n            else:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 10))\n\n            # if there are other open trades in addition to this one, consider the average profit \n            # across them all and how many free slots we have in our sell decision\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    \"\"\"\n                    Less free slots, more willing to sell\n                    1 / free_slots * x = \n                    1 slot = 1/1 * -0.04 = -0.04 -> only allow sells if avg_other_proift above -0.04\n                    4 slot = 1/4 * -0.04 = -0.01 -> only allow sells is avg_other_profit above -0.01\n                    \"\"\"\n                    max_market_down = -0.04 \n                    hold_pct = (1/trade_data['free_slots']) * max_market_down\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    # if were out of slots, allow the biggest losing trade to sell regardless of avg profit\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        # Impossible condition to satisfy the bot when it looks here and theres no active trade\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    \"\"\"\n    Super Legit Custom Methods\n    \"\"\"\n    # Populate trades_data from the database\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                # get how long the trade has been open in minutes and candles\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60  # floor\n\n                # set up the things we use in the strategy\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe) # floor\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            # if there are open trades not including the current pair, get some information\n            # future reference, for *all* open trades: open_trades = Trade.get_open_trades()\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                # find which of our trades is the biggest loser\n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            # get the number of free trade slots, storing in every pairs dict due to laziness\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    # Get the current price from the exchange (or cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    # linear growth, starts at X and grows to Y after A minutes (starting after B miniutes)\n    # f(t) = X + (rate * t), where rate = (Y - X) / (A - B)\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * time))\n\n    \"\"\"\n    Allow for buy/sell override parameters per pair. Testing, might remove.\n    \"\"\"\n    def get_pair_params(self, pair: str, params: str) -> Dict:\n        buy_params = self.buy_params\n        sell_params = self.sell_params\n        minimal_roi = self.minimal_roi\n  \n        if self.custom_pair_params:\n            custom_params = next(item for item in self.custom_pair_params if pair in item['pairs'])\n            if custom_params['buy_params']:\n                buy_params = custom_params['buy_params']\n            if custom_params['sell_params']:\n                sell_params = custom_params['sell_params']\n            if custom_params['minimal_roi']:\n                custom_stop = custom_params['minimal_roi']\n            \n        if params == 'buy':\n            return buy_params\n        if params == 'sell':\n            return sell_params\n        if params == 'minimal_roi':\n            return minimal_roi\n\n    \"\"\"\n    Price protection on trade entry and timeouts, built-in Freqtrade functionality\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n    \"\"\"\n    ROI overrides for per-pair params\n    \"\"\"\n    def min_roi_reached_entry(self, trade_dur: int, pair: str = 'backtest') -> Tuple[Optional[int], Optional[float]]:\n        minimal_roi = self.get_pair_params(pair, 'minimal_roi')\n\n        roi_list = list(filter(lambda x: x <= trade_dur, minimal_roi.keys()))\n        if not roi_list:\n            return None, None\n        roi_entry = max(roi_list)\n\n        return roi_entry, minimal_roi[roi_entry]\n\n    def min_roi_reached(self, trade: Trade, current_profit: float, current_time: datetime) -> bool:  \n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\n        _, roi = self.min_roi_reached_entry(trade_dur, trade.pair)\n        if roi is None:\n            return False\n        else:\n            return current_profit > roi\n\n\"\"\"\nSub-strategy overrides\nAnything not explicity defined here will follow the settings in the base strategy\n\"\"\"\n# Sub-strategy with parameters specific to BTC stake\nclass Schism2_BTC(Schism2):\n\n    timeframe = '15m'\n    inf_timeframe = '1h'\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"30\": 0.025,\n        \"60\": 0.015,\n        \"90\": 0.01,\n        \"1440\": 0.005,\n        \"2880\": 0\n    }\n\n    buy_params = {\n        'inf-pct-adr': 0.80616,\n        'inf-rsi': 14,\n        'mp': 43,\n        'rmi-fast': 33,\n        'rmi-slow': 16,\n        'xinf-stake-rmi': 29,\n        'xtf-fiat-rsi': 49,\n        'xtf-stake-rsi': 53\n    }\n\n    use_sell_signal = False\n\n# Sub-strategy with parameters specific to ETH stake\nclass Schism2_ETH(Schism2):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.81628,\n        'inf-rsi': 13,\n        'xinf-stake-rmi': 69,\n        'mp': 40,\n        'rmi-fast': 42,\n        'rmi-slow': 17,\n        'xtf-fiat-rsi': 15,\n        'xtf-stake-rsi': 92\n    }\n\n    use_sell_signal = False"
  },
  {
    "path": "strategies/Schism2MM/Schism2MM.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\nfrom scipy.signal import argrelextrema\n\nclass Schism2MM(IStrategy):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.95,\n        'inf-rsi': 65,\n        'mp': 53,\n        'rmi-fast': 41,\n        'rmi-slow': 33\n    }\n\n    sell_params = {}\n\n    minimal_roi = {\n        \"0\": 0.025,\n        \"10\": 0.015,\n        \"20\": 0.01,\n        \"30\": 0.005,\n        \"120\": 0\n    }\n\n    stoploss = -0.99\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=6)\n    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n        informative['1d_high'] = informative['close'].rolling(24).max()\n        informative['3d_low'] = informative['close'].rolling(72).min()\n        informative['adr'] = informative['1d_high'] - informative['3d_low']\n        \n        min_peaks = argrelextrema(dataframe['close'].values, np.less, order=100)\n\n        for mp in min_peaks[0]:\n             dataframe.at[mp, 'buy_signal'] = True\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 300))\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n        else:\n            conditions.append(\n                (dataframe[f\"rsi_{self.inf_timeframe}\"] >= params['inf-rsi']) &\n                (dataframe['close'] <= dataframe[f\"3d_low_{self.inf_timeframe}\"] + (params['inf-pct-adr'] * dataframe[f\"adr_{self.inf_timeframe}\"])) &\n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['rmi-slow'] >= params['rmi-slow']) &\n                (dataframe['rmi-fast'] <= params['rmi-fast']) &\n                (dataframe['mp'] <= params['mp'])\n            )\n\n        conditions.append(dataframe['volume'].gt(0))\n        conditions.append(dataframe['buy_signal'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n        \n        if trade_data['active_trade']:\n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &  \n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['volume'].gt(0))\n            )\n            if trade_data['peak_profit'] > 0:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 50))\n            else:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 10))\n\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    hold_pct = (trade_data['free_slots'] / 100) * -1\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    def populate_trades(self, pair: str) -> dict:\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60 \n\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe)\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n        return trade_data\n\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * trade_time))\n\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > rate * 1.01:\n            return False\n        return True"
  },
  {
    "path": "strategies/Schism3/Schism3.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom typing import Dict, List, Optional, Tuple\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\n\"\"\"\nTODO: \n\n\"\"\"\n\nclass Schism3(IStrategy):\n    \"\"\"\n    Strategy Configuration Items\n    \"\"\"\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    # Global Buy/Sell Params\n    buy_params = {\n        'bounce-lookback': 8,\n        'bounce-price': 'min',\n        'down-inf-rsi': 37,\n        'down-mp': 60,\n        'down-rmi-fast': 28,\n        'down-rmi-slow': 35,\n        'up-inf-rsi': 59,\n        'xinf-stake-rmi': 70,\n        'xtf-fiat-rsi': 15,\n        'xtf-stake-rsi': 60\n    }\n\n    sell_params = {\n        'rmi-high': 50,\n        'rmi-low': 10\n    }\n\n    # Pair Specific Buy/Sell Params\n    buy_params_FOO = {}\n    sell_params_FOO = {}\n\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"10\": 0.025,\n        \"20\": 0.015,\n        \"30\": 0.01,\n        \"720\": 0.005,\n        \"1440\": 0\n    }\n\n    stoploss = -0.30\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    # Startegy Specific Variable Storage\n    custom_trade_info = {}\n    custom_fiat = \"USD\"\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n    \n    \"\"\"\n    Informative Pair Definitions\n    \"\"\"\n    def informative_pairs(self):\n        # add existing pairs from whitelist on the inf_timeframe\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        # add additional informative pairs based on certain stakes\n        if self.config['stake_currency'] in ('BTC', 'ETH'):\n            for pair in pairs:\n                # add in the COIN/FIAT pairs (e.g. XLM/USD) on base timeframe\n                coin, stake = pair.split('/')\n                coin_fiat = f\"{coin}/{self.custom_fiat}\"\n                informative_pairs += [(coin_fiat, self.timeframe)]\n\n            # add in the STAKE/FIAT pair (e.g. BTC/USD) on base and inf timeframes\n            stake_fiat = f\"{self.config['stake_currency']}/{self.custom_fiat}\"\n            informative_pairs += [(stake_fiat, self.timeframe)]\n            informative_pairs += [(stake_fiat, self.inf_timeframe)]\n\n        return informative_pairs\n\n\n    \"\"\"\n    Indicator Definitions\n    \"\"\" \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        # Relative Momentum Index\n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n\n        # Momentum Pinball\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=6)\n\n        # Trend Calculations    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        # Informative for STAKE/FIAT and COIN/FIAT on default timeframe, only relevant if stake currency is BTC or ETH\n        if self.config['stake_currency'] in ('BTC', 'ETH'):\n            coin, stake = metadata['pair'].split('/')\n            fiat = self.custom_fiat\n            coin_fiat = f\"{coin}/{fiat}\"\n            stake_fiat = f\"{stake}/{fiat}\"\n\n            # COIN/FIAT (e.g. XLM/USD) - timeframe\n            coin_fiat_tf = self.dp.get_pair_dataframe(pair=coin_fiat, timeframe=self.timeframe)\n            dataframe[f\"{fiat}_rsi\"] = ta.RSI(coin_fiat_tf, timeperiod=14)\n\n            # STAKE/FIAT (e.g. BTC/USD) - inf_timeframe\n            stake_fiat_tf = self.dp.get_pair_dataframe(pair=stake_fiat, timeframe=self.timeframe)\n            stake_fiat_inf_tf = self.dp.get_pair_dataframe(pair=stake_fiat, timeframe=self.inf_timeframe)\n\n            dataframe[f\"{stake}_rsi\"] = ta.RSI(stake_fiat_tf, timeperiod=14)\n            dataframe[f\"{stake}_rmi_{self.inf_timeframe}\"] = RMI(stake_fiat_inf_tf, length=21, mom=5)\n\n        # Informative indicators for current pair on inf_timeframe\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    \"\"\"\n    Buy Trigger Signals\n    \"\"\"\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'buy')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # Set up a pre-buy condition that we sort of \"cache\"\n        dataframe['bounce-pending'] = np.where(\n            (dataframe[f\"rsi_{self.inf_timeframe}\"] >= params['down-inf-rsi']) &\n            (dataframe['rmi-dn-trend'] == 1) &\n            (dataframe['rmi-slow'] >= params['down-rmi-slow']) &\n            (dataframe['rmi-fast'] <= params['down-rmi-fast']) &\n            (dataframe['mp'] <= params['down-mp']),\n            1,0\n        )\n\n        # Capture the price where we got the signal that a bounce would happen\n        dataframe['bounce-price'] = np.where(\n            dataframe['bounce-pending'] == 1, \n            dataframe['close'], \n            getattr(dataframe['close'].rolling(params['bounce-lookback'], min_periods=1), params['bounce-price'])()\n        )\n\n        # Count how many times our pre-bounce happned in the last \"lookback\" candles\n        dataframe['bounce-range'] = np.where(dataframe['bounce-pending'].rolling(params['bounce-lookback'], min_periods=1).sum() >= 1,1,0) \n\n        # Persist a buy signal for existing trades to make use of ignore_roi_if_buy_signal = True\n        # when this buy signal is not present a sell can happen according to the defined ROI table\n        if trade_data['active_trade']:\n            # peak_profit factor f(x)=1-x/400, rmi 30 -> 0.925, rmi 80 -> 0.80\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 400))\n            # grow from 30 -> 70 after 720 minutes starting after 180 minutes\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n\n        # Normal buy triggers that apply to new trades we want to enter\n        else:\n            conditions.append(\n                (dataframe[f\"rsi_{self.inf_timeframe}\"] >= params['up-inf-rsi']) &\n                (dataframe['bounce-range'] == 1) &\n                (dataframe['rmi-up-trend'] == 1) &\n                (dataframe['close'] >= dataframe['bounce-price'])\n            )\n\n            # If the stake is BTC or ETH apply additional conditions\n            if self.config['stake_currency'] in ('BTC', 'ETH'):\n                # default timeframe conditions\n                conditions.append(\n                    (dataframe[f\"{self.config['stake_currency']}_rsi\"] < params['xtf-stake-rsi']) | \n                    (dataframe[f\"{self.custom_fiat}_rsi\"] > params['xtf-fiat-rsi'])\n                )\n                # informative timeframe conditions\n                conditions.append(dataframe[f\"{self.config['stake_currency']}_rmi_{self.inf_timeframe}\"] < params['xinf-stake-rmi'])\n\n        # Anything below here applies to persisting and new buy signal\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Sell Trigger Signals:\n        In this strategy all sells for profit happen according to ROI\n        This sell signal is designed only as a \"dynamic stoploss\"\n    \"\"\"\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'sell')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # add additional conditions based on time and profit\n        if trade_data['active_trade']:     \n            # give some wiggle room for the trade to go negative a little bit before selling\n            # grow from -0.03 -> 0 after 300 minutes starting immediately\n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            # if we are at a loss, consider what the trend looks and preempt the stoploss\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &\n                (dataframe['rmi-dn-trend'] == 1) & \n                (dataframe['volume'].gt(0))\n            )\n\n            # if the peak profit was positive at some point but never reached ROI, set a higher cross point for exit\n            if trade_data['peak_profit'] > 0:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], params['rmi-high']))\n            # if the trade was always negative, the bounce we expected didn't happen\n            else:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], params['rmi-low']))\n\n            # if we have other trades, consider their profit and the # of free slots in the sell\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    \"\"\"\n                    Less free slots, more willing to sell\n                    1 / free_slots * x = \n                    1 slot = 1/1 * -0.04 = -0.04 -> only allow sells if avg_other_proift above -0.04\n                    4 slot = 1/4 * -0.04 = -0.01 -> only allow sells is avg_other_profit above -0.01\n                    \"\"\"\n                    max_market_down = -0.04 \n                    hold_pct = (1/trade_data['free_slots']) * max_market_down\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    # if were out of slots, allow the biggest losing trade to sell regardless of avg profit\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        # Impossible condition to satisfy the bot when it looks here and theres no active trade\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                      \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    \"\"\"\n    Custom Methods\n    \"\"\"\n    # Populate trades_data from the database\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n        self.custom_trade_info['meta'] = {}\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                # get how long the trade has been open in minutes and candles\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60  # floor\n\n                # set up the things we use in the strategy\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe) # floor\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            # if there are open trades not including the current pair, get some information\n            # future reference, for *all* open trades: open_trades = Trade.get_open_trades()\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                # find which of our trades is the biggest loser\n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            # get the number of free trade slots, storing in every pairs dict due to laziness\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    # Get the current price from the exchange (or cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    \"\"\"\n    Simple linear growth function: \n        Starts at X and grows to Y after A minutes (starting after B miniutes)\n        f(t) = X + (rate * t), where rate = (Y - X) / (B - A)\n    \"\"\"\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * time))\n\n    \"\"\"\n    Allow for buy/sell override parameters per pair. Testing, might remove.\n    TODO:\n        If good: make this more robust so you never have to edit this method.\n        Consider: per-pair ROI if it seems worthwhile?\n    \"\"\"\n    def get_pair_params(self, pair: str, side: str) -> Dict:\n        buy_params = self.buy_params\n        sell_params = self.sell_params\n  \n        ### Stake: USD\n        if pair in ('ABC/XYZ', 'DEF/XYZ'):\n            buy_params = self.buy_params_GROUP1\n            sell_params = self.sell_params_GROUP1\n        elif pair in ('QRD/WTF'):\n            buy_params = self.buy_params_QRD\n            sell_params = self.sell_params_QRD\n\n        if side == 'sell':\n            return sell_params\n\n        return buy_params\n\n    \"\"\"\n    Price protection on trade entry and timeouts, built-in Freqtrade functionality\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n\"\"\"\nSub-strategy overrides\nAnything not explicity defined here will follow the settings in the base strategy\n\"\"\"\n# Sub-strategy with parameters specific to BTC stake\nclass Schism3_BTC(Schism3):\n\n    timeframe = '1h'\n    inf_timeframe = '4h'\n\n    buy_params = {\n        'inf-rsi': 64,\n        'mp': 55,\n        'rmi-fast': 31,\n        'rmi-slow': 16,\n        'xinf-stake-rmi': 67,\n        'xtf-fiat-rsi': 17,\n        'xtf-stake-rsi': 57\n    }\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"240\": 0.025,\n        \"1440\": 0.01,\n        \"4320\": 0\n    }\n\n    use_sell_signal = False\n\n# Sub-strategy with parameters specific to ETH stake\nclass Schism3_ETH(Schism3):\n\n    timeframe = '1h'\n    inf_timeframe = '4h'\n\n    buy_params = {\n        'inf-rsi': 13,\n        'inf-stake-rmi': 69,\n        'mp': 40,\n        'rmi-fast': 42,\n        'rmi-slow': 17,\n        'tf-fiat-rsi': 15,\n        'tf-stake-rsi': 92\n    }\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"240\": 0.025,\n        \"1440\": 0.01,\n        \"4320\": 0\n    }\n\n    use_sell_signal = False"
  },
  {
    "path": "strategies/Schism4/Schism4.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom typing import Dict, List, Optional, Tuple\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\n\"\"\"\nTODO: \n\n\"\"\"\n\nclass Schism4(IStrategy):\n    \"\"\"\n    Strategy Configuration Items\n    \"\"\"\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    # Global Buy/Sell Params\n    buy_params = {\n        'inf-rsi': 58,\n        'mp': 26,\n        'rmi-fast': 11,\n        'rmi-slow': 55,\n        'xinf-stake-rmi': 25,\n        'xtf-fiat-rsi': 64,\n        'xtf-stake-rsi': 90\n    }\n\n    sell_params = {\n        'rmi-high': 50,\n        'rmi-low': 10\n    }\n\n    # Pair Specific Buy/Sell Params\n    buy_params_FOO = {}\n    sell_params_FOO = {}\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"10\": 0.025,\n        \"20\": 0.015,\n        \"30\": 0.01,\n        \"720\": 0.005,\n        \"1440\": 0\n    }\n\n    stoploss = -0.30\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    # Startegy Specific Variable Storage\n    custom_trade_info = {}\n    custom_fiat = \"USD\"\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n    \n    \"\"\"\n    Informative Pair Definitions\n    \"\"\"\n    def informative_pairs(self):\n        # add existing pairs from whitelist on the inf_timeframe\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        # add additional informative pairs based on certain stakes\n        if self.config['stake_currency'] in ('BTC', 'ETH'):\n            for pair in pairs:\n                # add in the COIN/FIAT pairs (e.g. XLM/USD) on base timeframe\n                coin, stake = pair.split('/')\n                coin_fiat = f\"{coin}/{self.custom_fiat}\"\n                informative_pairs += [(coin_fiat, self.timeframe)]\n\n            # add in the STAKE/FIAT pair (e.g. BTC/USD) on base and inf timeframes\n            stake_fiat = f\"{self.config['stake_currency']}/{self.custom_fiat}\"\n            informative_pairs += [(stake_fiat, self.timeframe)]\n            informative_pairs += [(stake_fiat, self.inf_timeframe)]\n\n        return informative_pairs\n\n    \"\"\"\n    Indicator Definitions\n    \"\"\" \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        # Relative Momentum Index\n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n\n        # Momentum Pinball\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=6)\n\n        # Trend Calculations    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        # Informative for STAKE/FIAT and COIN/FIAT on default timeframe, only relevant if stake currency is BTC or ETH\n        if self.config['stake_currency'] in ('BTC', 'ETH'):\n            coin, stake = metadata['pair'].split('/')\n            fiat = self.custom_fiat\n            coin_fiat = f\"{coin}/{fiat}\"\n            stake_fiat = f\"{stake}/{fiat}\"\n\n            # COIN/FIAT (e.g. XLM/USD) - timeframe\n            coin_fiat_tf = self.dp.get_pair_dataframe(pair=coin_fiat, timeframe=self.timeframe)\n            dataframe[f\"{fiat}_rsi\"] = ta.RSI(coin_fiat_tf, timeperiod=14)\n\n            # STAKE/FIAT (e.g. BTC/USD) - inf_timeframe\n            stake_fiat_tf = self.dp.get_pair_dataframe(pair=stake_fiat, timeframe=self.timeframe)\n            stake_fiat_inf_tf = self.dp.get_pair_dataframe(pair=stake_fiat, timeframe=self.inf_timeframe)\n\n            dataframe[f\"{stake}_rsi\"] = ta.RSI(stake_fiat_tf, timeperiod=14)\n            dataframe[f\"{stake}_rmi_{self.inf_timeframe}\"] = RMI(stake_fiat_inf_tf, length=21, mom=5)\n\n        # Informative indicators for current pair on inf_timeframe\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    \"\"\"\n    Buy Trigger Signals\n    \"\"\"\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'buy')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # Persist a buy signal for existing trades to make use of ignore_roi_if_buy_signal = True\n        # when this buy signal is not present a sell can happen according to the defined ROI table\n        if trade_data['active_trade']:\n            # peak_profit factor f(x)=1-x/400, rmi 30 -> 0.925, rmi 80 -> 0.80\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 400))\n            # grow from 30 -> 70 after 720 minutes starting after 180 minutes\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n\n        # Normal buy triggers that apply to new trades we want to enter\n        else:\n            conditions.append(\n                (dataframe[f\"rsi_{self.inf_timeframe}\"] <= params['inf-rsi']) &\n                (dataframe['rmi-up-trend'] == 1) &\n                (dataframe['rmi-slow'] <= params['rmi-slow']) &\n                (dataframe['rmi-fast'] >= params['rmi-fast']) &\n                (dataframe['mp'] >= params['mp'])\n            )\n\n            # If the stake is BTC or ETH apply additional conditions\n            if self.config['stake_currency'] in ('BTC', 'ETH'):\n                # default timeframe conditions\n                conditions.append(\n                    (dataframe[f\"{self.config['stake_currency']}_rsi\"] < params['xtf-stake-rsi']) | \n                    (dataframe[f\"{self.custom_fiat}_rsi\"] > params['xtf-fiat-rsi'])\n                )\n                # informative timeframe conditions\n                conditions.append(dataframe[f\"{self.config['stake_currency']}_rmi_{self.inf_timeframe}\"] < params['xinf-stake-rmi'])\n\n        # Anything below here applies to persisting and new buy signal\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Sell Trigger Signals:\n        In this strategy all sells for profit happen according to ROI\n        This sell signal is designed only as a \"dynamic stoploss\"\n    \"\"\"\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'sell')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # add additional conditions based on time and profit\n        if trade_data['active_trade']:     \n            # give some wiggle room for the trade to go negative a little bit before selling\n            # grow from -0.03 -> 0 after 300 minutes starting immediately\n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            # if we are at a loss, consider what the trend looks and preempt the stoploss\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &\n                (dataframe['rmi-dn-trend'] == 1) & \n                (dataframe['volume'].gt(0))\n            )\n\n            # if the peak profit was positive at some point but never reached ROI, set a higher cross point for exit\n            if trade_data['peak_profit'] > 0:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], params['rmi-high']))\n            # if the trade was always negative, the bounce we expected didn't happen\n            else:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], params['rmi-low']))\n\n            # if we have other trades, consider their profit and the # of free slots in the sell\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    \"\"\"\n                    Less free slots, more willing to sell\n                    1 / free_slots * x = \n                    1 slot = 1/1 * -0.04 = -0.04 -> only allow sells if avg_other_proift above -0.04\n                    4 slot = 1/4 * -0.04 = -0.01 -> only allow sells is avg_other_profit above -0.01\n                    \"\"\"\n                    max_market_down = -0.04 \n                    hold_pct = (1/trade_data['free_slots']) * max_market_down\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    # if were out of slots, allow the biggest losing trade to sell regardless of avg profit\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        # Impossible condition to satisfy the bot when it looks here and theres no active trade\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                      \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    \"\"\"\n    Custom Methods\n    \"\"\"\n    # Populate trades_data from the database\n    def populate_trades(self, pair: str) -> dict:\n        # Initialize the trades dict if it doesn't exist, persist it otherwise\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        # init the temp dicts and set the trade stuff to false\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n        self.custom_trade_info['meta'] = {}\n\n        # active trade stuff only works in live and dry, not backtest\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            # find out if we have an open trade for this pair\n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            # if so, get some information\n            if active_trade:\n                # get current price and update the min/max rate\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                # get how long the trade has been open in minutes and candles\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60  # floor\n\n                # set up the things we use in the strategy\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe) # floor\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            # if there are open trades not including the current pair, get some information\n            # future reference, for *all* open trades: open_trades = Trade.get_open_trades()\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                # find which of our trades is the biggest loser\n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            # get the number of free trade slots, storing in every pairs dict due to laziness\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    # Get the current price from the exchange (or cache)\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            # Check if cache has been invalidated\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    \"\"\"\n    Simple linear growth function: \n        Starts at X and grows to Y after A minutes (starting after B miniutes)\n        f(t) = X + (rate * t), where rate = (Y - X) / (B - A)\n    \"\"\"\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * time))\n\n    \"\"\"\n    Allow for buy/sell override parameters per pair. Testing, might remove.\n    TODO:\n        If good: make this more robust so you never have to edit this method.\n        Consider: per-pair ROI if it seems worthwhile?\n    \"\"\"\n    def get_pair_params(self, pair: str, side: str) -> Dict:\n        buy_params = self.buy_params\n        sell_params = self.sell_params\n  \n        ### Stake: USD\n        if pair in ('ABC/XYZ', 'DEF/XYZ'):\n            buy_params = self.buy_params_GROUP1\n            sell_params = self.sell_params_GROUP1\n        elif pair in ('QRD/WTF'):\n            buy_params = self.buy_params_QRD\n            sell_params = self.sell_params_QRD\n\n        if side == 'sell':\n            return sell_params\n\n        return buy_params\n\n    \"\"\"\n    Price protection on trade entry and timeouts, built-in Freqtrade functionality\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        # Cancel sell order if price is more than 1% below the order.\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        # Cancel buy order if price is more than 1% above the order.\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n\"\"\"\nSub-strategy overrides\nAnything not explicity defined here will follow the settings in the base strategy\n\"\"\"\n# Sub-strategy with parameters specific to BTC stake\nclass Schism4_BTC(Schism4):\n\n    timeframe = '1h'\n    inf_timeframe = '4h'\n\n    buy_params = {\n        'inf-rsi': 64,\n        'mp': 55,\n        'rmi-fast': 31,\n        'rmi-slow': 16,\n        'xinf-stake-rmi': 67,\n        'xtf-fiat-rsi': 17,\n        'xtf-stake-rsi': 57\n    }\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"240\": 0.025,\n        \"1440\": 0.01,\n        \"4320\": 0\n    }\n\n    use_sell_signal = False\n\n# Sub-strategy with parameters specific to ETH stake\nclass Schism4_ETH(Schism4):\n\n    timeframe = '1h'\n    inf_timeframe = '4h'\n\n    buy_params = {\n        'inf-rsi': 13,\n        'inf-stake-rmi': 69,\n        'mp': 40,\n        'rmi-fast': 42,\n        'rmi-slow': 17,\n        'tf-fiat-rsi': 15,\n        'tf-stake-rsi': 92\n    }\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"240\": 0.025,\n        \"1440\": 0.01,\n        \"4320\": 0\n    }\n\n    use_sell_signal = False"
  },
  {
    "path": "strategies/Schism5/Schism5.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom typing import Dict, List, Optional, Tuple\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\nclass Schism5(IStrategy):\n    \"\"\"\n    Strategy Configuration Items\n    \"\"\"\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'bear-buy-rsi': 49, \n        'bull-buy-rsi': 39\n    }\n\n    sell_params = {\n        'bear-sell-rsi': 86, \n        'bull-sell-rsi': 86\n    }\n\n    minimal_roi = {\n        \"0\": 0.14025,\n        \"34\": 0.08031,\n        \"86\": 0.03995,\n        \"203\": 0\n    }\n\n    stoploss = -0.30\n    use_custom_stoploss = True\n    custom_stop_ramp_minutes = 110\n    custom_stop_trailing = 0.001\n\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300)\n    \n    \"\"\"\n    Informative Pair Definitions\n    \"\"\"\n    def informative_pairs(self):\n        # add existing pairs from whitelist on the inf_timeframe\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    \"\"\"\n    Indicator Definitions\n    \"\"\" \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n        \n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n   \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        dataframe['bull'] = dataframe[f\"rsi_{self.inf_timeframe}\"].gt(60).astype('int') * 20\n\n        return dataframe\n\n    \"\"\"\n    Buy Trigger Signals\n    \"\"\"\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'buy')\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 400))\n            rmi_grow = self.linear_growth(30, 70, 0, 240, trade_data['open_minutes'])\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n\n        else:\n \n             conditions.append(\n                ((dataframe['bull'] > 0) & qtpylib.crossed_below(dataframe['rsi'], params['bull-buy-rsi'])) |\n                (~(dataframe['bull'] > 0) & qtpylib.crossed_below(dataframe['rsi'], params['bear-buy-rsi']))\n            )\n            \n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Sell Trigger Signals\n    \"\"\"\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.get_pair_params(metadata['pair'], 'sell')\n        conditions = []\n\n        conditions.append(\n            ((dataframe['bull'] > 0) & (dataframe['rsi'] > params['bull-sell-rsi'])) |\n            (~(dataframe['bull'] > 0) & (dataframe['rsi'] > params['bear-sell-rsi']))\n        )\n\n        conditions.append(dataframe['volume'].gt(0))\n            \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n\n        since_open = current_time - trade.open_date\n\n        sl_pct = 1 - (max(min(since_open / timedelta(minutes=self.custom_stop_ramp_minutes), 1), 0))**3\n        sl_ramp = self.stoploss * sl_pct\n\n        return min(0, sl_ramp) - self.custom_stop_trailing\n\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n    \"\"\"\n    Custom Methods\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n        self.custom_trade_info['meta'] = {}\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60\n\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe)\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * time))\n\n    def get_pair_params(self, pair: str, side: str) -> Dict:\n        buy_params = self.buy_params\n        sell_params = self.sell_params\n  \n        ### Stake: USD\n        if pair in ('ABC/XYZ', 'DEF/XYZ'):\n            buy_params = self.buy_params_GROUP1\n            sell_params = self.sell_params_GROUP1\n        elif pair in ('QRD/WTF'):\n            buy_params = self.buy_params_QRD\n            sell_params = self.sell_params_QRD\n\n        if side == 'sell':\n            return sell_params\n\n        return buy_params\n\n\nclass Schism5_BTC(Schism5):\n\n    timeframe = '1h'\n    inf_timeframe = '4h'\n\n    buy_params = {\n        'inf-rsi': 64,\n        'mp': 55,\n        'rmi-fast': 31,\n        'rmi-slow': 16,\n        'xinf-stake-rmi': 67,\n        'xtf-fiat-rsi': 17,\n        'xtf-stake-rsi': 57\n    }\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"240\": 0.025,\n        \"1440\": 0.01,\n        \"4320\": 0\n    }\n\n    use_sell_signal = False\n\nclass Schism5_ETH(Schism5):\n\n    timeframe = '1h'\n    inf_timeframe = '4h'\n\n    buy_params = {\n        'inf-rsi': 13,\n        'inf-stake-rmi': 69,\n        'mp': 40,\n        'rmi-fast': 42,\n        'rmi-slow': 17,\n        'tf-fiat-rsi': 15,\n        'tf-stake-rsi': 92\n    }\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"240\": 0.025,\n        \"1440\": 0.01,\n        \"4320\": 0\n    }\n\n    use_sell_signal = False"
  },
  {
    "path": "strategies/Schism6/Schism6.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\nclass Schism6(IStrategy):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.86884,\n        'inf-rsi': 65,\n        'mp': 53,\n        'rmi-fast': 41,\n        'rmi-slow': 33\n    }\n\n    sell_params = {}\n\n    minimal_roi = {\n        \"0\": 0.025,\n        \"10\": 0.015,\n        \"20\": 0.01,\n        \"30\": 0.005,\n        \"120\": 0\n    }\n\n    stoploss = -0.5\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=6)\n    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n        informative['1d_high'] = informative['close'].rolling(24).max()\n        informative['3d_low'] = informative['close'].rolling(72).min()\n        informative['adr'] = informative['1d_high'] - informative['3d_low']\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 300))\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n        else:\n            conditions.append(\n                (dataframe[f\"rsi_{self.inf_timeframe}\"] >= params['inf-rsi']) &\n                (dataframe['close'] <= dataframe[f\"3d_low_{self.inf_timeframe}\"] + (params['inf-pct-adr'] * dataframe[f\"adr_{self.inf_timeframe}\"])) &\n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['rmi-slow'] >= params['rmi-slow']) &\n                (dataframe['rmi-fast'] <= params['rmi-fast']) &\n                (dataframe['mp'] <= params['mp'])\n            )\n\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n        \n        if trade_data['active_trade']:\n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &  \n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['volume'].gt(0))\n            )\n            if trade_data['peak_profit'] > 0:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 50))\n            else:\n                conditions.append(qtpylib.crossed_below(dataframe['rmi-slow'], 10))\n\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    hold_pct = (trade_data['free_slots'] / 100) * -1\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    def populate_trades(self, pair: str) -> dict:\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60 \n\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe)\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n        return trade_data\n\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * time))\n\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > rate * 1.01:\n            return False\n        return True"
  },
  {
    "path": "strategies/Seb/Seb.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, IntParameter\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\nimport numpy # noqa\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass Seb(IStrategy):\n    \"\"\"\n    Strategy 001\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy001\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_volumeAVG = IntParameter(low=50, high=300, default=70, space='buy', optimize=True)\n    buy_rsi = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n    buy_fastd = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n    buy_fishRsiNorma = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n\n    sell_rsi = IntParameter(low=1, high=100, default=70, space='sell', optimize=True)\n    sell_minusDI = IntParameter(low=1, high=100, default=50, space='sell', optimize=True)\n    sell_fishRsiNorma = IntParameter(low=1, high=100, default=50, space='sell', optimize=True)\n    sell_trigger = CategoricalParameter([\"rsi-macd-minusdi\", \"sar-fisherRsi\"],\n                                        default=30, space='sell', optimize=True)\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fastd\": 1,\n        \"buy_fishRsiNorma\": 5,\n        \"buy_rsi\": 26,\n        \"buy_volumeAVG\": 150,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fishRsiNorma\": 30,\n        \"sell_minusDI\": 4,\n        \"sell_rsi\": 74,\n        \"sell_trigger\": \"rsi-macd-minusdi\",\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n\n\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['rsi'] = ta.RSI(dataframe)\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        bollinger = ta.BBANDS(dataframe, timeperiod=20, nbdevup=2.0, nbdevdn=2.0)\n        dataframe['bb_lowerband'] = bollinger['lowerband']\n        dataframe['bb_middleband'] = bollinger['middleband']\n        dataframe['bb_upperband'] = bollinger['upperband']\n\n        # Stoch\n        stoch = ta.STOCH(dataframe)\n        dataframe['slowk'] = stoch['slowk']\n\n        # Commodity Channel Index: values Oversold:<-100, Overbought:>100\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        # Stoch\n        stoch = ta.STOCHF(dataframe, 5)\n        dataframe['fastd'] = stoch['fastd']\n        dataframe['fastk'] = stoch['fastk']\n        dataframe['fastk-previous'] = dataframe.fastk.shift(1)\n        dataframe['fastd-previous'] = dataframe.fastd.shift(1)\n\n        # Slow Stoch\n        slowstoch = ta.STOCHF(dataframe, 50)\n        dataframe['slowfastd'] = slowstoch['fastd']\n        dataframe['slowfastk'] = slowstoch['fastk']\n        dataframe['slowfastk-previous'] = dataframe.slowfastk.shift(1)\n        dataframe['slowfastd-previous'] = dataframe.slowfastd.shift(1)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n\n        # SAR Parabol\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # Hammer: values [0, 100]\n        dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n\n        # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema20'], dataframe['ema50']) &\n                (dataframe['ha_close'] > dataframe['ema20']) &\n                (dataframe['ha_open'] < dataframe['ha_close'])  # green bar\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema50'], dataframe['ema100']) &\n                (dataframe['ha_close'] < dataframe['ema20']) &\n                (dataframe['ha_open'] > dataframe['ha_close'])  # red bar\n            ),\n            'sell'] = 1\n        return dataframe\n\n"
  },
  {
    "path": "strategies/Simple/Simple.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Simple(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n        this strategy is based on the book, 'The Simple Strategy' and can be found in detail here:\n\n        https://www.amazon.com/Simple-Strategy-Powerful-Trading-Futures-ebook/dp/B00E66QPCG/ref=sr_1_1?ie=UTF8&qid=1525202675&sr=8-1&keywords=the+simple+strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=7)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=12, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                        (dataframe['macd'] > 0)  # over 0\n                        & (dataframe['macd'] > dataframe['macdsignal'])  # over signal\n                        & (dataframe['bb_upperband'] > dataframe['bb_upperband'].shift(1))  # pointed up\n                        & (dataframe['rsi'] > 70)  # optional filter, need to investigate\n                )\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # different strategy used for sell points, due to be able to duplicate it to 100%\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 80)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/SlowPotato/SlowPotato.py",
    "content": "# SlowPotato is a slow order strategy based on averages (5 days) executed on 5m interval \n# the premise is to buy once the average low (5 days) is reached or lower and wait for sell trigger once the average high (5 days) is reached or higher \n\n# If you want to help with this small endevor please reach me via discord jadex#0557\n\n# If you want to show your support donations are always accepted \n# BTC = 13PustEinvinjud3wCARGHqz34j3GAifjC\n# ETH (ERC20) = 0x1b2aaceff8e4475f28280186553c07286e7e3e53\n\n\n\n## Suggestions and improvements always welcome.\n### Version 0.1\n###  to do list / things to be implemented:\n### Hyperopt not profitable currently\n### sorting of pairs by profit spread\n### find a faster/better way to average the High/low for 1 day data for 5 days\n### if a day passes after buying with no sell rerun average high based on 5 day average high\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.util import resample_to_interval, resampled_merge\n\nimport logging\nlogger = logging.getLogger(__name__)\n\nclass SlowPotato(IStrategy):\n    \"\"\"\n    This strategy uses the averages for the last 5 days high/low and sets up buy and sell orders acordingly\n    Currently developing and testing this strategy\n    \"\"\"\n\n    minimal_roi = { #if you overide this it will sell once it reaches a certain ROI threshold rather than the sell logic\n        \"0\":  99\n    }\n    \n    stoploss = -0.99\n    \n    # Optimal timeframe for the strategy \n    timeframe = '5m'\n    \n    # trailing stoploss \n    trailing_stop = True\n    trailing_stop_positive = 0.02\n    trailing_stop_positive_offset = 0.03\n    \n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n    \n    # Optional order type mapping\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n        \n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n        }\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        If close candle breaks lower or equal to average low for last 5 days buy it\n        \"\"\"\n        \n        dataframe.loc[\n            (\n                #(dataframe['high'].rolling(1440).mean() / dataframe['low'].rolling(1440).mean() >= 1.05) & ## average spread is #% of profit\n                (dataframe['low'] <= dataframe['low'].rolling(1440).mean()) & ## current dataframe is below average low\n                (dataframe['volume'] > 0) # volume above zero\n            )\n        ,'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        If open candle breaks higher or equal to average high for last 5 days sell it\n        \"\"\"\n\n        dataframe.loc[\n            (\n                (dataframe['high'] >= dataframe['high'].rolling(1440).mean()) & ## current dataframe is above average high\n                (dataframe['volume'] > 0) # volume above zero\n            )\n        ,'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/Slowbro/Slowbro.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n# --------------------------------\n\n\"\"\"\n                   ,-'\"-.\n             __...| .\".  |\n        ,--+\"     ' |   ,'\n       | .'   ..--,  `-' `.\n       |/    |  ,' |       :\n       |\\...-+-\".._|       |\n     ,\"            `--.     `.     _..-'+\"/__\n    /   .              |      :,-\"'     `\" |_'\n ..| .    _,....___,'  |    ,'            /\\\n..\\'.__.-'  /V     |   '                ,'\"\"\n`. |  `:  \\.       |  .               ,'         ,.-.\n  `:       |       |  '             .^.        ,' ,\"`.\n    `.     |       | /               _.\\.---..'  /   |     ,-,.\n      `._  A      / j              .\"       /   /    |   .',' |\n         `. `...-' ,'             /        /._ /     | ,' /   |\n           |\"-----'             ,'        /   /-.__  |'  /    |\n           | _.--'\"'\"\"`.       .         /   /     `\"^-.,     |\n           |\"       ____\\     j             j            `\"--.|\n           |  _.-\"\"'     \\    |             |                j\n         _,+.\"_           \\   |             |                |\n        '    . `.     _.-\"'.     ,          |                '\n       |_    | `.`. ,'      `.   |          |               .\n       | `-. |  ,'.\\         .\\   \\         |              /\n       |\\   ;+-'   \"\\      ,'  `.  \\        |             /\n       '\\\\.\"         \\ _.-'     ,`. \\       '            /\n        \\\\\\           :       .'   `.`._     \\          / `-..-.\n         ``.          |    _.\" _...,:.._`.    `._     ,'   -. \\'\n          `.`.        |`\".'__.'           `,...__\"--`/  |   / |\n            `.`.     _'    \\|             ,'       ,'_  `..'  |..__,.\n              `._`--\".'     \\`._      _,-'       ,' `-'  /    | .  ,'\n                 `\"\"'        `. `\"'\"\"'   ,-\" _,-'    _ .'     '  `' `.\n                               `-.._____:  |\"       _,\" .\"  ,'__,..\"'\n                                         `.|-...,.<'    `,_\"\"'`./\n                                             `.'   `\"--'\" mh\nSLOWBRO v100\n\n\"\"\"\n\n\nclass Slowbro(IStrategy):\n\n    minimal_roi = {\n         \"0\": 0.10,\n         \"1440\": 0.20,\n         \"2880\": 0.30,\n         \"10080\": 1.0\n    }\n\n    # Stoploss:\n    stoploss = -0.99\n\n    timeframe = '1h'\n    inf_timeframe = '1d'\n\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    startup_candle_count: int = 30\n    process_only_new_candles = False\n\n    def informative_pairs(self):\n        # add all whitelisted pairs on informative timeframe\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['30d-low'] = informative['close'].rolling(30).min()\n        informative['30d-high'] = informative['close'].rolling(30).max()\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['close'],dataframe[f\"30d-low_{self.inf_timeframe}\"])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['close'],dataframe[f\"30d-high_{self.inf_timeframe}\"])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SmoothOperator/SmoothOperator.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\n# DO NOT USE, just playing with smooting and graphs!\n\n\nclass SmoothOperator(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    idea:\n\n    The concept is about combining several common indicators, with a heavily smoothing, while trying to detect\n    a none completed peak shape.\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # we only sell after 100%, unless our sell points are found before\n    minimal_roi = {\n        \"0\": 0.10\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # should be converted to a trailing stop loss\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        ##################################################################################\n        # required for entry and exit\n        # CCI\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=20)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n        dataframe['mfi_smooth'] = ta.EMA(dataframe, timeperiod=11, price='mfi')\n        dataframe['cci_smooth'] = ta.EMA(dataframe, timeperiod=11, price='cci')\n        dataframe['rsi_smooth'] = ta.EMA(dataframe, timeperiod=11, price='rsi')\n\n        ##################################################################################\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        ##################################################################################\n        # required for entry\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=1.6)\n        dataframe['entry_bb_lowerband'] = bollinger['lower']\n        dataframe['entry_bb_upperband'] = bollinger['upper']\n        dataframe['entry_bb_middleband'] = bollinger['mid']\n\n        dataframe['bpercent'] = (dataframe['close'] - dataframe['bb_lowerband']) / (\n                dataframe['bb_upperband'] - dataframe['bb_lowerband']) * 100\n\n        dataframe['bsharp'] = (dataframe['bb_upperband'] - dataframe['bb_lowerband']) / (\n            dataframe['bb_middleband'])\n\n        # these seem to be kind useful to measure when bands widen\n        # but than they are directly based on the moving average\n        dataframe['bsharp_slow'] = ta.SMA(dataframe, price='bsharp', timeperiod=11)\n        dataframe['bsharp_medium'] = ta.SMA(dataframe, price='bsharp', timeperiod=8)\n        dataframe['bsharp_fast'] = ta.SMA(dataframe, price='bsharp', timeperiod=5)\n\n        ##################################################################################\n        # rsi and mfi are slightly weighted\n        dataframe['mfi_rsi_cci_smooth'] = (dataframe['rsi_smooth'] * 1.125 + dataframe['mfi_smooth'] * 1.125 +\n                                           dataframe[\n                                               'cci_smooth']) / 3\n\n        dataframe['mfi_rsi_cci_smooth'] = ta.TEMA(dataframe, timeperiod=21, price='mfi_rsi_cci_smooth')\n\n        # playgound\n        dataframe['candle_size'] = (dataframe['close'] - dataframe['open']) * (\n                dataframe['close'] - dataframe['open']) / 2\n\n        # helps with pattern recognition\n        dataframe['average'] = (dataframe['close'] + dataframe['open'] + dataframe['high'] + dataframe['low']) / 4\n        dataframe['sma_slow'] = ta.SMA(dataframe, timeperiod=200, price='close')\n        dataframe['sma_medium'] = ta.SMA(dataframe, timeperiod=100, price='close')\n        dataframe['sma_fast'] = ta.SMA(dataframe, timeperiod=50, price='close')\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n\n                # protection against pump and dump\n                #     (dataframe['volume'] < (dataframe['volume'].rolling(window=30).mean().shift(1) * 20))\n                #\n                #     & (dataframe['macd'] < dataframe['macdsignal'])\n                #     & (dataframe['macd'] > 0)\n\n                # # spike below entry band for 3 consecutive ticks\n                # & (dataframe['low'] < dataframe['entry_bb_lowerband'])\n                # & (dataframe['low'].shift(1) < dataframe['bb_lowerband'].shift(1))\n                # & (dataframe['low'].shift(2) < dataframe['bb_lowerband'].shift(2))\n                # # pattern recognition\n                # & (\n                #         (dataframe['close'] > dataframe['open'])\n                #         | (dataframe['CDLHAMMER'] == 100)\n                #         | (dataframe['CDLINVERTEDHAMMER'] == 100)\n                #         | (dataframe['CDLDRAGONFLYDOJI'] == 100)\n                # )\n                # bottom curve detection\n                # & (dataframe['mfi_rsi_cci_smooth'] < 0)\n                #\n                # |\n\n                (\n                    # simple v bottom shape (lopsided to the left to increase reactivity)\n                    # which has to be below a very slow average\n                    # this pattern only catches a few, but normally very good buy points\n                    (\n                            (dataframe['average'].shift(5) > dataframe['average'].shift(4))\n                            & (dataframe['average'].shift(4) > dataframe['average'].shift(3))\n                            & (dataframe['average'].shift(3) > dataframe['average'].shift(2))\n                            & (dataframe['average'].shift(2) > dataframe['average'].shift(1))\n                            & (dataframe['average'].shift(1) < dataframe['average'].shift(0))\n                            & (dataframe['low'].shift(1) < dataframe['bb_middleband'])\n                            & (dataframe['cci'].shift(1) < -100)\n                            & (dataframe['rsi'].shift(1) < 30)\n\n                    )\n                    |\n                    # buy in very oversold conditions\n                    (\n                            (dataframe['low'] < dataframe['bb_middleband'])\n                            & (dataframe['cci'] < -200)\n                            & (dataframe['rsi'] < 30)\n                            & (dataframe['mfi'] < 30)\n                    )\n\n                    |\n                    # etc tends to trade like this\n                    # over very long periods of slowly building up coins\n                    # does not happen often, but once in a while\n                    (\n                            (dataframe['mfi'] < 10)\n                            & (dataframe['cci'] < -150)\n                            & (dataframe['rsi'] < dataframe['mfi'])\n                    )\n\n                )\n\n                &\n                # ensure we have an overall uptrend\n                (dataframe['close'] > dataframe['close'].shift())\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # different strategy used for sell points, due to be able to duplicate it to 100%\n        dataframe.loc[\n            (\n                (\n                    #   This generates very nice sale points, and mostly sit's one stop behind\n                    #   the top of the peak\n                    (\n                        (dataframe['mfi_rsi_cci_smooth'] > 100)\n                        & (dataframe['mfi_rsi_cci_smooth'].shift(1) > dataframe['mfi_rsi_cci_smooth'])\n                        & (dataframe['mfi_rsi_cci_smooth'].shift(2) < dataframe['mfi_rsi_cci_smooth'].shift(1))\n                        & (dataframe['mfi_rsi_cci_smooth'].shift(3) < dataframe['mfi_rsi_cci_smooth'].shift(2))\n                    )\n                    |\n                    #   This helps with very long, sideways trends, to get out of a market before\n                    #   it dumps\n                    (\n                        StrategyHelper.eight_green_candles(dataframe)\n                    )\n                    |\n                    # in case of very overbought market, like some one pumping\n                    # sell\n                    (\n                        (dataframe['cci'] > 200)\n                        & (dataframe['rsi'] > 70)\n                    )\n                )\n\n            ),\n            'sell'] = 1\n        return dataframe\n\n\nclass StrategyHelper:\n    \"\"\"\n        simple helper class to predefine a couple of patterns for our\n        strategy\n    \"\"\"\n\n    @staticmethod\n    def seven_green_candles(dataframe):\n        \"\"\"\n            evaluates if we are having 7 green candles in a row\n        :param self:\n        :param dataframe:\n        :return:\n        \"\"\"\n        return (\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift(1) < dataframe['close'].shift(1)) &\n                (dataframe['open'].shift(2) < dataframe['close'].shift(2)) &\n                (dataframe['open'].shift(3) < dataframe['close'].shift(3)) &\n                (dataframe['open'].shift(4) < dataframe['close'].shift(4)) &\n                (dataframe['open'].shift(5) < dataframe['close'].shift(5)) &\n                (dataframe['open'].shift(6) < dataframe['close'].shift(6)) &\n                (dataframe['open'].shift(7) < dataframe['close'].shift(7))\n        )\n\n    @staticmethod\n    def eight_green_candles(dataframe):\n        \"\"\"\n            evaluates if we are having 8 green candles in a row\n        :param self:\n        :param dataframe:\n        :return:\n        \"\"\"\n        return (\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift(1) < dataframe['close'].shift(1)) &\n                (dataframe['open'].shift(2) < dataframe['close'].shift(2)) &\n                (dataframe['open'].shift(3) < dataframe['close'].shift(3)) &\n                (dataframe['open'].shift(4) < dataframe['close'].shift(4)) &\n                (dataframe['open'].shift(5) < dataframe['close'].shift(5)) &\n                (dataframe['open'].shift(6) < dataframe['close'].shift(6)) &\n                (dataframe['open'].shift(7) < dataframe['close'].shift(7)) &\n                (dataframe['open'].shift(8) < dataframe['close'].shift(8))\n        )\n\n    @staticmethod\n    def eight_red_candles(dataframe, shift=0):\n        \"\"\"\n            evaluates if we are having 8 red candles in a row\n        :param self:\n        :param dataframe:\n        :param shift: shift the pattern by n\n        :return:\n        \"\"\"\n        return (\n                (dataframe['open'].shift(shift) > dataframe['close'].shift(shift)) &\n                (dataframe['open'].shift(1 + shift) > dataframe['close'].shift(1 + shift)) &\n                (dataframe['open'].shift(2 + shift) > dataframe['close'].shift(2 + shift)) &\n                (dataframe['open'].shift(3 + shift) > dataframe['close'].shift(3 + shift)) &\n                (dataframe['open'].shift(4 + shift) > dataframe['close'].shift(4 + shift)) &\n                (dataframe['open'].shift(5 + shift) > dataframe['close'].shift(5 + shift)) &\n                (dataframe['open'].shift(6 + shift) > dataframe['close'].shift(6 + shift)) &\n                (dataframe['open'].shift(7 + shift) > dataframe['close'].shift(7 + shift)) &\n                (dataframe['open'].shift(8 + shift) > dataframe['close'].shift(8 + shift))\n        )\n\n    @staticmethod\n    def four_green_one_red_candle(dataframe):\n        \"\"\"\n            evaluates if we are having a red candle and 4 previous green\n        :param self:\n        :param dataframe:\n        :return:\n        \"\"\"\n        return (\n                (dataframe['open'] > dataframe['close']) &\n                (dataframe['open'].shift(1) < dataframe['close'].shift(1)) &\n                (dataframe['open'].shift(2) < dataframe['close'].shift(2)) &\n                (dataframe['open'].shift(3) < dataframe['close'].shift(3)) &\n                (dataframe['open'].shift(4) < dataframe['close'].shift(4))\n        )\n\n    @staticmethod\n    def four_red_one_green_candle(dataframe):\n        \"\"\"\n            evaluates if we are having a green candle and 4 previous red\n        :param self:\n        :param dataframe:\n        :return:\n        \"\"\"\n        return (\n                (dataframe['open'] < dataframe['close']) &\n                (dataframe['open'].shift(1) > dataframe['close'].shift(1)) &\n                (dataframe['open'].shift(2) > dataframe['close'].shift(2)) &\n                (dataframe['open'].shift(3) > dataframe['close'].shift(3)) &\n                (dataframe['open'].shift(4) > dataframe['close'].shift(4))\n        )\n"
  },
  {
    "path": "strategies/SmoothScalp/SmoothScalp.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy  # noqa\n\n\nclass SmoothScalp(IStrategy):\n    \"\"\"\n        this strategy is based around the idea of generating a lot of potentatils buys and make tiny profits on each trade\n\n        we recommend to have at least 60 parallel trades at any time to cover non avoidable losses\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.01\n    }\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # should not be below 3% loss\n\n    stoploss = -0.5\n    # Optimal timeframe for the strategy\n    # the shorter the better\n    timeframe = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=20)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                        (dataframe['open'] < dataframe['ema_low']) &\n                        (dataframe['adx'] > 30) &\n                        (dataframe['mfi'] < 30) &\n                        (\n                                (dataframe['fastk'] < 30) &\n                                (dataframe['fastd'] < 30) &\n                                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                        ) &\n                        (dataframe['cci'] < -150)\n                )\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (\n                            (\n                                (dataframe['open'] >= dataframe['ema_high'])\n\n                            ) |\n                            (\n                                    (qtpylib.crossed_above(dataframe['fastk'], 70)) |\n                                    (qtpylib.crossed_above(dataframe['fastd'], 70))\n\n                            )\n                    ) & (dataframe['cci'] > 150)\n            )\n            ,\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Stavix2/Stavix2.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nfrom technical.indicators import ichimoku\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Stavix2(IStrategy):\n    minimal_roi = {\n        \"0\": 0.15\n    }\n    stoploss = -0.10\n\n    ticker_interval = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        cloud = ichimoku(dataframe, conversion_line_period=200, base_line_periods=350, laggin_span=150, displacement=75)\n        dataframe['tenkan_sen'] = cloud['tenkan_sen']\n        dataframe['kijun_sen'] = cloud['kijun_sen']\n        dataframe['senkou_span_a'] = cloud['senkou_span_a']\n        dataframe['senkou_span_b'] = cloud['senkou_span_b']\n        dataframe['chikou_span'] = cloud['chikou_span']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n                (\n                    (dataframe['close'] > dataframe['senkou_span_a']) &\n                    (dataframe['close'] > dataframe['senkou_span_b']) & \n                    (qtpylib.crossed_above(dataframe['kijun_sen'], dataframe['tenkan_sen']))\n                    ),\n                'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n                (\n                    (dataframe['close'] < dataframe['senkou_span_a']) &\n                    (dataframe['close'] < dataframe['senkou_span_b']) & \n                    (qtpylib.crossed_above(dataframe['tenkan_sen'], dataframe['kijun_sen']))\n                    ),\n                'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Stinkfist/Stinkfist.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport technical.indicators as ti\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom typing import Dict, List, Optional, Tuple\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom statistics import mean\nfrom cachetools import TTLCache\nfrom collections import namedtuple\n\n\n\"\"\"\nLoosely based on:\nhttps://github.com/nicolay-zlobin/jesse-indicators/blob/main/strategies/BadStreak/__init__.py\n\nTODO:\n    - Move custom indicators out to helper file or freqtrade/technical?\n\n\"\"\"\n\nclass Stinkfist(IStrategy):\n    \"\"\"\n    Strategy Configuration Items\n    \"\"\"\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.80,\n        'mp': 30\n    }\n\n    sell_params = {}\n\n    minimal_roi = {\n        \"0\": 0.05,\n        \"10\": 0.025,\n        \"20\": 0.015,\n        \"30\": 0.01,\n        \"720\": 0.005,\n        \"1440\": 0\n    }\n\n    stoploss = -0.40\n\n    # Probably don't change these\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 72\n\n    # Custom Dicts for storing trade data and other custom things this strategy does\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n    \n    \"\"\"\n    Informative Pair Definitions\n    \"\"\"\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    \"\"\"\n    Indicator Definitions\n    \"\"\" \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n    \n        # Set up primary indicators\n        dataframe['rmi-slow'] = ti.RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = ti.RMI(dataframe, length=8, mom=4)\n\n        # MA Streak\n        dataframe['mac'] = self.mac(dataframe, 20, 50)\n        dataframe['streak'] = self.ma_streak(dataframe, period=4)\n\n        streak = abs(int(dataframe['streak'].iloc[-1]))\n        streak_back_close = dataframe['close'].shift(streak + 1)\n\n        dataframe['streak-roc'] = 100 * (dataframe['close'] - streak_back_close) / streak_back_close\n\n        # Percent Change Channel\n        pcc = self.pcc(dataframe, period=20, mult=2)\n        dataframe['pcc-lowerband'] = pcc.lowerband\n\n        # Momentum Pinball\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=1)\n        dataframe['mp']  = ta.RSI(dataframe['roc'], timeperiod=3)\n\n        # Trend Calculations    \n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        # Informative indicators for current pair on inf_timeframe\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['1d_high'] = informative['close'].rolling(24).max()\n        informative['3d_low'] = informative['close'].rolling(72).min()\n        informative['adr'] = informative['1d_high'] - informative['3d_low']\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    \"\"\"\n    Buy Trigger Signals\n    \"\"\"\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 300))\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n\n        else:\n            # Primary buy triggers\n            conditions.append(\n                # informative timeframe conditions\n                (dataframe['close'] <= dataframe[f\"3d_low_{self.inf_timeframe}\"] + (params['inf-pct-adr'] * dataframe[f\"adr_{self.inf_timeframe}\"])) &\n                # default timeframe conditions\n                (dataframe['mp'] < params['mp']) &\n                (dataframe['streak-roc'] > dataframe['pcc-lowerband']) &\n                (dataframe['mac'] == 1)\n            )\n\n        # Anything below here applies to persisting and new buy signal\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Sell Trigger Signals\n    \"\"\"\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:     \n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            conditions.append(\n                (trade_data['current_profit'] < loss_cutoff) & \n                (trade_data['current_profit'] > self.stoploss) &  \n                (dataframe['rmi-dn-trend'] == 1) &\n                (dataframe['volume'].gt(0))\n            )\n            if trade_data['peak_profit'] > 0:\n                conditions.append(dataframe['rmi-slow'] < 50)\n            else:\n                conditions.append(dataframe['rmi-slow'] < 10)\n\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    hold_pct = (trade_data['free_slots'] / 100) * -1\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    conditions.append(trade_data['biggest_loser'] == True)\n\n        else:\n            conditions.append(dataframe['volume'].lt(0))\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n        \n        return dataframe\n\n    \"\"\"\n    Super Legit Custom Methods\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n        self.custom_trade_info['meta'] = {}\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60 \n\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe)\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * trade_time))\n\n\n    \"\"\"\n    Custom Indicators\n    \"\"\"\n\n    \"\"\"\n    Moving Average Cross\n    Port of: https://www.tradingview.com/script/PcWAuplI-Moving-Average-Cross/\n    \"\"\"\n    def mac(self, dataframe: DataFrame, fast: int = 20, slow: int = 50) -> Series:\n\n        dataframe = dataframe.copy()\n\n        # Fast MAs\n        upper_fast = ta.EMA(dataframe['high'], timeperiod=fast)\n        lower_fast = ta.EMA(dataframe['low'], timeperiod=fast)\n\n        # Slow MAs\n        upper_slow = ta.EMA(dataframe['high'], timeperiod=slow)\n        lower_slow = ta.EMA(dataframe['low'], timeperiod=slow)\n\n        # Crosses\n        crosses_lf_us = qtpylib.crossed_above(lower_fast, upper_slow) | qtpylib.crossed_below(lower_fast, upper_slow)\n        crosses_uf_ls = qtpylib.crossed_above(upper_fast, lower_slow) | qtpylib.crossed_below(upper_fast, lower_slow)\n\n        dir_1 = np.where(crosses_lf_us, 1, np.nan)\n        dir_2 = np.where(crosses_uf_ls, -1, np.nan)\n\n        dir = np.where(dir_1 == 1, dir_1, np.nan)\n        dir = np.where(dir_2 == -1, dir_2, dir_1)\n\n        res = Series(dir).fillna(method='ffill').to_numpy()\n\n        return res\n\n    \"\"\"\n    MA Streak\n    Port of: https://www.tradingview.com/script/Yq1z7cIv-MA-Streak-Can-Show-When-a-Run-Is-Getting-Long-in-the-Tooth/\n    \"\"\"\n    def ma_streak(self, dataframe: DataFrame, period: int = 4, source_type='close') -> Series:\n        \n        dataframe = dataframe.copy()\n\n        avgval = self.zlema(dataframe[source_type], period)\n\n        arr = np.diff(avgval)\n        pos = np.clip(arr, 0, 1).astype(bool).cumsum()\n        neg = np.clip(arr, -1, 0).astype(bool).cumsum()\n        streak = np.where(arr >= 0, pos - np.maximum.accumulate(np.where(arr <= 0, pos, 0)),\n                        -neg + np.maximum.accumulate(np.where(arr >= 0, neg, 0)))\n\n        res = np.concatenate((np.full((dataframe.shape[0] - streak.shape[0]), np.nan), streak))\n\n        return res\n\n    \"\"\"\n    Percent Change Channel\n    PCC is like KC unless it uses percentage changes in price to set channel distance.\n    https://www.tradingview.com/script/6wwAWXA1-MA-Streak-Change-Channel/\n    \"\"\"\n    def pcc(self, dataframe: DataFrame, period: int = 20, mult: int = 2):\n\n        PercentChangeChannel = namedtuple('PercentChangeChannel', ['upperband', 'middleband', 'lowerband'])\n\n        dataframe = dataframe.copy()\n\n        close = dataframe['close']\n        previous_close = close.shift()\n        low = dataframe['low']\n        high = dataframe['high']\n\n        close_change = (close - previous_close) / previous_close * 100\n        high_change = (high - close) / close * 100\n        low_change = (low - close) / close * 100\n\n        mid = self.zlema(close_change, period)\n        rangema = self.zlema(high_change - low_change, period)\n\n        upper = mid + rangema * mult\n        lower = mid - rangema * mult\n\n        return PercentChangeChannel(upper, rangema, lower)\n\n    def zlema(self, series: Series, period):\n        ema1 = ta.EMA(series, period)\n        ema2 = ta.EMA(ema1, period)\n        d = ema1 - ema2\n        zlema = ema1 + d\n        return zlema\n\n    \"\"\"\n    Price protection on trade entry and timeouts, built-in Freqtrade functionality\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n\n\"\"\"\nSub-strategy overrides\nAnything not explicity defined here will follow the settings in the base strategy\n\"\"\"\n# Sub-strategy with parameters specific to BTC stake\nclass Stinkfist_BTC(Stinkfist):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.91556,\n        'mp': 66,\n    }\n\n    use_sell_signal = False\n\n# Sub-strategy with parameters specific to ETH stake\nclass Stinkfist_ETH(Stinkfist):\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    buy_params = {\n        'inf-pct-adr': 0.81628,\n        'mp': 40,\n    }\n\n    trailing_stop = True\n    trailing_stop_positive = 0.014\n    trailing_stop_positive_offset = 0.022\n    trailing_only_offset_is_reached = False\n\n    use_sell_signal = False"
  },
  {
    "path": "strategies/StochRSITEMA/StochRSITEMA.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nfrom functools import reduce\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass StochRSITEMA(IStrategy):\n    \"\"\"\n    author@: werkkrew\n    github@: https://github.com/werkkrew/freqtrade-strategies\n\n    Reference: Strategy #1 @ https://tradingsim.com/blog/5-minute-bar/\n\n    Trade entry signals are generated when the stochastic oscillator and relative strength index provide confirming signals.\n\n    Buy:\n        - Stoch slowd and slowk below lower band and cross above\n        - Stoch slowk above slowd\n        - RSI below lower band and crosses above\n\n    You should exit the trade once the price closes beyond the TEMA in the opposite direction of the primary trend.\n    There are many cases when candles are move partially beyond the TEMA line. We disregard such exit points and we exit the market when the price fully breaks the TEMA.\n\n    Sell:\n        - Candle closes below TEMA line (or open+close or average of open/close)\n        - ROI, Stoploss, Trailing Stop\n    \"\"\"\n\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    \"\"\"\n\n    # 47/50:     19 trades. 7/6/6 Wins/Draws/Losses. Avg profit  -0.35%. Median profit   0.00%. Total profit -0.00006706 BTC (  -6.69Î£%). Avg duration  80.3 min. Objective: 1.98291\n\n    # Buy hyperspace params:\n    buy_params = {\n     'rsi-lower-band': 36, 'rsi-period': 15, 'stoch-lower-band': 48\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'tema-period': 5, 'tema-trigger': 'close'\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.19503,\n        \"13\": 0.09149,\n        \"36\": 0.02891,\n        \"64\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.02205\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.17251\n    trailing_stop_positive_offset = 0.2516\n    trailing_only_offset_is_reached = False\n\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    # Ranges for dynamic indicator periods\n    rsiStart = 5\n    rsiEnd = 30\n    temaStart = 5\n    temaEnd = 50\n\n    # Stochastic Params\n    fastkPeriod = 14\n    slowkPeriod = 3\n    slowdPeriod = 3\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = True\n    sell_profit_only = True\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = False\n\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # Number of candles the strategy requires before producing valid signals\n    # Set this to the highest period value in the indicator_params dict or highest of the ranges in the hyperopt settings (default: 72)\n    startup_candle_count: int = 50\n\n    \"\"\"\n    Populate all of the indicators we need (note: indicators are separate for buy/sell)\n    \"\"\"\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        for rsip in range(self.rsiStart, (self.rsiEnd + 1)):\n            dataframe[f'rsi({rsip})'] = ta.RSI(dataframe, timeperiod=rsip)\n\n        for temap in range(self.temaStart, (self.temaEnd + 1)):\n            dataframe[f'tema({temap})'] = ta.TEMA(dataframe, timeperiod=temap)\n\n        # Stochastic Slow\n        # fastk_period=5, slowk_period=3, slowk_matype=0, slowd_period=3, slowd_matype=0)\n        stoch_slow = ta.STOCH(dataframe, fastk_period=self.fastkPeriod,\n                              slowk_period=self.slowkPeriod, slowd_period=self.slowdPeriod)\n        dataframe['stoch-slowk'] = stoch_slow['slowk']\n        dataframe['stoch-slowd'] = stoch_slow['slowd']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        conditions = []\n\n        conditions.append(\n            dataframe[f\"rsi({params['rsi-period']})\"] > params['rsi-lower-band'])\n        conditions.append(qtpylib.crossed_above(\n            dataframe['stoch-slowd'], params['stoch-lower-band']))\n        conditions.append(qtpylib.crossed_above(\n            dataframe['stoch-slowk'], params['stoch-lower-band']))\n        conditions.append(qtpylib.crossed_above(\n            dataframe['stoch-slowk'], dataframe['stoch-slowd']))\n\n        # Check that the candle had volume\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n\n        conditions = []\n        \n        if params.get('tema-trigger') == 'close':\n            conditions.append(\n                dataframe['close'] < dataframe[f\"tema({params['tema-period']})\"])\n        if params.get('tema-trigger') == 'both':\n            conditions.append((dataframe['close'] < dataframe[f\"tema({params['tema-period']})\"]) & (\n                dataframe['open'] < dataframe[f\"tema({params['tema-period']})\"]))\n        if params.get('tema-trigger') == 'average':\n            conditions.append(\n                ((dataframe['close'] + dataframe['open']) / 2) < dataframe[f\"tema({params['tema-period']})\"])\n\n        # Check that the candle had volume\n        conditions.append(dataframe['volume'] > 0)\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/Strategy001/Strategy001.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass Strategy001(IStrategy):\n    \"\"\"\n    Strategy 001\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy001\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema20'], dataframe['ema50']) &\n                (dataframe['ha_close'] > dataframe['ema20']) &\n                (dataframe['ha_open'] < dataframe['ha_close'])  # green bar\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema50'], dataframe['ema100']) &\n                (dataframe['ha_close'] < dataframe['ema20']) &\n                (dataframe['ha_open'] > dataframe['ha_close'])  # red bar\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Strategy001_custom_sell/Strategy001_custom_sell.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass Strategy001_custom_sell(IStrategy):\n\n    \"\"\"\n    Strategy 001_custom_sell\n    author@: Gerald Lonlas, froggleston\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy001_custom_sell\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n\n        dataframe['rsi'] = ta.RSI(dataframe, 14)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema20'], dataframe['ema50']) &\n                (dataframe['ha_close'] > dataframe['ema20']) &\n                (dataframe['ha_open'] < dataframe['ha_close'])  # green bar\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                qtpylib.crossed_above(dataframe['ema50'], dataframe['ema100']) &\n                (dataframe['ha_close'] < dataframe['ema20']) &\n                (dataframe['ha_open'] > dataframe['ha_close'])  # red bar\n            ),\n            'sell'] = 1\n        return dataframe\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):\n        \"\"\"\n        Sell only when matching some criteria other than those used to generate the sell signal\n        :return: str sell_reason, if any, otherwise None\n        \"\"\"\n        # get dataframe\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n        \n        # get the current candle\n        current_candle = dataframe.iloc[-1].squeeze()\n        \n        # if RSI greater than 70 and profit is positive, then sell\n        if (current_candle['rsi'] > 70) and (current_profit > 0):\n            return \"rsi_profit_sell\"\n        \n        # else, hold\n        return None"
  },
  {
    "path": "strategies/Strategy002/Strategy002.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n\nclass Strategy002(IStrategy):\n    \"\"\"\n    Strategy 002\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy002\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # Stoch\n        stoch = ta.STOCH(dataframe)\n        dataframe['slowk'] = stoch['slowk']\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n\n        # SAR Parabol\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # Hammer: values [0, 100]\n        dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 30) &\n                (dataframe['slowk'] < 20) &\n                (dataframe['bb_lowerband'] > dataframe['close']) &\n                (dataframe['CDLHAMMER'] == 100)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['sar'] > dataframe['close']) &\n                (dataframe['fisher_rsi'] > 0.3)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Strategy003/Strategy003.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n\nclass Strategy003(IStrategy):\n    \"\"\"\n    Strategy 003\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy003\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n\n        # EMA - Exponential Moving Average\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # SAR Parabol\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 28) &\n                (dataframe['rsi'] > 0) &\n                (dataframe['close'] < dataframe['sma']) &\n                (dataframe['fisher_rsi'] < -0.94) &\n                (dataframe['mfi'] < 16.0) &\n                (\n                    (dataframe['ema50'] > dataframe['ema100']) |\n                    (qtpylib.crossed_above(dataframe['ema5'], dataframe['ema10']))\n                ) &\n                (dataframe['fastd'] > dataframe['fastk']) &\n                (dataframe['fastd'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['sar'] > dataframe['close']) &\n                (dataframe['fisher_rsi'] > 0.3)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Strategy004/Strategy004.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\n\n\nclass Strategy004(IStrategy):\n\n    \"\"\"\n    Strategy 004\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy004\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"60\":  0.01,\n        \"30\":  0.03,\n        \"20\":  0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['slowadx'] = ta.ADX(dataframe, 35)\n\n        # Commodity Channel Index: values Oversold:<-100, Overbought:>100\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        # Stoch\n        stoch = ta.STOCHF(dataframe, 5)\n        dataframe['fastd'] = stoch['fastd']\n        dataframe['fastk'] = stoch['fastk']\n        dataframe['fastk-previous'] = dataframe.fastk.shift(1)\n        dataframe['fastd-previous'] = dataframe.fastd.shift(1)\n\n        # Slow Stoch\n        slowstoch = ta.STOCHF(dataframe, 50)\n        dataframe['slowfastd'] = slowstoch['fastd']\n        dataframe['slowfastk'] = slowstoch['fastk']\n        dataframe['slowfastk-previous'] = dataframe.slowfastk.shift(1)\n        dataframe['slowfastd-previous'] = dataframe.slowfastd.shift(1)\n\n        # EMA - Exponential Moving Average\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n\n        dataframe['mean-volume'] = dataframe['volume'].mean()\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (\n                    (dataframe['adx'] > 50) |\n                    (dataframe['slowadx'] > 26)\n                ) &\n                (dataframe['cci'] < -100) &\n                (\n                    (dataframe['fastk-previous'] < 20) &\n                    (dataframe['fastd-previous'] < 20)\n                ) &\n                (\n                    (dataframe['slowfastk-previous'] < 30) &\n                    (dataframe['slowfastd-previous'] < 30)\n                ) &\n                (dataframe['fastk-previous'] < dataframe['fastd-previous']) &\n                (dataframe['fastk'] > dataframe['fastd']) &\n                (dataframe['mean-volume'] > 0.75) &\n                (dataframe['close'] > 0.00000100)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['slowadx'] < 25) &\n                ((dataframe['fastk'] > 70) | (dataframe['fastd'] > 70)) &\n                (dataframe['fastk-previous'] < dataframe['fastd-previous']) &\n                (dataframe['close'] > dataframe['ema5'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/Strategy005/Strategy005.py",
    "content": "\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, IntParameter\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n\nclass Strategy005(IStrategy):\n    \"\"\"\n    Strategy 005\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy005\n    \"\"\"\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"1440\": 0.01,\n        \"80\": 0.02,\n        \"40\": 0.03,\n        \"20\": 0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    buy_volumeAVG = IntParameter(low=50, high=300, default=70, space='buy', optimize=True)\n    buy_rsi = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n    buy_fastd = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n    buy_fishRsiNorma = IntParameter(low=1, high=100, default=30, space='buy', optimize=True)\n\n    sell_rsi = IntParameter(low=1, high=100, default=70, space='sell', optimize=True)\n    sell_minusDI = IntParameter(low=1, high=100, default=50, space='sell', optimize=True)\n    sell_fishRsiNorma = IntParameter(low=1, high=100, default=50, space='sell', optimize=True)\n    sell_trigger = CategoricalParameter([\"rsi-macd-minusdi\", \"sar-fisherRsi\"],\n                                        default=30, space='sell', optimize=True)\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_fastd\": 1,\n        \"buy_fishRsiNorma\": 5,\n        \"buy_rsi\": 26,\n        \"buy_volumeAVG\": 150,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_fishRsiNorma\": 30,\n        \"sell_minusDI\": 4,\n        \"sell_rsi\": 74,\n        \"sell_trigger\": \"rsi-macd-minusdi\",\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n\n        # Minus Directional Indicator / Movement\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n        # Inverse Fisher transform on RSI normalized, value [0.0, 100.0] (https://goo.gl/2JGGoy)\n        dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # SAR Parabol\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            # Prod\n            (\n                (dataframe['close'] > 0.00000200) &\n                (dataframe['volume'] > dataframe['volume'].rolling(self.buy_volumeAVG.value).mean() * 4) &\n                (dataframe['close'] < dataframe['sma']) &\n                (dataframe['fastd'] > dataframe['fastk']) &\n                (dataframe['rsi'] > self.buy_rsi.value) &\n                (dataframe['fastd'] > self.buy_fastd.value) &\n                (dataframe['fisher_rsi_norma'] < self.buy_fishRsiNorma.value)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n\n        conditions = []\n        if self.sell_trigger.value == 'rsi-macd-minusdi':\n            conditions.append(qtpylib.crossed_above(dataframe['rsi'], self.sell_rsi.value))\n            conditions.append(dataframe['macd'] < 0)\n            conditions.append(dataframe['minus_di'] > self.sell_minusDI.value)\n        if self.sell_trigger.value == 'sar-fisherRsi':\n            conditions.append(dataframe['sar'] > dataframe['close'])\n            conditions.append(dataframe['fisher_rsi'] > self.sell_fishRsiNorma.value)\n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), 'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/StrategyScalpingFast/StrategyScalpingFast.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass StrategyScalpingFast(IStrategy):\n\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    stoploss = -0.5\n    timeframe = '1m'\n    timeframe_support = '5m'\n    timeframe_main = '5m'\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    ignore_buying_expired_candle_after = 0\n    trailing_stop = False\n\n    startup_candle_count: int = 20\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=20)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n        dataframe['cci'] = ta.CCI(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    (dataframe['open'] < dataframe['ema_low']) &\n                    (dataframe['adx'] > 30) &\n                    (dataframe['mfi'] < 30) &\n                    (\n                        (dataframe['fastk'] < 30) &\n                        (dataframe['fastd'] < 30) &\n                        (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n                    ) &\n                    (dataframe['cci'] < -150)\n                )\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    (\n                        (dataframe['open'] >= dataframe['ema_high'])\n\n                    ) |\n                    (\n                        (qtpylib.crossed_above(dataframe['fastk'], 70)) |\n                        (qtpylib.crossed_above(dataframe['fastd'], 70))\n\n                    )\n                ) & (dataframe['cci'] > 150)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/StrategyScalpingFast2/StrategyScalpingFast2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import timeframe_to_minutes\nfrom pandas import DataFrame\nfrom technical.util import resample_to_interval, resampled_merge\nfrom functools import reduce\nimport numpy  # noqa\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass StrategyScalpingFast2(IStrategy):\n    \"\"\"\n        Based on ReinforcedSmoothScalp\n        https://github.com/freqtrade/freqtrade-strategies/blob/master/user_data/strategies/berlinguyinca/ReinforcedSmoothScalp.py\n        this strategy is based around the idea of generating a lot of potentatils buys and make tiny profits on each trade\n\n        we recommend to have at least 60 parallel trades at any time to cover non avoidable losses\n    \"\"\"\n    # Buy hyperspace params:\n    buy_params = {\n        \"mfi-value\": 19,\n        \"fastd-value\": 29,\n        \"fastk-value\": 19,\n        \"adx-value\": 30,\n        \"mfi-enabled\": False,\n        \"fastd-enabled\": False,\n        \"adx-enabled\": False,\n        \"fastk-enabled\": False,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell-mfi-value\": 89,\n        \"sell-fastd-value\": 72,\n        \"sell-fastk-value\": 68,\n        \"sell-adx-value\": 86,\n        \"sell-cci-value\": 157,\n        \"sell-mfi-enabled\": True,\n        \"sell-fastd-enabled\": True,\n        \"sell-adx-enabled\": True,\n        \"sell-cci-enabled\": False,\n        \"sell-fastk-enabled\": False,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.082,\n        \"18\": 0.06,\n        \"51\": 0.012,\n        \"123\": 0\n    }\n    use_sell_signal = False\n    # Stoploss:\n    stoploss = -0.326\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    #minimal_roi = {\n    #    \"0\": 0.02\n    #}\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # should not be below 3% loss\n\n    #stoploss = -0.1\n    # Optimal timeframe for the strategy\n    # the shorter the better\n    timeframe = '1m'\n\n    # resample factor to establish our general trend. Basically don't buy if a trend is not given\n    resample_factor = 5\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tf_res = timeframe_to_minutes(self.timeframe) * self.resample_factor\n        df_res = resample_to_interval(dataframe, tf_res)\n        df_res['sma'] = ta.SMA(df_res, 50, price='close')\n        dataframe = resampled_merge(dataframe, df_res, fill_na=True)\n        dataframe['resample_sma'] = dataframe[f'resample_{tf_res}_sma']\n\n        dataframe['ema_high'] = ta.EMA(dataframe, timeperiod=5, price='high')\n        dataframe['ema_close'] = ta.EMA(dataframe, timeperiod=5, price='close')\n        dataframe['ema_low'] = ta.EMA(dataframe, timeperiod=5, price='low')\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['cci'] = ta.CCI(dataframe, timeperiod=20)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # required for graphing\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_middleband'] = bollinger['mid']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(dataframe[\"volume\"] > 0)\n        conditions.append(dataframe['open'] < dataframe['ema_low'])\n        conditions.append(dataframe['resample_sma'] < dataframe['close'])\n\n        if self.buy_params['adx-enabled']:\n            conditions.append(dataframe[\"adx\"] < self.buy_params['adx-value'])\n        if self.buy_params['mfi-enabled']:\n            conditions.append(dataframe['mfi'] < self.buy_params['mfi-value'])\n        if self.buy_params['fastk-enabled']:\n            conditions.append(dataframe['fastk'] < self.buy_params['fastk-value'])\n        if self.buy_params['fastd-enabled']:\n            conditions.append(dataframe['fastd'] < self.buy_params['fastd-value'])\n        if self.buy_params['fastk-enabled'] == True & self.buy_params['fastd-enabled'] == True:\n            conditions.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))\n        \n        # |\n        # # try to get some sure things independent of resample\n        # ((dataframe['rsi'] - dataframe['mfi']) < 10) &\n        # (dataframe['mfi'] < 30) &\n        # (dataframe['cci'] < -200)\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"buy\"] = 1            \n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        conditions.append(dataframe['open'] >= dataframe['ema_high'])\n\n        if self.sell_params['sell-fastd-enabled'] == True | self.sell_params['sell-fastk-enabled'] == True:\n            conditions.append((qtpylib.crossed_above(dataframe['fastk'], self.sell_params['sell-fastk-value'])) |\n                              (qtpylib.crossed_above(dataframe['fastd'], self.sell_params['sell-fastd-value'])))\n        if self.sell_params['sell-cci-enabled'] == True:\n            conditions.append(dataframe['cci'] > 100)\n        if self.sell_params['sell-mfi-enabled'] == True:\n            conditions.append(dataframe['mfi'] > self.sell_params['sell-mfi-value'])\n        if self.sell_params['sell-adx-enabled'] == True:\n            conditions.append(dataframe[\"adx\"] < self.sell_params['sell-adx-value'])            \n\n        if conditions:\n            dataframe.loc[reduce(lambda x, y: x & y, conditions), \"sell\"] = 1              \n        return dataframe"
  },
  {
    "path": "strategies/SuperHV27/SuperHV27.py",
    "content": "import numpy as np\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport arrow\nfrom typing import Dict, List, NamedTuple, Optional, Tuple\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair\nfrom pandas import DataFrame, Series\nfrom functools import reduce\nfrom datetime import datetime\nfrom freqtrade.persistence import Trade\nfrom technical.indicators import RMI\nfrom statistics import mean\nfrom cachetools import TTLCache\n\n\n\nclass SuperHV27(IStrategy):\n\n    timeframe = '5m'\n\n    # Buy hyperspace params:\n    buy_params = {\n        'adx1': 49,\n        'adx2': 36,\n        'adx3': 32,\n        'adx4': 24,\n        'emarsi1': 43,\n        'emarsi2': 27,\n        'emarsi3': 26,\n        'emarsi4': 50\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n     'adx2': 36, 'emarsi1': 43, 'emarsi2': 27, 'emarsi3': 26\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.10,\n        \"30\": 0.05,\n        \"40\": 0.025,\n        \"60\": 0.015,\n        \"720\": 0.01,\n        \"1440\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.40\n\n    # connect will participate in hyperopted tables, other methods will not\n    dynamic_roi = {\n        'enabled': True,\n        'type': 'connect',      # linear, exponential, or connect\n        'decay-rate': 0.015,    # bigger is faster, recommended to graph f(t) = start-pct * e(-rate*t)      \n        'decay-time': 1440,     # amount of time to reach zero, only relevant for linear decay\n        'start': 0.10,          # starting percentage\n        'end': 0,               # ending percentage \n    }\n\n    # Probably don't change these\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Custom Dicts for storing trade data and other custom things this strategy does\n    custom_trade_info = {}\n    custom_current_price_cache: TTLCache = TTLCache(maxsize=100, ttl=300) # 5 minutes\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Populate/update the trade data if there is any, set trades to false if not live/dry\n        self.custom_trade_info[metadata['pair']] = self.populate_trades(metadata['pair'])\n\n        dataframe['rsi'] = np.nan_to_num(ta.RSI(dataframe, timeperiod=5))\n        dataframe['emarsi'] = np.nan_to_num(ta.EMA(dataframe['rsi'], timeperiod=5))\n\n        dataframe['adx'] = np.nan_to_num(ta.ADX(dataframe))\n\n        dataframe['minusdi'] = np.nan_to_num(ta.MINUS_DI(dataframe))\n        dataframe['minusdiema'] = np.nan_to_num(ta.EMA(dataframe['minusdi'], timeperiod=25))\n        dataframe['plusdi'] = np.nan_to_num(ta.PLUS_DI(dataframe))\n        dataframe['plusdiema'] = np.nan_to_num(ta.EMA(dataframe['plusdi'], timeperiod=5))\n\n        dataframe['lowsma'] = np.nan_to_num(ta.EMA(dataframe, timeperiod=60))\n        dataframe['highsma'] = np.nan_to_num(ta.EMA(dataframe, timeperiod=120))\n        dataframe['fastsma'] = np.nan_to_num(ta.SMA(dataframe, timeperiod=120))\n        dataframe['slowsma'] = np.nan_to_num(ta.SMA(dataframe, timeperiod=240))\n\n        dataframe['bigup'] = dataframe['fastsma'].gt(dataframe['slowsma']) & ((dataframe['fastsma'] - dataframe['slowsma']) > dataframe['close'] / 300)\n        dataframe['bigdown'] = ~dataframe['bigup']\n        dataframe['trend'] = dataframe['fastsma'] - dataframe['slowsma']\n\n        dataframe['preparechangetrend'] = dataframe['trend'].gt(dataframe['trend'].shift())\n        dataframe['preparechangetrendconfirm'] = dataframe['preparechangetrend'] & dataframe['trend'].shift().gt(dataframe['trend'].shift(2))\n        dataframe['continueup'] = dataframe['slowsma'].gt(dataframe['slowsma'].shift()) & dataframe['slowsma'].shift().gt(dataframe['slowsma'].shift(2))\n\n        dataframe['delta'] = dataframe['fastsma'] - dataframe['fastsma'].shift()\n        dataframe['slowingdown'] = dataframe['delta'].lt(dataframe['delta'].shift())\n\n        dataframe['rmi-slow'] = RMI(dataframe, length=21, mom=5)\n        dataframe['rmi-fast'] = RMI(dataframe, length=8, mom=4)\n\n        dataframe['rmi-up'] = np.where(dataframe['rmi-slow'] >= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-dn'] = np.where(dataframe['rmi-slow'] <= dataframe['rmi-slow'].shift(),1,0)      \n        dataframe['rmi-up-trend'] = np.where(dataframe['rmi-up'].rolling(3, min_periods=1).sum() >= 2,1,0)      \n        dataframe['rmi-dn-trend'] = np.where(dataframe['rmi-dn'].rolling(3, min_periods=1).sum() >= 2,1,0)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        if trade_data['active_trade']:\n            profit_factor = (1 - (dataframe['rmi-slow'].iloc[-1] / 400))\n            rmi_grow = self.linear_growth(30, 70, 180, 720, trade_data['open_minutes'])\n\n            conditions.append(dataframe['rmi-up-trend'] == 1)\n            conditions.append(trade_data['current_profit'] > (trade_data['peak_profit'] * profit_factor))\n            conditions.append(dataframe['rmi-slow'] >= rmi_grow)\n        \n        else:\n            # Standard BinHV27 Buy Conditions\n            conditions.append(\n                dataframe['slowsma'].gt(0) &\n                dataframe['close'].lt(dataframe['highsma']) &\n                dataframe['close'].lt(dataframe['lowsma']) &\n                dataframe['minusdi'].gt(dataframe['minusdiema']) &\n                dataframe['rsi'].ge(dataframe['rsi'].shift()) &\n                (\n                (\n                    ~dataframe['preparechangetrend'] &\n                    ~dataframe['continueup'] &\n                    dataframe['adx'].gt(params['adx1']) &\n                    dataframe['bigdown'] &\n                    dataframe['emarsi'].le(params['emarsi1'])\n                ) |\n                (\n                    ~dataframe['preparechangetrend'] &\n                    dataframe['continueup'] &\n                    dataframe['adx'].gt(params['adx2']) &\n                    dataframe['bigdown'] &\n                    dataframe['emarsi'].le(params['emarsi2'])\n                ) |\n                (\n                    ~dataframe['continueup'] &\n                    dataframe['adx'].gt(params['adx3']) &\n                    dataframe['bigup'] &\n                    dataframe['emarsi'].le(params['emarsi3'])\n                ) |\n                (\n                    dataframe['continueup'] &\n                    dataframe['adx'].gt(params['adx4']) &\n                    dataframe['bigup'] &\n                    dataframe['emarsi'].le(params['emarsi4'])\n                )\n                )\n            )\n\n        conditions.append(dataframe['volume'].gt(0))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.sell_params\n        trade_data = self.custom_trade_info[metadata['pair']]\n        conditions = []\n\n        # Standard BinHV27 Sell Conditions\n        conditions.append(\n            (\n            (\n                ~dataframe['preparechangetrendconfirm'] &\n                ~dataframe['continueup'] &\n                (dataframe['close'].gt(dataframe['lowsma']) | dataframe['close'].gt(dataframe['highsma'])) &\n                dataframe['highsma'].gt(0) &\n                dataframe['bigdown']\n            ) |\n            (\n                ~dataframe['preparechangetrendconfirm'] &\n                ~dataframe['continueup'] &\n                dataframe['close'].gt(dataframe['highsma']) &\n                dataframe['highsma'].gt(0) &\n                (dataframe['emarsi'].ge(params['emarsi1']) | dataframe['close'].gt(dataframe['slowsma'])) &\n                dataframe['bigdown']\n            ) |\n            (\n                ~dataframe['preparechangetrendconfirm'] &\n                dataframe['close'].gt(dataframe['highsma']) &\n                dataframe['highsma'].gt(0) &\n                dataframe['adx'].gt(params['adx2']) &\n                dataframe['emarsi'].ge(params['emarsi2']) &\n                dataframe['bigup']\n            ) |\n            (\n                dataframe['preparechangetrendconfirm'] &\n                ~dataframe['continueup'] &\n                dataframe['slowingdown'] &\n                dataframe['emarsi'].ge(params['emarsi3']) &\n                dataframe['slowsma'].gt(0)\n            ) |\n            (\n                dataframe['preparechangetrendconfirm'] &\n                dataframe['minusdi'].lt(dataframe['plusdi']) &\n                dataframe['close'].gt(dataframe['lowsma']) &\n                dataframe['slowsma'].gt(0)\n            )\n            )\n        )\n\n        if trade_data['active_trade']:  \n            loss_cutoff = self.linear_growth(-0.03, 0, 0, 300, trade_data['open_minutes'])\n\n            conditions.append(trade_data['current_profit'] < loss_cutoff)\n\n            if trade_data['other_trades']:\n                if trade_data['free_slots'] > 0:\n                    hold_pct = (trade_data['free_slots'] / 100) * -1\n                    conditions.append(trade_data['avg_other_profit'] >= hold_pct)\n                else:\n                    conditions.append(trade_data['biggest_loser'] == True)\n                           \n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n\n    \"\"\"\n    Override for default Freqtrade ROI table functionality\n    \"\"\"\n    def min_roi_reached_entry(self, trade_dur: int) -> Tuple[Optional[int], Optional[float]]:\n        dynamic_roi = self.dynamic_roi\n\n        # if the dynamic_roi dict is defined and enabled, do it, otherwise fallback to default functionality\n        if dynamic_roi and dynamic_roi['enabled']:\n            # linear decay: f(t) = start - (rate * t)\n            if dynamic_roi['type'] == 'linear':\n                rate = (dynamic_roi['start'] - dynamic_roi['end']) / dynamic_roi['decay-time']\n                min_roi = max(dynamic_roi['end'], dynamic_roi['start'] - (rate * trade_dur))\n            # exponential decay: f(t) = start * e^(-rate*t)\n            elif dynamic_roi['type'] == 'exponential':\n                min_roi = max(dynamic_roi['end'], dynamic_roi['start'] * np.exp(-dynamic_roi['decay-rate']*trade_dur))\n            elif dynamic_roi['type'] == 'connect':\n                # connect the points in the defined table with lines\n                past_roi = list(filter(lambda x: x <= trade_dur, self.minimal_roi.keys()))\n                next_roi = list(filter(lambda x: x >  trade_dur, self.minimal_roi.keys()))\n                if not past_roi:\n                    return None, None\n                current_entry = max(past_roi)\n                # next entry\n                if not next_roi:\n                    return current_entry, self.minimal_roi[current_entry]\n                # use the slope-intercept formula between the two points in the roi table we are between\n                else:\n                    next_entry = min(next_roi)\n                    # y = mx + b\n                    x1 = current_entry\n                    x2 = next_entry\n                    y1 = self.minimal_roi[current_entry]\n                    y2 = self.minimal_roi[next_entry]\n                    m = (y1-y2)/(x1-x2)\n                    b = (x1*y2 - x2*y1)/(x1-x2)\n                    min_roi = (m * trade_dur) + b\n            else:\n                min_roi = 0\n\n            return trade_dur, min_roi\n        # use the standard ROI table\n        else:\n            # Get highest entry in ROI dict where key <= trade-duration\n            roi_list = list(filter(lambda x: x <= trade_dur, self.minimal_roi.keys()))\n            if not roi_list:\n                return None, None\n            roi_entry = max(roi_list)\n            return roi_entry, self.minimal_roi[roi_entry]\n\n    \"\"\"\n    Super Legit Custom Methods\n    \"\"\"\n    def populate_trades(self, pair: str) -> dict:\n        if not pair in self.custom_trade_info:\n            self.custom_trade_info[pair] = {}\n\n        trade_data = {}\n        trade_data['active_trade'] = trade_data['other_trades'] = trade_data['biggest_loser'] = False\n        self.custom_trade_info['meta'] = {}\n\n        if self.config['runmode'].value in ('live', 'dry_run'):\n            \n            active_trade = Trade.get_trades([Trade.pair == pair, Trade.is_open.is_(True),]).all()\n\n            if active_trade:\n                current_rate = self.get_current_price(pair, True)\n                active_trade[0].adjust_min_max_rates(current_rate)\n\n                present = arrow.utcnow()\n                trade_start  = arrow.get(active_trade[0].open_date)\n                open_minutes = (present - trade_start).total_seconds() // 60 \n\n                trade_data['active_trade']   = True\n                trade_data['current_profit'] = active_trade[0].calc_profit_ratio(current_rate)\n                trade_data['peak_profit']    = max(0, active_trade[0].calc_profit_ratio(active_trade[0].max_rate))\n                trade_data['open_minutes']   : int = open_minutes\n                trade_data['open_candles']   : int = (open_minutes // active_trade[0].timeframe)\n            else: \n                trade_data['current_profit'] = trade_data['peak_profit']  = 0.0\n                trade_data['open_minutes']   = trade_data['open_candles'] = 0\n\n            other_trades = Trade.get_trades([Trade.pair != pair, Trade.is_open.is_(True),]).all()\n\n            if other_trades:\n                trade_data['other_trades'] = True\n                other_profit = tuple(trade.calc_profit_ratio(self.get_current_price(trade.pair, False)) for trade in other_trades)\n                trade_data['avg_other_profit'] = mean(other_profit) \n                if trade_data['current_profit'] < min(other_profit):\n                    trade_data['biggest_loser'] = True\n            else:\n                trade_data['avg_other_profit'] = 0\n\n            open_trades = len(Trade.get_open_trades())\n            trade_data['free_slots'] = max(0, self.config['max_open_trades'] - open_trades)\n\n        return trade_data\n\n    def get_current_price(self, pair: str, refresh: bool) -> float:\n        if not refresh:\n            rate = self.custom_current_price_cache.get(pair)\n            if rate:\n                return rate\n\n        ask_strategy = self.config.get('ask_strategy', {})\n        if ask_strategy.get('use_order_book', False):\n            ob = self.dp.orderbook(pair, 1)\n            rate = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        else:\n            ticker = self.dp.ticker(pair)\n            rate = ticker['last']\n\n        self.custom_current_price_cache[pair] = rate\n        return rate\n\n    def linear_growth(self, start: float, end: float, start_time: int, end_time: int, trade_time: int) -> float:\n        time = max(0, trade_time - start_time)\n        rate = (end - start) / (end_time - start_time)\n        return min(end, start + (rate * trade_time))\n\n\n    \"\"\"\n    Price protection on trade entry and timeouts, built-in Freqtrade functionality\n    https://www.freqtrade.io/en/latest/strategy-advanced/\n    \"\"\"\n    def check_buy_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > order['price'] * 1.01:\n            return True\n        return False\n\n    def check_sell_timeout(self, pair: str, trade: Trade, order: dict, **kwargs) -> bool:\n        ask_strategy = self.config.get('ask_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{ask_strategy['price_side']}s\"][0][0]\n        if current_price < order['price'] * 0.99:\n            return True\n        return False\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        bid_strategy = self.config.get('bid_strategy', {})\n        ob = self.dp.orderbook(pair, 1)\n        current_price = ob[f\"{bid_strategy['price_side']}s\"][0][0]\n        if current_price > rate * 1.01:\n            return False\n        return True\n\n\n\"\"\"\nSub-strategy overrides\nAnything not explicity defined here will follow the settings in the base strategy\n\"\"\"\n# Sub-strategy with parameters specific to BTC stake\nclass SuperHV27_BTC(SuperHV27):\n\n    timeframe = '5m'\n\n\n\n    use_sell_signal = False\n\n# Sub-strategy with parameters specific to ETH stake\nclass SuperHV27_ETH(SuperHV27):\n\n    timeframe = '5m'\n\n\n\n    use_sell_signal = False"
  },
  {
    "path": "strategies/SuperTrend/SuperTrend.py",
    "content": "\"\"\"\nSupertrend strategy:\n* Description: Generate a 3 supertrend indicators for 'buy' strategies & 3 supertrend indicators for 'sell' strategies\n               Buys if the 3 'buy' indicators are 'up'\n               Sells if the 3 'sell' indicators are 'down'\n* Author: @juankysoriano (Juan Carlos Soriano)\n* github: https://github.com/juankysoriano/\n\n*** NOTE: This Supertrend strategy is just one of many possible strategies using `Supertrend` as indicator. It should on any case used at your own risk. \n          It comes with at least a couple of caveats:\n            1. The implementation for the `supertrend` indicator is based on the following discussion: https://github.com/freqtrade/freqtrade-strategies/issues/30 . Concretelly https://github.com/freqtrade/freqtrade-strategies/issues/30#issuecomment-853042401\n            2. The implementation for `supertrend` on this strategy is not validated; meaning this that is not proven to match the results by the paper where it was originally introduced or any other trusted academic resources\n\"\"\"\n\nimport logging\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy.hyper import IntParameter\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport numpy as np\n\nclass Supertrend(IStrategy):\n    # Buy params, Sell params, ROI, Stoploss and Trailing Stop are values generated by 'freqtrade hyperopt --strategy Supertrend --hyperopt-loss ShortTradeDurHyperOptLoss --timerange=20210101- --timeframe=1h --spaces all'\n    # It's encourage you find the values that better suites your needs and risk management strategies\n    \n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_m1\": 4,\n        \"buy_m2\": 7,\n        \"buy_m3\": 1,\n        \"buy_p1\": 8,\n        \"buy_p2\": 9,\n        \"buy_p3\": 8,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_m1\": 1,\n        \"sell_m2\": 3,\n        \"sell_m3\": 6,\n        \"sell_p1\": 16,\n        \"sell_p2\": 18,\n        \"sell_p3\": 18,\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.087,\n        \"372\": 0.058,\n        \"861\": 0.029,\n        \"2221\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.265\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.05\n    trailing_stop_positive_offset = 0.144\n    trailing_only_offset_is_reached = False\n\n    timeframe = '1h'\n\n    startup_candle_count = 18\n\n    buy_m1 = IntParameter(1, 7, default=4)\n    buy_m2 = IntParameter(1, 7, default=4)\n    buy_m3 = IntParameter(1, 7, default=4)\n    buy_p1 = IntParameter(7, 21, default=14)\n    buy_p2 = IntParameter(7, 21, default=14)\n    buy_p3 = IntParameter(7, 21, default=14)\n\n    sell_m1 = IntParameter(1, 7, default=4)\n    sell_m2 = IntParameter(1, 7, default=4)\n    sell_m3 = IntParameter(1, 7, default=4)\n    sell_p1 = IntParameter(7, 21, default=14)\n    sell_p2 = IntParameter(7, 21, default=14)\n    sell_p3 = IntParameter(7, 21, default=14)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        for multiplier in self.buy_m1.range:\n            for period in self.buy_p1.range:\n                dataframe[f'supertrend_1_buy_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.buy_m2.range:\n            for period in self.buy_p2.range:\n                dataframe[f'supertrend_2_buy_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.buy_m3.range:\n            for period in self.buy_p3.range:\n                dataframe[f'supertrend_3_buy_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.sell_m1.range:\n            for period in self.sell_p1.range:\n                dataframe[f'supertrend_1_sell_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.sell_m2.range:\n            for period in self.sell_p2.range:\n                dataframe[f'supertrend_2_sell_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        for multiplier in self.sell_m3.range:\n            for period in self.sell_p3.range:\n                dataframe[f'supertrend_3_sell_{multiplier}_{period}'] = self.supertrend(dataframe, multiplier, period)['STX']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n               (dataframe[f'supertrend_1_buy_{self.buy_m1.value}_{self.buy_p1.value}'] == 'up') &\n               (dataframe[f'supertrend_2_buy_{self.buy_m2.value}_{self.buy_p2.value}'] == 'up') &\n               (dataframe[f'supertrend_3_buy_{self.buy_m3.value}_{self.buy_p3.value}'] == 'up') & # The three indicators are 'up' for the current candle\n               (dataframe['volume'] > 0) # There is at least some trading volume\n        ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n               (dataframe[f'supertrend_1_sell_{self.sell_m1.value}_{self.sell_p1.value}'] == 'down') &\n               (dataframe[f'supertrend_2_sell_{self.sell_m2.value}_{self.sell_p2.value}'] == 'down') &\n               (dataframe[f'supertrend_3_sell_{self.sell_m3.value}_{self.sell_p3.value}'] == 'down') & # The three indicators are 'down' for the current candle\n               (dataframe['volume'] > 0) # There is at least some trading volume\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n\n\n    \"\"\"\n        Supertrend Indicator; adapted for freqtrade\n        from: https://github.com/freqtrade/freqtrade-strategies/issues/30\n    \"\"\"\n    def supertrend(self, dataframe: DataFrame, multiplier, period):\n        df = dataframe.copy()\n\n        df['TR'] = ta.TRANGE(df)\n        df['ATR'] = ta.SMA(df['TR'], period)\n\n        st = 'ST_' + str(period) + '_' + str(multiplier)\n        stx = 'STX_' + str(period) + '_' + str(multiplier)\n\n        # Compute basic upper and lower bands\n        df['basic_ub'] = (df['high'] + df['low']) / 2 + multiplier * df['ATR']\n        df['basic_lb'] = (df['high'] + df['low']) / 2 - multiplier * df['ATR']\n\n        # Compute final upper and lower bands\n        df['final_ub'] = 0.00\n        df['final_lb'] = 0.00\n        for i in range(period, len(df)):\n            df['final_ub'].iat[i] = df['basic_ub'].iat[i] if df['basic_ub'].iat[i] < df['final_ub'].iat[i - 1] or df['close'].iat[i - 1] > df['final_ub'].iat[i - 1] else df['final_ub'].iat[i - 1]\n            df['final_lb'].iat[i] = df['basic_lb'].iat[i] if df['basic_lb'].iat[i] > df['final_lb'].iat[i - 1] or df['close'].iat[i - 1] < df['final_lb'].iat[i - 1] else df['final_lb'].iat[i - 1]\n\n        # Set the Supertrend value\n        df[st] = 0.00\n        for i in range(period, len(df)):\n            df[st].iat[i] = df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_ub'].iat[i - 1] and df['close'].iat[i] <= df['final_ub'].iat[i] else \\\n                            df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_ub'].iat[i - 1] and df['close'].iat[i] >  df['final_ub'].iat[i] else \\\n                            df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df['close'].iat[i] >= df['final_lb'].iat[i] else \\\n                            df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df['close'].iat[i] <  df['final_lb'].iat[i] else 0.00\n        # Mark the trend direction up/down\n        df[stx] = np.where((df[st] > 0.00), np.where((df['close'] < df[st]), 'down',  'up'), np.NaN)\n\n        # Remove basic and final bands from the columns\n        df.drop(['basic_ub', 'basic_lb', 'final_ub', 'final_lb'], inplace=True, axis=1)\n\n        df.fillna(0, inplace=True)\n\n        return DataFrame(index=df.index, data={\n            'ST' : df[st],\n            'STX' : df[stx]\n        })\n"
  },
  {
    "path": "strategies/SuperTrendPure/SuperTrendPure.py",
    "content": "import logging\nfrom numpy.lib import math\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy.hyper import IntParameter\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass SuperTrendPure(IStrategy):\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.087,\n        \"372\": 0.058,\n        \"861\": 0.029,\n        \"2221\": 0\n    }\n    # Stoploss:\n    stoploss = -0.265\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.05\n    trailing_stop_positive_offset = 0.144\n    trailing_only_offset_is_reached = False\n\n    timeframe = '1h'\n\n    startup_candle_count = 50\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        supertrend = self.supertrend(dataframe, 2, 8)\n        dataframe['st'] = supertrend['ST']\n        dataframe['stx'] = supertrend['STX']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (qtpylib.crossed_above(dataframe['close'], dataframe['st'])) &\n                    (dataframe['volume'].gt(0))\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (qtpylib.crossed_below(dataframe['close'], dataframe['st'])) &\n                    (dataframe['volume'].gt(0))\n            ),\n            'sell'] = 1\n\n        return dataframe\n\n    \"\"\"\n        Supertrend Indicator; adapted for freqtrade\n        from: https://github.com/freqtrade/freqtrade-strategies/issues/30\n    \"\"\"\n\n    def supertrend(self, dataframe: DataFrame, multiplier, period):\n        df = dataframe.copy()\n\n        df['TR'] = ta.TRANGE(df)\n        df['ATR'] = ta.SMA(df['TR'], period)\n\n        st = 'ST_' + str(period) + '_' + str(multiplier)\n        stx = 'STX_' + str(period) + '_' + str(multiplier)\n\n        # Compute basic upper and lower bands\n        df['basic_ub'] = (df['high'] + df['low']) / 2 + multiplier * df['ATR']\n        df['basic_lb'] = (df['high'] + df['low']) / 2 - multiplier * df['ATR']\n\n        # Compute final upper and lower bands\n        df['final_ub'] = 0.00\n        df['final_lb'] = 0.00\n        for i in range(period, len(df)):\n            df['final_ub'].iat[i] = df['basic_ub'].iat[i] if df['basic_ub'].iat[i] < df['final_ub'].iat[i - 1] or \\\n                                                             df['close'].iat[i - 1] > df['final_ub'].iat[i - 1] else \\\n            df['final_ub'].iat[i - 1]\n            df['final_lb'].iat[i] = df['basic_lb'].iat[i] if df['basic_lb'].iat[i] > df['final_lb'].iat[i - 1] or \\\n                                                             df['close'].iat[i - 1] < df['final_lb'].iat[i - 1] else \\\n            df['final_lb'].iat[i - 1]\n\n        # Set the Supertrend value\n        df[st] = 0.00\n        for i in range(period, len(df)):\n            df[st].iat[i] = df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_ub'].iat[i - 1] and df['close'].iat[\n                i] <= df['final_ub'].iat[i] else \\\n                df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_ub'].iat[i - 1] and df['close'].iat[i] > \\\n                                         df['final_ub'].iat[i] else \\\n                    df['final_lb'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df['close'].iat[i] >= \\\n                                             df['final_lb'].iat[i] else \\\n                        df['final_ub'].iat[i] if df[st].iat[i - 1] == df['final_lb'].iat[i - 1] and df['close'].iat[i] < \\\n                                                 df['final_lb'].iat[i] else 0.00\n        # Mark the trend direction up/down\n        df[stx] = np.where((df[st] > 0.00), np.where((df['close'] < df[st]), 'down', 'up'), np.NaN)\n\n        # Remove basic and final bands from the columns\n        df.drop(['basic_ub', 'basic_lb', 'final_ub', 'final_lb'], inplace=True, axis=1)\n\n        df.fillna(0, inplace=True)\n\n        return DataFrame(index=df.index, data={\n            'ST': df[st],\n            'STX': df[stx]\n        })"
  },
  {
    "path": "strategies/SupertrendStrategy/SupertrendStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport ta\nimport pandas_ta as pda\n\n\n# This class is a sample. Feel free to customize it.\nclass SupertrendStrategy(IStrategy):\n    \"\"\"\n    Sources : \n    Cripto Robot : https://www.youtube.com/watch?v=rl00g3-Iv5A\n    Github : https://github.com/CryptoRobotFr/TrueStrategy/tree/main/3SuperTrend\n\n    freqtrade backtesting -s SupertrendStrategy --timerange=20180417-20210818 --stake-amount unlimited -p ADA/USDT --config user_data/config_binance.json --enable-position-stacking --max-open-trades 1\n    =============== SUMMARY METRICS ================\n    | Metric                 | Value               |\n    |------------------------+---------------------|\n    | Backtesting from       | 2018-04-18 10:00:00 |\n    | Backtesting to         | 2021-08-18 00:00:00 |\n    | Max open trades        | 1                   |\n    |                        |                     |\n    | Total/Daily Avg Trades | 202 / 0.17          |\n    | Starting balance       | 1000.000 USDT       |\n    | Final balance          | 41040.541 USDT      |\n    | Absolute profit        | 40040.541 USDT      |\n    | Total profit %         | 4004.05%            |\n    | Trades per day         | 0.17                |\n    | Avg. daily profit %    | 3.29%               |\n    | Avg. stake amount      | 7215.587 USDT       |\n    | Total trade volume     | 1457548.658 USDT    |\n    |                        |                     |\n    | Best Pair              | ADA/USDT 540.88%    |\n    | Worst Pair             | ADA/USDT 540.88%    |\n    | Best trade             | ADA/USDT 148.95%    |\n    | Worst trade            | ADA/USDT -18.24%    |\n    | Best day               | 17171.430 USDT      |\n    | Worst day              | -7253.003 USDT      |\n    | Days win/draw/lose     | 81 / 1013 / 121     |\n    | Avg. Duration Winners  | 4 days, 10:40:00    |\n    | Avg. Duration Loser    | 1 day, 21:07:00     |\n    | Rejected Buy signals   | 14100               |\n    |                        |                     |\n    | Min balance            | 835.821 USDT        |\n    | Max balance            | 41123.976 USDT      |\n    | Drawdown               | 59.98%              |\n    | Drawdown               | 9754.773 USDT       |\n    | Drawdown high          | 39126.935 USDT      |\n    | Drawdown low           | 29372.162 USDT      |\n    | Drawdown Start         | 2021-05-16 22:00:00 |\n    | Drawdown End           | 2021-07-12 21:00:00 |\n    | Market change          | 624.61%             |\n    ================================================\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 100 # inactive\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.99 # inactive\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Hyperoptable parameters\n    buy_stoch_rsi = DecimalParameter(0.5, 1, decimals=3, default=0.8, space=\"buy\")\n    sell_stoch_rsi = DecimalParameter(0, 0.5, decimals=3, default=0.2, space=\"sell\")\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 90\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'ema90':{},\n            'supertrend_1':{},\n            'supertrend_2':{},\n            'supertrend_3':{},\n        },\n        'subplots': {\n            \"SUPERTREND DIRECTION\": {\n                'supertrend_direction_1': {},\n                'supertrend_direction_2': {},\n                'supertrend_direction_3': {},\n            },\n            \"STOCH RSI\": {\n                'stoch_rsi': {},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # # Stochastic RSI\n        dataframe['stoch_rsi']=ta.momentum.stochrsi(dataframe['close'])\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema90'] = ta.trend.ema_indicator(dataframe['close'], 90)\n\n        # Supertrend\n        supertrend_length = 20\n        supertrend_multiplier = 3.0\n        superTrend = pda.supertrend(dataframe['high'], dataframe['low'], dataframe['close'], length=supertrend_length, multiplier=supertrend_multiplier)\n        dataframe['supertrend_1'] = superTrend['SUPERT_' + str(supertrend_length) + \"_\" + str(supertrend_multiplier)]\n        dataframe['supertrend_direction_1'] = superTrend['SUPERTd_' + str(supertrend_length) + \"_\" + str(supertrend_multiplier)]\n        \n        supertrend_length = 20\n        supertrend_multiplier = 4.0\n        superTrend = pda.supertrend(dataframe['high'], dataframe['low'], dataframe['close'], length=supertrend_length, multiplier=supertrend_multiplier)\n        dataframe['supertrend_2'] = superTrend['SUPERT_' + str(supertrend_length) + \"_\" + str(supertrend_multiplier)]\n        dataframe['supertrend_direction_2'] = superTrend['SUPERTd_' + str(supertrend_length) + \"_\" + str(supertrend_multiplier)]\n        \n        supertrend_length = 40\n        supertrend_multiplier = 8.0\n        superTrend = pda.supertrend(dataframe['high'], dataframe['low'], dataframe['close'], length=supertrend_length, multiplier=supertrend_multiplier)\n        dataframe['supertrend_3'] = superTrend['SUPERT_' + str(supertrend_length) + \"_\" + str(supertrend_multiplier)]\n        dataframe['supertrend_direction_3'] = superTrend['SUPERTd_' + str(supertrend_length) + \"_\" + str(supertrend_multiplier)]\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                ((dataframe['supertrend_direction_1'] + dataframe['supertrend_direction_2'] + dataframe['supertrend_direction_3']) >= 1) &\n                (dataframe['stoch_rsi'] < self.buy_stoch_rsi.value) &\n                (dataframe['close'] > dataframe['ema90']) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                ((dataframe['supertrend_direction_1'] + dataframe['supertrend_direction_2'] + dataframe['supertrend_direction_3']) < 1) &\n                (dataframe['stoch_rsi'] > self.sell_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/SwingHigh/SwingHigh.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass SwingHigh(IStrategy):\n    # Disable ROI\n    # Could be replaced with new ROI from hyperopt.\n    minimal_roi = {\"0\": 0.16035, \"23\": 0.03218, \"54\": 0.01182, \"173\": 0}\n\n    stoploss = -0.22274\n\n    ### Do extra hyperopt for trailing seperat. Use \"--spaces default\" and then \"--spaces trailing\".\n    ### See here for more information: https://www.freqtrade.io/en/latest/hyperopt\n    trailing_stop = True\n    trailing_stop_positive = 0.08\n    trailing_stop_positive_offset = 0.10\n    trailing_only_offset_is_reached = True\n\n    ticker_interval = \"30m\"\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        macd = ta.MACD(dataframe)\n        dataframe[\"macd\"] = macd[\"macd\"]\n        dataframe[\"macdsignal\"] = macd[\"macdsignal\"]\n\n        ### Add timeperiod from hyperopt (replace xx with value):\n        ### \"xx\" must be replaced even before the first hyperopt is run,\n        ### else \"xx\" would be a syntax error because it must be a Integer value.\n        dataframe[\"cci-buy\"] = ta.CCI(dataframe, timeperiod=13)\n        dataframe[\"cci-sell\"] = ta.CCI(dataframe, timeperiod=76)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe[\"macd\"] > dataframe[\"macdsignal\"])\n                & (dataframe[\"cci-buy\"] <= -188.0)\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"buy\",\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe[\"macd\"] < dataframe[\"macdsignal\"])\n                & (dataframe[\"cci-sell\"] >= 231.0)\n                & (dataframe[\"volume\"] > 0)\n            ),\n            \"sell\",\n        ] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/SwingHighToSky/SwingHighToSky.py",
    "content": "\"\"\"\nauthor      = \"Kevin OssenbrÃ¼ck\"\ncopyright   = \"Free For Use\"\ncredits     = [\"Bloom Trading, Mohsen Hassan\"]\nlicense     = \"MIT\"\nversion     = \"1.0\"\nmaintainer  = \"Kevin OssenbrÃ¼ck\"\nemail       = \"kevin.ossenbrueck@pm.de\"\nstatus      = \"Live\"\n\"\"\"\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import IntParameter\nfrom functools import reduce\nfrom pandas import DataFrame\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\n\n\n\n# CCI timerperiods and values\ncciBuyTP = 72\ncciBuyVal = -175\ncciSellTP = 66\ncciSellVal = -106\n\n# RSI timeperiods and values\nrsiBuyTP = 36\nrsiBuyVal = 90\nrsiSellTP = 45\nrsiSellVal = 88\n\n\nclass SwingHighToSky(IStrategy):\n    INTERFACE_VERSION = 2\n\n    timeframe = '15m'\n\n    stoploss = -0.34338\n\n    minimal_roi = {\"0\": 0.27058, \"33\": 0.0853, \"64\": 0.04093, \"244\": 0}\n\n    buy_cci = IntParameter(low=-200, high=200, default=100, space='buy', optimize=True)\n    buy_cciTime = IntParameter(low=10, high=80, default=20, space='buy', optimize=True)\n    buy_rsi = IntParameter(low=10, high=90, default=30, space='buy', optimize=True)\n    buy_rsiTime = IntParameter(low=10, high=80, default=26, space='buy', optimize=True)\n\n    sell_cci = IntParameter(low=-200, high=200, default=100, space='sell', optimize=True)\n    sell_cciTime = IntParameter(low=10, high=80, default=20, space='sell', optimize=True)\n    sell_rsi = IntParameter(low=10, high=90, default=30, space='sell', optimize=True)\n    sell_rsiTime = IntParameter(low=10, high=80, default=26, space='sell', optimize=True)\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_cci\": -175,\n        \"buy_cciTime\": 72,\n        \"buy_rsi\": 90,\n        \"buy_rsiTime\": 36,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_cci\": -106,\n        \"sell_cciTime\": 66,\n        \"sell_rsi\": 88,\n        \"sell_rsiTime\": 45,\n    }\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        for val in self.buy_cciTime.range:\n            dataframe[f'cci-{val}'] = ta.CCI(dataframe, timeperiod=val)\n\n        for val in self.sell_cciTime.range:\n            dataframe[f'cci-sell-{val}'] = ta.CCI(dataframe, timeperiod=val)\n\n        for val in self.buy_rsiTime.range:\n            dataframe[f'rsi-{val}'] = ta.RSI(dataframe, timeperiod=val)\n\n        for val in self.sell_rsiTime.range:\n            dataframe[f'rsi-sell-{val}'] = ta.RSI(dataframe, timeperiod=val)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe[f'cci-{self.buy_cciTime.value}'] < self.buy_cci.value) &\n                (dataframe[f'rsi-{self.buy_rsiTime.value}'] < self.buy_rsi.value)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe[f'cci-sell-{self.sell_cciTime.value}'] > self.sell_cci.value) &\n                (dataframe[f'rsi-sell-{self.sell_rsiTime.value}'] > self.sell_rsi.value)\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/TDSequentialStrategy/TDSequentialStrategy.py",
    "content": "import talib.abstract as ta\r\nfrom pandas import DataFrame\r\nimport scipy.signal\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nfrom freqtrade.strategy.interface import IStrategy\r\n\r\n\r\nclass TDSequentialStrategy(IStrategy):\r\n    \"\"\"\r\n    Strategy based on TD Sequential indicator.\r\n    source:\r\n    https://hackernoon.com/how-to-buy-sell-cryptocurrency-with-number-indicator-td-sequential-5af46f0ebce1\r\n\r\n    Buy trigger:\r\n        When you see 9 consecutive closes \"lower\" than the close 4 bars prior.\r\n        An ideal buy is when the low of bars 6 and 7 in the count are exceeded by the low of bars 8 or 9.\r\n\r\n    Sell trigger:\r\n        When you see 9 consecutive closes \"higher\" than the close 4 candles prior.\r\n        An ideal sell is when the the high of bars 6 and 7 in the count are exceeded by the high of bars 8 or 9.\r\n\r\n    Created by @bmoulkaf\r\n    \"\"\"\r\n    INTERFACE_VERSION = 2\r\n\r\n    # Minimal ROI designed for the strategy\r\n    minimal_roi = {'0': 5}\r\n\r\n    # Optimal stoploss designed for the strategy\r\n    stoploss = -0.05\r\n\r\n    # Trailing stoploss\r\n    trailing_stop = False\r\n    # trailing_only_offset_is_reached = False\r\n    # trailing_stop_positive = 0.01\r\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\r\n\r\n    # Optimal timeframe for the strategy\r\n    timeframe = '1h'\r\n\r\n    # These values can be overridden in the \"ask_strategy\" section in the config.\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Optional order type mapping\r\n    order_types = {\r\n        'buy': 'limit',\r\n        'sell': 'limit',\r\n        'stoploss': 'limit',\r\n        'stoploss_on_exchange': False\r\n    }\r\n\r\n    # Number of candles the strategy requires before producing valid signals\r\n    startup_candle_count: int = 30\r\n\r\n    # Optional time in force for orders\r\n    order_time_in_force = {\r\n        'buy': 'gtc',\r\n        'sell': 'gtc',\r\n    }\r\n\r\n    def informative_pairs(self):\r\n        \"\"\"\r\n        Define additional, informative pair/interval combinations to be cached from the exchange.\r\n        These pair/interval combinations are non-tradeable, unless they are part\r\n        of the whitelist as well.\r\n        For more information, please consult the documentation\r\n        :return: List of tuples in the format (pair, interval)\r\n            Sample: return [(\"ETH/USDT\", \"5m\"),\r\n                            (\"BTC/USDT\", \"15m\"),\r\n                            ]\r\n        \"\"\"\r\n        return []\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Adds several different TA indicators to the given DataFrame\r\n\r\n        Performance Note: For the best performance be frugal on the number of indicators\r\n        you are using. Let uncomment only the indicator you are using in your strategies\r\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\r\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\r\n        :param metadata: Additional information, like the currently traded pair\r\n        :return: a Dataframe with all mandatory indicators for the strategies\r\n        \"\"\"\r\n\r\n        dataframe['exceed_high'] = False\r\n        dataframe['exceed_low'] = False\r\n\r\n        # count consecutive closes “lower” than the close 4 bars prior.\r\n        dataframe['seq_buy'] = dataframe['close'] < dataframe['close'].shift(4)\r\n        dataframe['seq_buy'] = dataframe['seq_buy'] * (dataframe['seq_buy'].groupby(\r\n            (dataframe['seq_buy'] != dataframe['seq_buy'].shift()).cumsum()).cumcount() + 1)\r\n\r\n        # count consecutive closes “higher” than the close 4 bars prior.\r\n        dataframe['seq_sell'] = dataframe['close'] > dataframe['close'].shift(4)\r\n        dataframe['seq_sell'] = dataframe['seq_sell'] * (dataframe['seq_sell'].groupby(\r\n            (dataframe['seq_sell'] != dataframe['seq_sell'].shift()).cumsum()).cumcount() + 1)\r\n\r\n        for index, row in dataframe.iterrows():\r\n            # check if the low of bars 6 and 7 in the count are exceeded by the low of bars 8 or 9.\r\n            seq_b = row['seq_buy']\r\n            if seq_b == 8:\r\n                dataframe.loc[index, 'exceed_low'] = (row['low'] < dataframe.loc[index - 2, 'low']) | \\\r\n                                    (row['low'] < dataframe.loc[index - 1, 'low'])\r\n            if seq_b > 8:\r\n                dataframe.loc[index, 'exceed_low'] = (row['low'] < dataframe.loc[index - 3 - (seq_b - 9), 'low']) | \\\r\n                                    (row['low'] < dataframe.loc[index - 2 - (seq_b - 9), 'low'])\r\n                if seq_b == 9:\r\n                    dataframe.loc[index, 'exceed_low'] = row['exceed_low'] | dataframe.loc[index-1, 'exceed_low']\r\n\r\n            # check if the high of bars 6 and 7 in the count are exceeded by the high of bars 8 or 9.\r\n            seq_s = row['seq_sell']\r\n            if seq_s == 8:\r\n                dataframe.loc[index, 'exceed_high'] = (row['high'] > dataframe.loc[index - 2, 'high']) | \\\r\n                                    (row['high'] > dataframe.loc[index - 1, 'high'])\r\n            if seq_s > 8:\r\n                dataframe.loc[index, 'exceed_high'] = (row['high'] > dataframe.loc[index - 3 - (seq_s - 9), 'high']) | \\\r\n                                    (row['high'] > dataframe.loc[index - 2 - (seq_s - 9), 'high'])\r\n                if seq_s == 9:\r\n                    dataframe.loc[index, 'exceed_high'] = row['exceed_high'] | dataframe.loc[index-1, 'exceed_high']\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the buy signal for the given dataframe\r\n        :param dataframe: DataFrame\r\n        :param metadata: Additional information, like the currently traded pair\r\n        :return: DataFrame with buy column\r\n        \"\"\"\r\n        dataframe[\"buy\"] = 0\r\n        dataframe.loc[((dataframe['exceed_low']) &\r\n                      (dataframe['seq_buy'] > 8))\r\n                      , 'buy'] = 1\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        \"\"\"\r\n        Based on TA indicators, populates the sell signal for the given dataframe\r\n        :param dataframe: DataFrame\r\n        :param metadata: Additional information, like the currently traded pair\r\n        :return: DataFrame with buy columnNA / NaN values\r\n        \"\"\"\r\n        dataframe[\"sell\"] = 0\r\n        dataframe.loc[((dataframe['exceed_high']) |\r\n                       (dataframe['seq_sell'] > 8))\r\n                      , 'sell'] = 1\r\n        return dataframe\r\n"
  },
  {
    "path": "strategies/TEMA/TEMA.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport pandas_ta as pta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TEMA(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1m'\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Strategy parameters\n    buy_rsi = IntParameter(10, 40, default=30, space=\"buy\")\n    sell_rsi = IntParameter(60, 90, default=70, space=\"sell\")\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    @property\n    def plot_config(self):\n        return {\n            # Main plot indicators (Moving averages, ...)\n            'main_plot': {\n                'tema': {},\n                'sar': {'color': 'white'},\n            },\n            'subplots': {\n                # Subplots - each dict defines one additional plot\n                \"MACD\": {\n                    'macd': {'color': 'blue'},\n                    'macdsignal': {'color': 'orange'},\n                },\n                \"RSI\": {\n                    'rsi': {'color': 'red'},\n                }\n            }\n        }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode.value in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/TechnicalExampleStrategy/TechnicalExampleStrategy.py",
    "content": "from pandas import DataFrame\nfrom technical.indicators import cmf\n\nfrom freqtrade.strategy.interface import IStrategy\n\n\nclass TechnicalExampleStrategy(IStrategy):\n    minimal_roi = {\n        \"0\": 0.01\n    }\n\n    stoploss = -0.05\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['cmf'] = cmf(dataframe, 21)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (\n                    (dataframe['cmf'] < 0)\n\n                )\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # different strategy used for sell points, due to be able to duplicate it to 100%\n        dataframe.loc[\n            (\n                (dataframe['cmf'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/TemaMaster/TemaMaster.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TemaMaster(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.20937,\n        \"238\": 0.06449,\n        \"1931\": 0.01703,\n        \"3474\": 0\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # Stoploss:\n    stoploss = -0.14791\n    \n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.17017\n    trailing_stop_positive_offset = 0.26713\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 14)\n        dataframe['TEMA'] = ta.TEMA(dataframe, timeperiod = 18)\n      \n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=26, stds=1.4)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n            \n            \n        dataframe['STDDEV'] = ta.STDDEV(dataframe, timeperiod=26, nbdev=1.4)\n        dataframe['MA'] = ta.MA(dataframe, timeperiod=26, matype=0)\n        dataframe[\"COEFFV\"] = dataframe['STDDEV']/dataframe['MA']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        \n        dataframe.loc[\n            (\n                  \n            ((qtpylib.crossed_above(dataframe[\"TEMA\"], dataframe[\"bb_lowerband\"]))\n            & \n              (dataframe['CMO']>-5)\n            \n             )\n                \n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                       \n        dataframe.loc[\n            (\n                \n\n            # (qtpylib.crossed_below(dataframe[\"CMO\"],-60))\n            ),\n            'sell'] = 1        \n        \n        return dataframe"
  },
  {
    "path": "strategies/TemaMaster3/TemaMaster3.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TemaMaster3(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.25574\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # Stoploss:\n    stoploss = -0.08848\n    \n    # Optimal timeframe for the strategy\n    timeframe = '1m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.12943\n    trailing_stop_positive_offset = 0.17942\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 180)\n        dataframe['TEMA'] = ta.TEMA(dataframe, timeperiod = 60)\n      \n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=60, stds=1.4)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n            \n            \n        dataframe['STDDEV'] = ta.STDDEV(dataframe, timeperiod=26, nbdev=1.4)\n        dataframe['MA'] = ta.MA(dataframe, timeperiod=26, matype=0)\n        dataframe[\"COEFFV\"] = dataframe['STDDEV']/dataframe['MA']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        \n        dataframe.loc[\n            (\n                  \n            (\n                (qtpylib.crossed_above(dataframe[\"TEMA\"], dataframe[\"bb_lowerband\"]))\n            & \n              (dataframe['CMO']>-3)\n             )\n                \n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                       \n        dataframe.loc[\n            (\n               (qtpylib.crossed_below(dataframe[\"CMO\"],-22)) \n               |\n                (qtpylib.crossed_below(dataframe[\"CMO\"],25)) \n            ),\n            'sell'] = 1        \n        \n        return dataframe"
  },
  {
    "path": "strategies/TemaPure/TemaPure.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TemaPure(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.40505,\n        \"265\": 0.24708,\n        \"743\": 0.05892,\n        \"1010\": 0\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.09754\n    \n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.2126\n    trailing_stop_positive_offset = 0.2225\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 50)\n        dataframe['TEMA'] = ta.TEMA(dataframe, timeperiod = 25)\n        # Bollinger bands\n        \n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=25, stds=2.0)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        \n        bollingerTA = ta.BBANDS(dataframe, timeperiod=25, nbdevup=3.5, nbdevdn=1.0, matype=0)\n        \n        dataframe['bb_lowerbandTA'] = bollingerTA['lowerband']\n        dataframe['bb_middlebandTA'] = bollingerTA['middleband']\n        dataframe['bb_upperbandTA'] = bollingerTA['upperband']\n\n        return dataframe\n \n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        dataframe.loc[\n            (\n                  # (qtpylib.crossed_below(dataframe[\"TEMA\"], dataframe[\"bb_lowerbandTA\"]))\n                  \n                         (((dataframe['TEMA']<=dataframe['bb_lowerbandTA']))\n            & \n              (qtpylib.crossed_above(dataframe['CMO'],0))) \n                  \n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                       \n        dataframe.loc[\n            (\n                \n                # (qtpylib.crossed_below(dataframe['close'],dataframe['bb_upperbandTA']))\n                # & \n                #   (dataframe[\"CMO\"]>=35)\n                \n            (qtpylib.crossed_above(dataframe[\"TEMA\"], dataframe[\"bb_upperbandTA\"]))\n                  \n            #   (((dataframe['close'].shift(1)<dataframe['bb_lowerband']))\n            # & \n            #   (qtpylib.crossed_above(dataframe['CMO'],0))) \n              \n                # | ((qtpylib.crossed_above(dataframe['close'],dataframe['bb_upperbandTA'])))\n                \n                \n            ),\n            'sell'] = 1        \n        \n        return dataframe"
  },
  {
    "path": "strategies/TemaPureNeat/TemaPureNeat.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TemaPureNeat(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.20934,\n        \"238\": 0.06449,\n        \"1931\": 0.01703,\n        \"3474\": 0\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    # Stoploss:\n    stoploss = -0.10145\n    \n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.29846\n    trailing_stop_positive_offset = 0.30425\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 14)\n        dataframe['TEMA'] = ta.TEMA(dataframe, timeperiod = 18)\n      \n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=25, stds=1.5)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        \n        bollingerTA = ta.BBANDS(dataframe, timeperiod=25, nbdevup=1.5, nbdevdn=1.5, matype=0)\n        \n        dataframe['bb_lowerbandTA'] = bollingerTA['lowerband']\n        dataframe['bb_middlebandTA'] = bollingerTA['middleband']\n        dataframe['bb_upperbandTA'] = bollingerTA['upperband']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        dataframe.loc[\n            (\n                  \n            (qtpylib.crossed_above(dataframe[\"TEMA\"], dataframe[\"bb_lowerband\"]))\n            & \n              (dataframe['CMO']>-5) \n                  \n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                       \n        dataframe.loc[\n            (\n                \n\n            ((qtpylib.crossed_below(dataframe[\"CMO\"],-58)))\n                \n            ),\n            'sell'] = 1        \n        \n        return dataframe"
  },
  {
    "path": "strategies/TemaPureTwo/TemaPureTwo.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec  2 13:50:49 2020\n\n@author: alex\n\"\"\"\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TemaPureTwo(IStrategy):\n    \"\"\"\n    Sample strategy implementing Informative Pairs - compares stake_currency with USDT.\n    Not performing very well - but should serve as an example how to use a referential pair against USDT.\n    author@: xmatthias\n    github@: https://github.com/freqtrade/freqtrade-strategies\n    How to use it?\n    > python3 freqtrade -s InformativeSample\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.12607,\n        \"331\": 0.12606,\n        \"865\": 0.12605,\n        \"1945\": 0.01\n    }\n\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.11\n    \n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.29846\n    trailing_stop_positive_offset = 0.30425\n    trailing_only_offset_is_reached = True\n\n    # run \"populate_indicators\" only for new candle\n    ta_on_candle = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return [(f\"{self.config['stake_currency']}/USDT\", self.timeframe)]\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['CMO'] = ta.CMO(dataframe, timeperiod = 50)\n        dataframe['TEMA'] = ta.TEMA(dataframe, timeperiod = 18)\n      \n        # Bollinger bands\n        bollingerTA1 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=1.0, nbdevdn=1.0, matype=0)\n        \n        dataframe['bb_lowerbandTA1'] = bollingerTA1['lowerband']\n        dataframe['bb_middlebandTA1'] = bollingerTA1['middleband']\n        dataframe['bb_upperbandTA1'] = bollingerTA1['upperband']\n        \n        bollingerTA2 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=2.0, nbdevdn=2.0, matype=0)\n        \n        dataframe['bb_lowerbandTA2'] = bollingerTA2['lowerband']\n        dataframe['bb_middlebandTA2'] = bollingerTA2['middleband']\n        dataframe['bb_upperbandTA2'] = bollingerTA2['upperband']\n        \n        bollingerTA3 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=3.0, nbdevdn=3.0, matype=0)\n        \n        dataframe['bb_lowerbandTA3'] = bollingerTA3['lowerband']\n        dataframe['bb_middlebandTA3'] = bollingerTA3['middleband']\n        dataframe['bb_upperbandTA3'] = bollingerTA3['upperband']\n        \n        bollingerTA4 = ta.BBANDS(dataframe, timeperiod=25, nbdevup=4.0, nbdevdn=4.0, matype=0)\n        \n        dataframe['bb_lowerbandTA4'] = bollingerTA4['lowerband']\n        dataframe['bb_middlebandTA4'] = bollingerTA4['middleband']\n        dataframe['bb_upperbandTA4'] = bollingerTA4['upperband']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                        \n        dataframe.loc[\n            (\n            # (qtpylib.crossed_below(dataframe[\"TEMA\"], dataframe[\"bb_lowerbandTA\"]))\n                  \n            (qtpylib.crossed_above(dataframe[\"TEMA\"], dataframe[\"bb_lowerbandTA1\"]))\n            & \n              (dataframe['CMO']>-0) \n                  \n                \n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n                       \n        dataframe.loc[\n            (\n                \n\n            ((qtpylib.crossed_below(dataframe[\"CMO\"],-25)) \n               # & (dataframe[\"TEMA\"]>=dataframe[\"bb_lowerbandTA2\"])\n               ) \n            # |\n            # ((qtpylib.crossed_below(dataframe[\"CMO\"],40)) \n            #   & (dataframe[\"TEMA\"]>=dataframe[\"bb_lowerbandTA1\"])) \n            # ((qtpylib.crossed_below(dataframe[\"CMO\"],25)) \n            #   & (dataframe[\"TEMA\"]<=dataframe[\"bb_middlebandTA1\"]))\n                \n                \n            ),\n            'sell'] = 1        \n        \n        return dataframe"
  },
  {
    "path": "strategies/TenderEnter/TenderEnter.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport math\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\n# from freqtrade.exchange import timeframe_to_minutes\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n# from freqtrade.strategy.strategy_helper import merge_informative_pair\n\nclass TenderEnter(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    custom_stops = {}\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    # minimal_roi = {\n    #     \"180\":  0.05, # 5% after 240 min\n    #     \"200\":  0.03,\n    #     \"240\":  0.00,\n    #     \"0\":  0.08 # 8% imidietly\n    # }\n    minimal_roi = {\n        \"0\": 0.21296,\n        \"94\": 0.13203,\n        \"190\": 0.04443,\n        \"374\": 0\n    }\n    # minimal_roi = {\n    #     \"180\":  0.2, # 5% after 240 min\n    #     \"200\":  0.1,\n    #     \"240\":  0.00,\n    #     \"0\":  0.3 # 8% imidietly\n    # }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    # stoploss = -0.4\n    stoploss = -0.25933\n\n    # Trailing stoploss\n    # trailing_stop = True\n    # trailing_stop_positive = 0.02\n    # trailing_stop_positive_offset = 0.03\n    # trailing_only_offset_is_reached = True\n    # trailing_stop_positive = 0.02\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n    trailing_stop = True\n    trailing_stop_positive = 0.25571\n    trailing_stop_positive_offset = 0.35142\n    trailing_only_offset_is_reached = True\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n    inf_tf = '15m' #timeframe of second line\n\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 102\n    \n    \n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': True\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        \n        # return [(metadata['pair'], \"15m\")]\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # pairs = self.dp.current_whitelist()\n        \n        # self.custom_stops = {pair: False for pair in pairs}\n        # for pair in pairs:\n        #     vals = {}\n        #     vals[pair]=False\n        #     arr.append(vals)\n        #     self.stopsByPair = [{pair: False} for pair in pairs]\n        # print('TT', metadata['pair'])    \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        # dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        # dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        # stoch_fast = ta.STOCHF(dataframe)\n        # dataframe['fastd'] = stoch_fast['fastd']\n        # dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        # macd = ta.MACD(dataframe)\n        # dataframe['macd'] = macd['macd']\n        # dataframe['macdsignal'] = macd['macdsignal']\n        # dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        # dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        # bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # dataframe['bb_lowerband'] = bollinger['lower']\n        # dataframe['bb_middleband'] = bollinger['mid']\n        # dataframe['bb_upperband'] = bollinger['upper']\n        # dataframe[\"bb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n        #     (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        # )\n        # dataframe[\"bb_width\"] = (\n        #     (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        # )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        # dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        # dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        # hilbert = ta.HT_SINE(dataframe)\n        # dataframe['htsine'] = hilbert['sine']\n        # dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \n     \n\n        \n        # informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=\"15m\")\n        # dataframe[\"date\"] = df[\"open_date\"] + df[\"Delta\"].map(pd.Timedelta.to_pytimedelta)\n        # dataframe = merge_informative_pair(dataframe, informative, self.timeframe, \"15m\", ffill=True)\n        \n        # informative = self.dp.get_pair_dataframe(metadata['pair'], inf_tf)\n        # informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_tf)\n        # informative = self.dp.get_pair_dataframe(pair=f\"{self.stake_currency}/USDT\", timeframe=self.inf_tf)\n        # dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, True)\n        # dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_tf, ffill=True)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n    \n        dataframe.loc[(\n            self.compareFields(dataframe, 'close', 1, 1017) &\n            self.compareFields(dataframe, 'close', 2, 1017) &\n            self.compareFields(dataframe, 'volume', 1, 65) &\n            self.compareFields(dataframe, 'volume', 2, 65) &\n            (dataframe['volume'] > 0)),'buy'] = 1\n        return dataframe\n\n    def compareFields(self, dt, fieldname, shift, ratio=1.034):\n        return dt[fieldname].shift(shift)/dt[fieldname] > ratio/1000\n\n    # def calcAngle(self, p1, p2, delta_x) -> bool:\n    #     delta_y = p2 - p1\n    #     theta_radians = np.arctan2(delta_y, delta_x)\n    #     return theta_radians < -0.900275\n\n    # def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,\n    #                         time_in_force: str, **kwargs) -> bool:\n    #     print('z', metadata[\"pair\"], self.custom_stops[metadata[\"pair\"]])                    \n    #     if self.custom_stops[metadata[\"pair\"]] == False:\n    #         self.custom_stops[metadata[\"pair\"]] = True\n    #         return True\n    #     else:\n    #         return False\n\n    # def confirm_trade_exit(self, pair: str, trade, order_type: str, amount: float,\n    #                        rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n    #     self.custom_stops[metadata[\"pair\"]] = True\n    #     return True\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # False\n                # (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 0\n        return dataframe\n    \n    # def merge_informative_pair(dataframe, informative, minutes, inf_tf, ffill):\n    #     print('>>', inf_tf,ffill)\n    #     # Shift date by 1 candle\n    #     # This is necessary since the data is always the \"open date\"\n    #     # and a 15m candle starting at 12:15 should not know the close of the 1h candle from 12:00 to 13:00\n    #     minutes = timeframe_to_minutes(inf_tf)\n    #     # Only do this if the timeframes are different:\n    #     informative['date_merge'] = informative[\"date\"] + pd.to_timedelta(minutes, 'm')\n\n    #     # Rename columns to be unique\n    #     informative.columns = [f\"{col}_{inf_tf}\" for col in informative.columns]\n    #     # Assuming inf_tf = '1d' - then the columns will now be:\n    #     # date_1d, open_1d, high_1d, low_1d, close_1d, rsi_1d\n\n    #     # Combine the 2 dataframes\n    #     # all indicators on the informative sample MUST be calculated before this point\n    #     dataframe = pd.merge(dataframe, informative, left_on='date', right_on=f'date_merge_{inf_tf}', how='left')\n    #     # FFill to have the 1d value available in every row throughout the day.\n    #     # Without this, comparisons would only work once per day.\n    #     dataframe = dataframe.ffill()\n    #     return dataframe    "
  },
  {
    "path": "strategies/TheForce/TheForce.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass TheForce(IStrategy):\n  \n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"30\": 0.005,\n        \"15\": 0.01,\n        \"0\": 0.012\n    }\n\n    stoploss = -0.015\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe,5,3,3)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        stoch_rsi = ta.STOCHRSI(dataframe)\n        dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe,12,26,1)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # # EMA - Exponential Moving Average\n\n        dataframe['ema5c'] = ta.EMA(dataframe['close'], timeperiod=5)\n        dataframe['ema5o'] = ta.EMA(dataframe['open'], timeperiod=5)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (\n                    (dataframe['fastk'] >= 20) & (dataframe['fastk'] <= 80)\n                    &\n                    (dataframe['fastd'] >= 20) & (dataframe['fastd'] <= 80)\n                )\n                &\n                (\n                    (dataframe['macd'] > dataframe['macd'].shift(1))\n                    &\n                    (dataframe['macdsignal'] > dataframe['macdsignal'].shift(1))\n                )\n                &\n                (\n                    (dataframe['close'] > dataframe['close'].shift(1))\n                )\n                &\n                (\n                    (dataframe['ema5c'] >= dataframe['ema5o'])\n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (\n                    (dataframe['fastk'] <= 80)\n                    &\n                    (dataframe['fastd'] <= 80)\n                )\n                &\n                (\n                    (dataframe['macd'] < dataframe['macd'].shift(1))\n                    &\n                    (dataframe['macdsignal'] < dataframe['macdsignal'].shift(1))\n                )\n                &\n                (\n                    (dataframe['ema5c'] < dataframe['ema5o'])\n                )\n                \n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/TheRealPullbackV2/TheRealPullbackV2.py",
    "content": "from freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame, Series\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom technical.indicators import RMI\n\n\n# The main idea of this strategy is to buy in dips and sell after recovery.\n\n\ndef chaikin_mf(df, periods=20):\n    close = df['close']\n    low = df['low']\n    high = df['high']\n    volume = df['volume']\n    mfv = ((close - low) - (high - close)) / (high - low)\n    mfv = mfv.fillna(0.0)\n    mfv *= volume\n    cmf = mfv.rolling(periods).sum() / volume.rolling(periods).sum()\n    return Series(cmf, name='cmf')\n\n\nclass TheRealPullbackV2(IStrategy):\n\n    minimal_roi = {\n        \"0\": 100\n    }\n\n    stoploss = -0.035\n\n    timeframe = '5m'\n\n    process_only_new_candles = True\n    ignore_roi_if_buy_signal = True\n    startup_candle_count = 200\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        bollinger = qtpylib.bollinger_bands(dataframe['close'], window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe['bb_width'] = ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) / dataframe['bb_middleband'])\n        dataframe['bb_bottom_cross'] = qtpylib.crossed_below(dataframe['close'], dataframe['bb_lowerband']).astype('int')\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=10)\n\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        dataframe['cci'] = ta.CCI(dataframe, 30)\n\n        dataframe['mfi'] = ta.MFI(dataframe, timeperiod=14)\n\n        dataframe['cmf'] = chaikin_mf(dataframe)\n\n        dataframe['rmi'] = RMI(dataframe, length=8, mom=4)\n\n        stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)\n        dataframe['srsi_fk'] = stoch['fastk']\n        dataframe['srsi_fd'] = stoch['fastd']\n\n        dataframe['fastEMA'] = ta.EMA(dataframe['volume'], timeperiod=12)\n        dataframe['slowEMA'] = ta.EMA(dataframe['volume'], timeperiod=26)\n        dataframe['pvo'] = ((dataframe['fastEMA'] - dataframe['slowEMA']) / dataframe['slowEMA']) * 100\n\n        dataframe['is_dip'] = (\n            (dataframe['rmi'] < 20)\n            &\n            (dataframe['cci'] <= -150)\n            &\n            (dataframe['srsi_fk'] < 20)\n            # Maybe comment mfi and cmf to make more trades\n            &\n            (dataframe['mfi'] < 25)\n            &\n            (dataframe['cmf'] <= -0.1)\n        ).astype('int')\n\n        dataframe['is_break'] = (\n            (dataframe['bb_width'] > 0.025)\n            &\n            (dataframe['bb_bottom_cross'].rolling(10).sum() > 1)\n            &\n            (dataframe['close'] < 0.99 * dataframe['bb_lowerband'])\n        ).astype('int')\n\n        dataframe['buy_signal'] = (\n            (dataframe['is_dip'] > 0)\n            &\n            (dataframe['is_break'] > 0)\n\n        ).astype('int')\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (dataframe['buy_signal'] > 0),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['close'], dataframe['bb_middleband']))\n                |\n                (qtpylib.crossed_below(dataframe['close'], dataframe['bb_upperband']))\n\n            ), 'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/TrailingBuyStrat2/TrailingBuyStrat2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, Series\n# --------------------------------\n\nimport logging\nimport pandas as pd\nimport numpy as np\nfrom datetime import datetime, timedelta, timezone\nfrom freqtrade.persistence import Trade\nimport time\n\nlogger = logging.getLogger(__name__)\n\n\nclass TrailingBuyStrat2(YourStrat):\n    # Original idea by @MukavaValkku, code by @tirail and @stash86\n    #\n    # This class is designed to inherit from yours and starts trailing buy with your buy signals\n    # Trailing buy starts at any buy signal and will move to next candles if the trailing still active\n    # Trailing buy stops  with BUY if : price decreases and rises again more than trailing_buy_offset\n    # Trailing buy stops with NO BUY : current price is > initial price * (1 +  trailing_buy_max) OR custom_sell tag\n    # IT IS NOT COMPATIBLE WITH BACKTEST/HYPEROPT\n    #\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_expire_seconds = 1800\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = False\n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    init_trailing_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,\n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n    def current_trailing_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_profit_ratio(pair, current_price)\n        default_offset = 0.005\n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    # end of trailing buy parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n        val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n        \n        if val:\n            if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_buy = self.trailing_buy(pair)\n                    trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                    if trailing_buy['allow_trailing']:\n                        if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                            # start trailing buy\n                            \n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_started'] = True\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_price'] = last_candle['close']\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['buy_tag'] = f\"initial_buy_tag (strat trail price {last_candle['close']})\"\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['start_trailing_time'] = datetime.now(timezone.utc)\n                            # self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = 0\n\n                            trailing_buy['trailing_buy_order_started'] = True\n                            trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                            trailing_buy['start_trailing_price'] = last_candle['close']\n                            trailing_buy['buy_tag'] = last_candle['buy_tag']\n                            trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_buy['offset'] = 0\n                            \n                            self.trailing_buy_info(pair, current_price)\n                            logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_buy['trailing_buy_order_started']:\n                            if trailing_buy_offset == 'forcebuy':\n                                # buy in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                            elif trailing_buy_offset is None:\n                                # stop trailing buy custom conditions\n                                self.trailing_buy(pair, reinit=True)\n                                logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                            elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                # update uplimit\n                                old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                            elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                # buy ! current price > uplimit && lower thant starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                            elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                # stop trailing buy because price is too high\n                                self.trailing_buy(pair, reinit=True)\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'price too high for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next buy signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_buy_info(pair, rate)\n                    self.trailing_buy(pair, reinit=True)\n                    logger.info(f'STOP trailing buy for {pair} because I buy it')\n        \n        return val\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n                    # dataframe['buy'] = 1\n\n        return dataframe\n\n"
  },
  {
    "path": "strategies/Trend_Strength_Directional/Trend_Strength_Directional.py",
    "content": "import talib.abstract as ta\nimport numpy as np  # noqa\nimport pandas as pd\nfrom functools import reduce\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter, RealParameter\n\n__author__ = \"Robert Roman\"\n__copyright__ = \"Free For Use\"\n__license__ = \"MIT\"\n__version__ = \"1.0\"\n__maintainer__ = \"Robert Roman\"\n__email__ = \"robertroman7@gmail.com\"\n__BTC_donation__ = \"3FgFaG15yntZYSUzfEpxr5mDt1RArvcQrK\"\n\n\n# Optimized With Sharpe Ratio and 1 years data\n# 12520 trades. 6438/5337/745 Wins/Draws/Losses. Avg profit   1.55%. Median profit   0.17%. Total profit  194026.95473822 USDT ( 194.03%). Avg duration 1 day, 9:13:00 min. Objective: -63.61104\n\nclass Trend_Strength_Directional(IStrategy):\n    INTERFACE_VERSION = 2\n\n    timeframe = '15m'\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.383,\n        \"120\": 0.082,\n        \"283\": 0.045,\n        \"495\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.314\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.307\n    trailing_stop_positive_offset = 0.364\n    trailing_only_offset_is_reached = False\n\n    # Hyperopt Buy Parameters\n    buy_plusdi_enabled = CategoricalParameter([True, False], space='buy', optimize=True, default=False)\n    buy_adx = IntParameter(low=1, high=100, default=12, space='buy', optimize=True, load=True)\n    buy_adx_timeframe = IntParameter(low=1, high=50, default=9, space='buy', optimize=True, load=True)\n    buy_plusdi = IntParameter(low=1, high=100, default=44, space='buy', optimize=True, load=True)\n    buy_minusdi = IntParameter(low=1, high=100, default=74, space='buy', optimize=True, load=True)\n\n    # Hyperopt Sell Parameters\n    sell_plusdi_enabled = CategoricalParameter([True, False], space='sell', optimize=True, default=True)\n    sell_adx = IntParameter(low=1, high=100, default=3, space='sell', optimize=True, load=True)\n    sell_adx_timeframe = IntParameter(low=1, high=50, default=41, space='sell', optimize=True, load=True)\n    sell_plusdi = IntParameter(low=1, high=100, default=49, space='sell', optimize=True, load=True)\n    sell_minusdi = IntParameter(low=1, high=100, default=11, space='sell', optimize=True, load=True)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        # GUARDS\n        if self.buy_plusdi_enabled.value:\n            conditions.append(ta.PLUS_DI(dataframe, timeperiod=int(self.buy_plusdi.value)) > ta.MINUS_DI(dataframe, timeperiod=int(self.buy_minusdi.value)))\n\n        # TRIGGERS\n        try:\n            conditions.append(ta.ADX(dataframe, timeperiod=int(self.buy_adx_timeframe.value)) > self.buy_adx.value)\n        except Exception:\n            pass\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        # GUARDS\n        if self.sell_plusdi_enabled.value:\n            conditions.append(ta.PLUS_DI(dataframe, timeperiod=int(self.sell_plusdi.value)) < ta.MINUS_DI(dataframe, timeperiod=int(self.sell_minusdi.value)))\n\n        # TRIGGERS\n        try:\n            conditions.append(ta.ADX(dataframe, timeperiod=int(self.sell_adx_timeframe.value)) < self.sell_adx.value)\n        except Exception:\n            pass\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/TrixStrategy/TrixStrategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport ta\n\n\n# This class is a sample. Feel free to customize it.\nclass TrixStrategy(IStrategy):\n    \"\"\"\n    Sources : \n    Cripto Robot : https://www.youtube.com/watch?v=uE04UROWkjs&list=PLpJ7cz_wOtsrqEQpveLc2xKLjOBgy4NfA&index=4\n    Github : https://github.com/CryptoRobotFr/TrueStrategy/blob/main/TrixStrategy/Trix_Complete_backtest.ipynb\n\n    freqtrade backtesting -s TrixStrategy --timerange=20170817-20210919 --stake-amount unlimited -p ETH/USDT --config user_data/config_binance.json --enable-position-stacking --max-open-trades 1\n    =============== SUMMARY METRICS ================\n    | Metric                 | Value               |\n    |------------------------+---------------------|\n    | Backtesting from       | 2017-08-18 01:00:00 |\n    | Backtesting to         | 2021-09-19 00:00:00 |\n    | Max open trades        | 1                   |\n    |                        |                     |\n    | Total/Daily Avg Trades | 910 / 0.61          |\n    | Starting balance       | 1000.000 USDT       |\n    | Final balance          | 455182.175 USDT     |\n    | Absolute profit        | 454182.175 USDT     |\n    | Total profit %         | 45418.22%           |\n    | Trades per day         | 0.61                |\n    | Avg. daily profit %    | 30.44%              |\n    | Avg. stake amount      | 89051.996 USDT      |\n    | Total trade volume     | 81037315.991 USDT   |\n    |                        |                     |\n    | Best Pair              | ETH/USDT 716.78%    |\n    | Worst Pair             | ETH/USDT 716.78%    |\n    | Best trade             | ETH/USDT 40.29%     |\n    | Worst trade            | ETH/USDT -17.67%    |\n    | Best day               | 69170.563 USDT      |\n    | Worst day              | -49006.144 USDT     |\n    | Days win/draw/lose     | 427 / 613 / 449     |\n    | Avg. Duration Winners  | 23:59:00            |\n    | Avg. Duration Loser    | 13:56:00            |\n    | Rejected Buy signals   | 17052               |\n    |                        |                     |\n    | Min balance            | 1064.302 USDT       |\n    | Max balance            | 466421.313 USDT     |\n    | Drawdown               | 37.23%              |\n    | Drawdown               | 149281.307 USDT     |\n    | Drawdown high          | 453758.871 USDT     |\n    | Drawdown low           | 304477.564 USDT     |\n    | Drawdown Start         | 2021-05-15 02:00:00 |\n    | Drawdown End           | 2021-07-02 08:00:00 |\n    | Market change          | 1028.84%            |\n    ================================================\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 100 # inactive\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.99 # inactive\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Hyperoptable parameters\n    buy_stoch_rsi = DecimalParameter(0.5, 1, decimals=3, default=0.8, space=\"buy\")\n    sell_stoch_rsi = DecimalParameter(0, 0.5, decimals=3, default=0.2, space=\"sell\")\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 21\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'trix': {},\n        },\n        'subplots': {\n            \"STOCH RSI\": {\n                'stoch_rsi': {},\n            },\n            \"TRIX\": {\n                'trix_pct': {},\n                'trix_signal': {},\n                'trix_histo': {},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # # Stochastic RSI\n        dataframe['stoch_rsi'] = ta.momentum.stochrsi(close=dataframe['close'], window=14, smooth1=3, smooth2=3)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # -- Trix Indicator --\n        trixLength = 9\n        trixSignal = 21\n        dataframe['trix'] = ta.trend.ema_indicator(ta.trend.ema_indicator(ta.trend.ema_indicator(close=dataframe['close'], window=trixLength), window=trixLength), window=trixLength)\n        dataframe['trix_pct'] = dataframe['trix'].pct_change() * 100\n        dataframe['trix_signal'] = ta.trend.sma_indicator(dataframe['trix_pct'],trixSignal)\n        dataframe['trix_histo'] = dataframe['trix_pct'] - dataframe['trix_signal']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['trix_histo'] > 0) &\n                (dataframe['stoch_rsi'] < self.buy_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['trix_histo'] < 0) &\n                (dataframe['stoch_rsi'] > self.sell_stoch_rsi.value) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/TrixV15Strategy/TrixV15Strategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (merge_informative_pair, \n                                BooleanParameter, \n                                CategoricalParameter, \n                                DecimalParameter,\n                                IStrategy, \n                                IntParameter)\n\n# --------------------------------\n# Add your lib to import here\n# import talib.abstract as ta\nimport ta\nfrom functools import reduce\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass TrixV15Strategy(IStrategy):\n    \"\"\"\n    Sources : \n    Cripto Robot : https://www.youtube.com/watch?v=uE04UROWkjs&list=PLpJ7cz_wOtsrqEQpveLc2xKLjOBgy4NfA&index=4\n    Github : https://github.com/CryptoRobotFr/TrueStrategy/blob/main/TrixStrategy/Trix_Complete_backtest.ipynb\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n      \"0\": 0.553,\n      \"423\": 0.144,\n      \"751\": 0.059,\n      \"1342\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.31\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = True\n    # trailing_stop_positive = 0.02\n    # trailing_stop_positive_offset = 0.9  # Disabled / not configured\n    \n    # Buy hyperspace params:\n    buy_params = {\n      \"buy_stoch_rsi_enabled\": True,\n      \"buy_ema_multiplier\": 0.85,\n      \"buy_ema_src\": \"open\",\n      \"buy_ema_timeperiod\": 10,\n      \"buy_ema_timeperiod_enabled\": True,\n      \"buy_stoch_rsi\": 0.901,\n      \"buy_trix_signal_timeperiod\": 19,\n      \"buy_trix_signal_type\": \"trigger\",\n      \"buy_trix_src\": \"low\",\n      \"buy_trix_timeperiod\": 8\n    }\n\n    sell_params = {\n      \"sell_stoch_rsi_enabled\": True,\n      \"sell_stoch_rsi\": 0.183,\n      \"sell_trix_signal_timeperiod\": 19,\n      \"sell_trix_signal_type\": \"trailing\",\n      \"sell_trix_src\": \"high\",\n      \"sell_trix_timeperiod\": 10\n    }\n\n    # HYPEROPTABLE PARAMETERS\n    # buy\n    buy_stoch_rsi_enabled = BooleanParameter(default=True, space=\"buy\", optimize=False, load=True)\n    buy_stoch_rsi = DecimalParameter(0.6, 0.99, decimals=3, default=0.987, space=\"buy\", optimize=True, load=True)\n    buy_trix_timeperiod = IntParameter(7, 13, default=12, space=\"buy\", optimize=True, load=True)\n    buy_trix_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"buy\", optimize=True, load=True)\n    buy_trix_signal_timeperiod = IntParameter(19, 25, default=22, space=\"buy\", optimize=True, load=True)\n    buy_trix_signal_type = CategoricalParameter(['trailing', 'trigger'], default='trigger', space=\"buy\", optimize=True, load=True)\n    buy_ema_timeperiod_enabled = BooleanParameter(default=True, space=\"buy\", optimize=True, load=True)\n    buy_ema_timeperiod = IntParameter(9, 100, default=21, space=\"buy\", optimize=True, load=True)\n    buy_ema_multiplier = DecimalParameter(0.8, 1.2, decimals=2, default=1.00, space=\"buy\", optimize=True, load=True)\n    buy_ema_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"buy\", optimize=True, load=True)\n    # sell\n    sell_stoch_rsi_enabled = BooleanParameter(default=True, space=\"sell\", optimize=False, load=True)\n    sell_stoch_rsi = DecimalParameter(0.01, 0.4, decimals=3, default=0.048, space=\"sell\", optimize=True, load=True)\n    sell_trix_timeperiod = IntParameter(7, 11, default=9, space=\"sell\", optimize=True, load=True)\n    sell_trix_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"sell\", optimize=True, load=True)\n    sell_trix_signal_timeperiod = IntParameter(17, 23, default=19, space=\"sell\", optimize=True, load=True)\n    sell_trix_signal_type = CategoricalParameter(['trailing', 'trigger'], default='trailing', space=\"sell\", optimize=True, load=True)\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 19\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'trix_b_8': {'color': 'blue'},\n            'trix_s_10': {'color': 'orange'},\n            'ema_b_signal': {'color': 'red'},\n        },\n         'subplots': {\n            \"TRIX BUY\": {\n                'trix_b_pct': {'color': 'blue'},\n                'trix_b_signal_19': {'color': 'orange'},\n            },\n            \"TRIX SELL\": {\n                'trix_s_pct': {'color': 'blue'},\n                'trix_s_signal_19': {'color': 'orange'},\n            },\n            \"STOCH RSI\": {\n                'stoch_rsi': {'color': 'blue'},\n            },\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        # # get access to all pairs available in whitelist.\n        # pairs = self.dp.current_whitelist()\n        # # Assign tf to each pair so they can be downloaded and cached for strategy.\n        # informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n        # \n        # return informative_pairs\n\n    # def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        #assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        #informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        # SMA\n        #informative_1d['1d_sma_200'] = ta.SMA(informative_1d, timeperiod=200)\n\n        # return informative_1d\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # The indicators for the 1h informative timeframe\n        # informative_1d = self.informative_1d_indicators(dataframe, metadata)\n        # dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # # Stochastic RSI\n        if self.buy_stoch_rsi_enabled.value or self.sell_stoch_rsi_enabled.value:\n            dataframe['stoch_rsi'] = ta.momentum.stochrsi(close=dataframe['close'], window=14, smooth1=3, smooth2=3)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # -- EMA --\n        for val in self.buy_ema_timeperiod.range:\n            dataframe[f'ema_b_{val}'] = ta.trend.ema_indicator(close=dataframe[self.buy_ema_src.value], window=val)\n        dataframe['ema_b_signal'] = dataframe[f'ema_b_{self.buy_ema_timeperiod.value}'] * self.buy_ema_multiplier.value\n\n        # -- Trix Indicator --\n        for val in self.buy_trix_timeperiod.range:\n            dataframe[f'trix_b_{val}'] = ta.trend.ema_indicator(ta.trend.ema_indicator(ta.trend.ema_indicator(close=dataframe[self.buy_trix_src.value], window=val), window=val), window=val)\n        dataframe['trix_b_pct'] = dataframe[f'trix_b_{self.buy_trix_timeperiod.value}'].pct_change() * 100\n        for val in self.buy_trix_signal_timeperiod.range:\n            dataframe[f'trix_b_signal_{val}'] = ta.trend.sma_indicator(dataframe['trix_b_pct'], window=val)\n\n        for val in self.sell_trix_timeperiod.range:\n            dataframe[f'trix_s_{val}'] = ta.trend.ema_indicator(ta.trend.ema_indicator(ta.trend.ema_indicator(close=dataframe[self.sell_trix_src.value], window=val), window=val), window=val)\n        dataframe['trix_s_pct'] = dataframe[f'trix_s_{self.sell_trix_timeperiod.value}'].pct_change() * 100\n        for val in self.sell_trix_signal_timeperiod.range:\n            dataframe[f'trix_s_signal_{val}'] = ta.trend.sma_indicator(dataframe['trix_s_pct'], window=val)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        conditions = []\n\n        # Guards and trends\n        conditions.append(dataframe['volume'] > 0)\n        conditions.append(dataframe['trix_s_pct'] > dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}'])\n        if self.buy_stoch_rsi_enabled.value:\n            conditions.append(dataframe['stoch_rsi'] < self.buy_stoch_rsi.value)\n        if self.buy_ema_timeperiod_enabled.value:\n            conditions.append(dataframe['close'] > dataframe['ema_b_signal'])\n        if self.buy_trix_signal_type.value == 'trailing':\n            conditions.append(dataframe['trix_b_pct'] > dataframe[f'trix_b_signal_{self.buy_trix_signal_timeperiod.value}'])\n\n        # Triggers\n        if self.buy_trix_signal_type.value == 'trigger':\n            conditions.append(qtpylib.crossed_above(dataframe['trix_b_pct'], dataframe[f'trix_b_signal_{self.buy_trix_signal_timeperiod.value}']))\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        conditions = []\n\n        # Guards and trends\n        conditions.append(dataframe['volume'] > 0)\n        if self.sell_stoch_rsi_enabled.value:\n            conditions.append(dataframe['stoch_rsi'] > self.sell_stoch_rsi.value)\n        if self.sell_trix_signal_type.value == 'trailing':\n            conditions.append(dataframe['trix_s_pct'] < dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}'])\n        \n        # Triggers\n        if self.sell_trix_signal_type.value == 'trigger':\n            conditions.append(qtpylib.crossed_below(dataframe['trix_s_pct'], dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}']))\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/TrixV21Strategy/TrixV21Strategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (merge_informative_pair, \n                                BooleanParameter, \n                                CategoricalParameter, \n                                DecimalParameter,\n                                IStrategy, \n                                IntParameter, \n                                informative)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nfrom functools import reduce\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.persistence import PairLocks, Trade\nfrom datetime import datetime\n\n\n# This class is a sample. Feel free to customize it.\nclass TrixV21Strategy(IStrategy):\n    \"\"\"\n    Sources : \n    Cripto Robot : https://www.youtube.com/watch?v=uE04UROWkjs&list=PLpJ7cz_wOtsrqEQpveLc2xKLjOBgy4NfA&index=4\n    Github : https://github.com/CryptoRobotFr/TrueStrategy/blob/main/TrixStrategy/Trix_Complete_backtest.ipynb\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n      \"0\": 0.553,\n      \"423\": 0.144,\n      \"751\": 0.059,\n      \"1342\": 0.02\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.31\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = True\n    # trailing_stop_positive = 0.02\n    # trailing_stop_positive_offset = 0.9  # Disabled / not configured\n    \n    # Buy hyperspace params:\n    buy_params = {\n      \"buy_stoch_rsi_enabled\": True,\n      \"buy_ema_multiplier\": 0.85,\n      \"buy_ema_src\": \"open\",\n      \"buy_ema_timeperiod\": 10,\n      \"buy_ema_timeperiod_enabled\": True,\n      \"buy_stoch_rsi\": 0.901,\n      \"buy_trix_signal_timeperiod\": 19,\n      \"buy_trix_signal_type\": \"trigger\",\n      \"buy_trix_src\": \"low\",\n      \"buy_trix_timeperiod\": 8,\n      \"buy_ema_guard_multiplier\": 0.994,\n      \"buy_ema_guard_timeperiod\": 238\n    }\n\n    sell_params = {\n      \"sell_stoch_rsi\": 0.183,\n      \"sell_stoch_rsi_enabled\": True,\n      \"sell_trix_signal_timeperiod\": 19,\n      \"sell_trix_signal_type\": \"trailing\",\n      \"sell_trix_src\": \"high\",\n      \"sell_trix_timeperiod\": 10,\n      \"sell_atr_enabled\": True,\n      \"sell_atr_multiplier\": 4.99,\n      \"sell_atr_timeperiod\": 30\n    }\n\n    # HYPEROPTABLE PARAMETERS\n    # buy\n    buy_stoch_rsi_enabled = BooleanParameter(default=True, space=\"buy\", optimize=False, load=True)\n    buy_stoch_rsi = DecimalParameter(0.6, 0.99, decimals=3, default=0.987, space=\"buy\", optimize=False, load=True)\n\n    buy_trix_timeperiod = IntParameter(7, 13, default=12, space=\"buy\", optimize=False, load=True)\n    buy_trix_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"buy\", optimize=False, load=True)\n    buy_trix_signal_timeperiod = IntParameter(19, 25, default=22, space=\"buy\", optimize=False, load=True)\n    buy_trix_signal_type = CategoricalParameter(['trailing', 'trigger'], default='trigger', space=\"buy\", optimize=False, load=True)\n\n    buy_ema_timeperiod_enabled = BooleanParameter(default=True, space=\"buy\", optimize=False, load=True)\n    buy_ema_timeperiod = IntParameter(9, 100, default=21, space=\"buy\", optimize=False, load=True)\n    buy_ema_multiplier = DecimalParameter(0.8, 1.2, decimals=2, default=1.00, space=\"buy\", optimize=False, load=True)\n    buy_ema_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"buy\", optimize=False, load=True)\n\n    buy_ema_guard_timeperiod = IntParameter(150, 250, default=200, space=\"buy\", optimize=True, load=True)\n    buy_ema_guard_multiplier = DecimalParameter(0.8, 1.0, decimals=3, default=0.97, space=\"buy\", optimize=True, load=True)\n\n    # sell\n    sell_stoch_rsi_enabled = BooleanParameter(default=True, space=\"sell\", optimize=False, load=True)\n    sell_stoch_rsi = DecimalParameter(0.01, 0.4, decimals=3, default=0.048, space=\"sell\", optimize=False, load=True)\n\n    sell_trix_timeperiod = IntParameter(7, 11, default=9, space=\"sell\", optimize=False, load=True)\n    sell_trix_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"sell\", optimize=False, load=True)\n    sell_trix_signal_timeperiod = IntParameter(17, 23, default=19, space=\"sell\", optimize=False, load=True)\n    sell_trix_signal_type = CategoricalParameter(['trailing', 'trigger'], default='trailing', space=\"sell\", optimize=False, load=True)\n\n    sell_atr_enabled = BooleanParameter(default=True, space=\"sell\", optimize=False, load=True)\n    sell_atr_timeperiod = IntParameter(9, 30, default=14, space=\"sell\", optimize=False, load=True)\n    sell_atr_multiplier = DecimalParameter(0.7, 9.0, decimals=3, default=4.0, space=\"sell\", optimize=False, load=True)\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    use_custom_stoploss = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 238\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'trix_b_8': {'color': 'blue'},\n            'trix_s_10': {'color': 'orange'},\n            'ema_b_signal': {'color': 'red'},\n            'stoploss_price': {},\n            'ema_guard_238': {},\n        },\n         'subplots': {\n            \"TRIX BUY\": {\n                'trix_b_pct': {'color': 'blue'},\n                'trix_b_signal_19': {'color': 'orange'},\n            },\n            \"TRIX SELL\": {\n                'trix_s_pct': {'color': 'blue'},\n                'trix_s_signal_19': {'color': 'orange'},\n            },\n            \"STOCH RSI\": {\n                'stoch_rsi': {'color': 'blue'},\n            },\n        }\n    }\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        if self.sell_atr_enabled.value == False:\n            return 1\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        stoploss_price = last_candle['low'] - last_candle[f'atr_{self.sell_atr_timeperiod.value}'] * self.sell_atr_multiplier.value\n\n        if stoploss_price < current_rate:\n            return (stoploss_price / current_rate) - 1\n\n        # return maximum stoploss value, keeping current stoploss price unchanged\n        return 1\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # -- Stochastic RSI --\n        if self.buy_stoch_rsi_enabled.value or self.sell_stoch_rsi_enabled.value:\n            #RSI\n            rsi = ta.RSI(dataframe, timeperiod=14)\n            #StochRSI \n            period = 14\n            stochrsi  = (rsi - rsi.rolling(period).min()) / (rsi.rolling(period).max() - rsi.rolling(period).min())\n            dataframe['stoch_rsi'] = stochrsi\n\n        # -- EMA --\n        for val in self.buy_ema_timeperiod.range:\n            dataframe[f'ema_b_{val}'] = ta.EMA(dataframe[self.buy_ema_src.value], timeperiod=val)\n        dataframe['ema_b_signal'] = dataframe[f'ema_b_{self.buy_ema_timeperiod.value}'] * self.buy_ema_multiplier.value\n        \n        for val in self.buy_ema_guard_timeperiod.range:\n            dataframe[f'ema_guard_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # -- Trix Indicator --\n        for val in self.buy_trix_timeperiod.range:\n            dataframe[f'trix_b_{val}'] = ta.EMA(ta.EMA(ta.EMA(dataframe[self.buy_trix_src.value], timeperiod=val), timeperiod=val), timeperiod=val)\n        dataframe['trix_b_pct'] = dataframe[f'trix_b_{self.buy_trix_timeperiod.value}'].pct_change() * 100\n        for val in self.buy_trix_signal_timeperiod.range:\n            dataframe[f'trix_b_signal_{val}'] = ta.SMA(dataframe['trix_b_pct'], timeperiod=val)\n\n        for val in self.sell_trix_timeperiod.range:\n            dataframe[f'trix_s_{val}'] = ta.EMA(ta.EMA(ta.EMA(dataframe[self.sell_trix_src.value], timeperiod=val), timeperiod=val), timeperiod=val)\n        dataframe['trix_s_pct'] = dataframe[f'trix_s_{self.sell_trix_timeperiod.value}'].pct_change() * 100\n        for val in self.sell_trix_signal_timeperiod.range:\n            dataframe[f'trix_s_signal_{val}'] = ta.SMA(dataframe['trix_s_pct'], timeperiod=val)\n\n        # -- ATR --\n        for val in self.sell_atr_timeperiod.range:\n            dataframe[f'atr_{val}'] = ta.ATR(dataframe['high'], dataframe['low'], dataframe['close'], timeperiod=val)\n        dataframe['stoploss_price'] = dataframe['low'] - dataframe[f'atr_{self.sell_atr_timeperiod.value}'] * self.sell_atr_multiplier.value\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        conditions = []\n\n        # Guards and trends\n        conditions.append(dataframe['volume'] > 0)\n        conditions.append(dataframe['close'] > (dataframe[f'ema_guard_{self.buy_ema_guard_timeperiod.value}'] * self.buy_ema_guard_multiplier.value))\n        conditions.append(dataframe['trix_s_pct'] > dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}'])\n        if self.buy_stoch_rsi_enabled.value:\n            conditions.append(dataframe['stoch_rsi'] < self.buy_stoch_rsi.value)\n        if self.buy_ema_timeperiod_enabled.value:\n            conditions.append(dataframe['close'] > dataframe['ema_b_signal'])\n        if self.buy_trix_signal_type.value == 'trailing':\n            conditions.append(dataframe['trix_b_pct'] > dataframe[f'trix_b_signal_{self.buy_trix_signal_timeperiod.value}'])\n\n        # Triggers\n        if self.buy_trix_signal_type.value == 'trigger':\n            conditions.append(qtpylib.crossed_above(dataframe['trix_b_pct'], dataframe[f'trix_b_signal_{self.buy_trix_signal_timeperiod.value}']))\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        conditions = []\n\n        # Guards and trends\n        conditions.append(dataframe['volume'] > 0)\n        if self.sell_stoch_rsi_enabled.value:\n            conditions.append(dataframe['stoch_rsi'] > self.sell_stoch_rsi.value)\n        if self.sell_trix_signal_type.value == 'trailing':\n            conditions.append(dataframe['trix_s_pct'] < dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}'])\n        \n        # Triggers\n        if self.sell_trix_signal_type.value == 'trigger':\n            conditions.append(qtpylib.crossed_below(dataframe['trix_s_pct'], dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}']))\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/TrixV23Strategy/TrixV23Strategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (merge_informative_pair, \n                                BooleanParameter, \n                                CategoricalParameter, \n                                DecimalParameter,\n                                IStrategy, \n                                IntParameter, \n                                informative)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nfrom functools import reduce\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.persistence import PairLocks, Trade\nfrom datetime import datetime\n\n\n# This class is a sample. Feel free to customize it.\nclass TrixV23Strategy(IStrategy):\n    \"\"\"\n    Sources : \n    Cripto Robot : https://www.youtube.com/watch?v=uE04UROWkjs&list=PLpJ7cz_wOtsrqEQpveLc2xKLjOBgy4NfA&index=4\n    Github : https://github.com/CryptoRobotFr/TrueStrategy/blob/main/TrixStrategy/Trix_Complete_backtest.ipynb\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.553,\n        \"423\": 0.144,\n        \"751\": 0.059,\n        \"1342\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.31\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = True\n    # trailing_stop_positive = 0.02\n    # trailing_stop_positive_offset = 0.9  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    use_custom_stoploss = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 200\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    #---------------------------#\n    #-- Hyperspace parameters --#\n    #---------------------------#\n\n    buy_params = {\n        \"buy_trix_signal_type\": \"trigger\",\n        \"buy_trix_src\": \"low\",\n        \"buy_trix_timeperiod\": 8,\n        \"buy_trix_signal_timeperiod\": 19,\n\n        \"buy_stoch_rsi_enabled\": True,\n        \"buy_rsi_timeperiod\": 14,\n        \"buy_stoch_rsi_timeperiod\": 14,\n        \"buy_stoch_rsi\": 0.901,\n\n        \"buy_ema_enabled\": True,\n        \"buy_ema_src\": \"open\",\n        \"buy_ema_timeperiod\": 10,\n        \"buy_ema_multiplier\": 0.85,\n\n        \"buy_btc_ema_enabled\": True,\n        \"buy_btc_ema_multiplier\": 0.996,\n        \"buy_btc_ema_timeperiod\": 184,\n    }\n\n    sell_params = {\n        \"sell_trix_signal_type\": \"trailing\",\n        \"sell_trix_src\": \"high\",\n        \"sell_trix_timeperiod\": 10,\n        \"sell_trix_signal_timeperiod\": 19,\n\n        \"sell_stoch_rsi_enabled\": True,\n        \"sell_rsi_timeperiod\": 14,\n        \"sell_stoch_rsi_timeperiod\": 14,\n        \"sell_stoch_rsi\": 0.183,\n\n        \"sell_atr_enabled\": True,\n        \"sell_atr_timeperiod\": 30,\n        \"sell_atr_multiplier\": 4.99,\n    }\n\n    #------------------------------#\n    #-- Hyperoptables parameters --#\n    #------------------------------#\n    \n    # buy\n\n    buy_trix_signal_type = CategoricalParameter(['trailing', 'trigger'], default='trigger', space=\"buy\", optimize=False, load=True)\n    buy_trix_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"buy\", optimize=False, load=True)\n    buy_trix_timeperiod = IntParameter(5, 25, default=9, space=\"buy\", optimize=False, load=True)\n    buy_trix_signal_timeperiod = IntParameter(5, 25, default=21, space=\"buy\", optimize=False, load=True)\n\n    buy_stoch_rsi_enabled = BooleanParameter(default=True, space=\"buy\", optimize=False, load=True)\n    buy_rsi_timeperiod = IntParameter(5, 25, default=14, space=\"buy\", optimize=False, load=True)\n    buy_stoch_rsi = DecimalParameter(0.6, 0.99, decimals=3, default=0.987, space=\"buy\", optimize=False, load=True)\n    buy_stoch_rsi_timeperiod = IntParameter(5, 25, default=14, space=\"buy\", optimize=False, load=True)\n\n    buy_ema_enabled = BooleanParameter(default=False, space=\"buy\", optimize=False, load=True)\n    buy_ema_timeperiod = IntParameter(9, 100, default=21, space=\"buy\", optimize=False, load=True)\n    buy_ema_multiplier = DecimalParameter(0.8, 1.2, decimals=2, default=1.00, space=\"buy\", optimize=False, load=True)\n    buy_ema_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"buy\", optimize=False, load=True)\n\n    buy_btc_ema_enabled = BooleanParameter(default=False, space=\"buy\", optimize=True, load=True)\n    buy_btc_ema_timeperiod = IntParameter(150, 250, default=200, space=\"buy\", optimize=True, load=True)\n    buy_btc_ema_multiplier = DecimalParameter(0.8, 1.0, decimals=3, default=0.97, space=\"buy\", optimize=True, load=True)\n\n    # sell\n\n    sell_trix_signal_type = CategoricalParameter(['trailing', 'trigger'], default='trailing', space=\"sell\", optimize=False, load=True)\n    sell_trix_src = CategoricalParameter(['open', 'high', 'low', 'close'], default='close', space=\"sell\", optimize=False, load=True)\n    sell_trix_timeperiod = IntParameter(5, 25, default=9, space=\"sell\", optimize=False, load=True)\n    sell_trix_signal_timeperiod = IntParameter(5, 25, default=21, space=\"sell\", optimize=False, load=True)\n\n    sell_stoch_rsi_enabled = BooleanParameter(default=True, space=\"sell\", optimize=False, load=True)\n    sell_rsi_timeperiod = IntParameter(5, 25, default=14, space=\"sell\", optimize=False, load=True)\n    sell_stoch_rsi = DecimalParameter(0.01, 0.4, decimals=3, default=0.048, space=\"sell\", optimize=False, load=True)\n    sell_stoch_rsi_timeperiod = IntParameter(5, 25, default=14, space=\"sell\", optimize=False, load=True)\n\n    sell_atr_enabled = BooleanParameter(default=True, space=\"sell\", optimize=False, load=True)\n    sell_atr_timeperiod = IntParameter(9, 30, default=14, space=\"sell\", optimize=False, load=True)\n    sell_atr_multiplier = DecimalParameter(0.7, 9.0, decimals=3, default=4.0, space=\"sell\", optimize=False, load=True)\n\n    plot_config = {\n        'main_plot': {\n            'trix_b_8': {'color': 'blue'},\n            'trix_s_10': {'color': 'orange'},\n            'ema_b_signal': {'color': 'red'},\n            'btc_usdt_close_1h': {'color': 'purple'},\n            'btc_usdt_ema_184_1h': {'color': 'yellow'},\n        },\n         'subplots': {\n            \"TRIX BUY\": {\n                'trix_b_pct': {'color': 'blue'},\n                'trix_b_signal_19': {'color': 'orange'},\n            },\n            \"TRIX SELL\": {\n                'trix_s_pct': {'color': 'blue'},\n                'trix_s_signal_19': {'color': 'orange'},\n            },\n            \"STOCH RSI\": {\n                'b_stoch_rsi': {'color': 'blue'},\n                's_stoch_rsi': {'color': 'orange'},\n            },\n        }\n    }\n\n    @informative('1h', 'BTC/{stake}')\n    def populate_indicators_btc_1h(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        #---------#\n        #-- BTC --#\n        #---------#\n\n        for val in self.buy_btc_ema_timeperiod.range:\n            dataframe[f'ema_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        return dataframe\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\n\n        #------------------------#\n        #-- ATR based stoploss --#\n        #------------------------#\n\n        if self.sell_atr_enabled.value == False:\n            return 1\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        stoploss_price = last_candle['low'] - last_candle[f'atr_{self.sell_atr_timeperiod.value}'] * self.sell_atr_multiplier.value\n\n        if stoploss_price < current_rate:\n            return (stoploss_price / current_rate) - 1\n\n        # return maximum stoploss value, keeping current stoploss price unchanged\n        return 1\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        #----------------#\n        #-- Indicators --#\n        #----------------#\n\n        # Trix Indicator\n        for val in self.buy_trix_timeperiod.range:\n            dataframe[f'trix_b_{val}'] = ta.EMA(ta.EMA(ta.EMA(dataframe[self.buy_trix_src.value], timeperiod=val), timeperiod=val), timeperiod=val)\n        dataframe['trix_b_pct'] = dataframe[f'trix_b_{self.buy_trix_timeperiod.value}'].pct_change() * 100\n        for val in self.buy_trix_signal_timeperiod.range:\n            dataframe[f'trix_b_signal_{val}'] = ta.SMA(dataframe['trix_b_pct'], timeperiod=val)\n\n        for val in self.sell_trix_timeperiod.range:\n            dataframe[f'trix_s_{val}'] = ta.EMA(ta.EMA(ta.EMA(dataframe[self.sell_trix_src.value], timeperiod=val), timeperiod=val), timeperiod=val)\n        dataframe['trix_s_pct'] = dataframe[f'trix_s_{self.sell_trix_timeperiod.value}'].pct_change() * 100\n        for val in self.sell_trix_signal_timeperiod.range:\n            dataframe[f'trix_s_signal_{val}'] = ta.SMA(dataframe['trix_s_pct'], timeperiod=val)\n\n        # Stochastic RSI\n        for val in self.buy_rsi_timeperiod.range:\n            dataframe['b_rsi'] = ta.RSI(dataframe, timeperiod=val)\n        for val in self.buy_stoch_rsi_timeperiod.range:\n            dataframe['b_stoch_rsi'] = (dataframe['b_rsi'] - dataframe['b_rsi'].rolling(val).min()) / (dataframe['b_rsi'].rolling(val).max() - dataframe['b_rsi'].rolling(val).min())\n\n        for val in self.sell_rsi_timeperiod.range:\n            dataframe['s_rsi'] = ta.RSI(dataframe, timeperiod=val)\n        for val in self.sell_stoch_rsi_timeperiod.range:\n            dataframe['s_stoch_rsi'] = (dataframe['s_rsi'] - dataframe['s_rsi'].rolling(val).min()) / (dataframe['s_rsi'].rolling(val).max() - dataframe['s_rsi'].rolling(val).min())\n\n        # EMA\n        for val in self.buy_ema_timeperiod.range:\n            dataframe[f'ema_b_{val}'] = ta.EMA(dataframe[self.buy_ema_src.value], timeperiod=val)\n        dataframe['ema_b_signal'] = dataframe[f'ema_b_{self.buy_ema_timeperiod.value}'] * self.buy_ema_multiplier.value\n\n        # ATR\n        for val in self.sell_atr_timeperiod.range:\n            dataframe[f'atr_{val}'] = ta.ATR(dataframe['high'], dataframe['low'], dataframe['close'], timeperiod=val)\n        dataframe['stoploss_price'] = dataframe['low'] - dataframe[f'atr_{self.sell_atr_timeperiod.value}'] * self.sell_atr_multiplier.value\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        stake = self.config['stake_currency'].lower()\n\n        #-----------------------#\n        #-- Guards and trends --#\n        #-----------------------#\n\n        # For backtesting & Hyperopt\n        conditions.append(dataframe['volume'] > 0)\n\n        # Can't send a buy signal at the same time as a sell signal\n        conditions.append(dataframe['trix_s_pct'] > dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}'])\n\n        # If BTC is not going well, don't buy\n        if self.buy_btc_ema_enabled.value:\n            conditions.append(dataframe[f'btc_{stake}_close_1h'] > (dataframe[f'btc_{stake}_ema_{self.buy_btc_ema_timeperiod.value}_1h'] * self.buy_btc_ema_multiplier.value))\n        \n        # Stoch RSI\n        if self.buy_stoch_rsi_enabled.value:\n            conditions.append(dataframe['b_stoch_rsi'] < self.buy_stoch_rsi.value)\n\n        # Trend check\n        if self.buy_ema_enabled.value:\n            conditions.append(dataframe['close'] > dataframe['ema_b_signal'])\n\n        # Probably less efficient than trigger mode\n        if self.buy_trix_signal_type.value == 'trailing':\n            conditions.append(dataframe['trix_b_pct'] > dataframe[f'trix_b_signal_{self.buy_trix_signal_timeperiod.value}'])\n\n        #--------------#\n        #-- Triggers --#\n        #--------------#\n\n        # Main trigger : trix indicator\n        if self.buy_trix_signal_type.value == 'trigger':\n            conditions.append(qtpylib.crossed_above(dataframe['trix_b_pct'], dataframe[f'trix_b_signal_{self.buy_trix_signal_timeperiod.value}']))\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        conditions = []\n\n        #-----------------------#\n        #-- Guards and trends --#\n        #-----------------------#\n\n        # For backtesting & Hyperopt\n        conditions.append(dataframe['volume'] > 0)\n\n        # Stoch RSI\n        if self.sell_stoch_rsi_enabled.value:\n            conditions.append(dataframe['s_stoch_rsi'] > self.sell_stoch_rsi.value)\n\n        # Main indicator : Trix\n        if self.sell_trix_signal_type.value == 'trailing':\n            conditions.append(dataframe['trix_s_pct'] < dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}'])\n        \n        #--------------#\n        #-- Triggers --#\n        #--------------#\n\n        # Main indicator. We probably want trailing mode\n        if self.sell_trix_signal_type.value == 'trigger':\n            conditions.append(qtpylib.crossed_below(dataframe['trix_s_pct'], dataframe[f'trix_s_signal_{self.sell_trix_signal_timeperiod.value}']))\n\n        dataframe.loc[\n            reduce(lambda x, y: x & y, conditions),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/UltimateMomentumIndicator/UltimateMomentumIndicator.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import IStrategy\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\"\"\"\n    https://fr.tradingview.com/script/dV5HEGpP-Ultimate-Momentum-Indicator-CC/\n    translated for freqtrade: viksal1982  viktors.s@gmail.com\n\"\"\"\n \n\n\nclass UltimateMomentumIndicator(IStrategy):\n  \n    \n\n\n    INTERFACE_VERSION = 2\n\n\n \n\n    length1_buy = IntParameter(2, 20, default= 13, space='buy')\n    length2_buy = IntParameter(10, 40, default= 19, space='buy')\n    length3_buy = IntParameter(10, 50, default= 21, space='buy')\n    length4_buy = IntParameter(20, 80, default= 39, space='buy')\n    length5_buy = IntParameter(30, 100, default= 50, space='buy')\n    length6_buy = IntParameter(150, 300, default= 200, space='buy')\n   \n    stoploss = -0.99\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n    custom_info = {}\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n\n        },\n        'subplots': {\n\n            \"utmi\": {\n                'utmi': {'color': 'red'},\n            }\n        }\n    }\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        source = 'close'\n        length6 = int(self.length6_buy.value)\n        length1 = int(self.length1_buy.value)\n        length2 = int(self.length2_buy.value)\n        length3 = int(self.length3_buy.value)\n        length4 = int(self.length4_buy.value)\n        length5 = int(self.length5_buy.value)\n        dataframe['basis'] = ta.SMA(dataframe[source], timeperiod = length6)\n        dataframe['dev'] = dataframe[source].rolling(length6).std()\n        dataframe['upperBand'] = dataframe['basis'] + dataframe['dev']\n        dataframe['lowerBand'] = dataframe['basis'] - dataframe['dev']\n        dataframe['bPct'] = np.where( (dataframe['upperBand'] - dataframe['lowerBand'] ) != 0, (dataframe[source] - dataframe['lowerBand'])/(dataframe['upperBand'] - dataframe['lowerBand']),0 )\n\n        dataframe['advSum'] = pd.Series(np.where(dataframe[source].diff() > 0, 1, 0)).rolling(length2).sum()\n        dataframe['decSum'] = pd.Series(np.where(dataframe[source].diff() > 0, 0, 1)).rolling(length2).sum()\n        dataframe['ratio'] = np.where(dataframe['decSum'] != 0, dataframe['advSum']/dataframe['decSum'], 0)\n        dataframe['rana'] = np.where( (dataframe['advSum'] + dataframe['decSum']) != 0, (dataframe['advSum'] - dataframe['decSum'])/(dataframe['advSum'] + dataframe['decSum']), 0)\n        dataframe['mo'] = ta.EMA(dataframe['rana'], timeperiod = length2) - ta.EMA(dataframe['rana'], timeperiod = length4) \n        dataframe['utm'] = (200 * dataframe['bPct']) + (100 * dataframe['ratio']) + (2 * dataframe['mo']) + (1.5 * ta.MFI(dataframe, timeperiod = length5) ) + (3 * ta.MFI(dataframe, timeperiod = length3) ) + (3 * ta.MFI(dataframe, timeperiod = length1) ) \n        dataframe['utmiRsi']  = ta.RSI(dataframe['utm'], timeperiod = length1)\n        dataframe['utmi'] = ta.EMA(dataframe['utmiRsi'], timeperiod = length1)\n\n        \n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n\n                 (qtpylib.crossed_above(dataframe['utmi'], 50)) &  \n                 (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n             \n                (qtpylib.crossed_below(dataframe['utmi'], 70)) &  \n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/Uptrend/Uptrend.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame, Series  # noqa\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom datetime import datetime\n\n\nclass Uptrend(IStrategy):\n    INTERFACE_VERSION = 2\n\n    buy_params = {\n        'buy_rsi_uplimit': 50,\n\n    }\n\n    buy_rsi_uplimit = IntParameter(50, 90, default=buy_params['buy_rsi_uplimit'], optimize=False, space='buy')\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.1,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    use_custom_stoploss = True\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        sl_new = 1\n\n        if (current_profit > 0.2):\n            sl_new = 0.05\n        elif (current_profit > 0.1):\n            sl_new = 0.03\n        elif (current_profit > 0.06):\n            sl_new = 0.02\n        elif (current_profit > 0.03):\n            sl_new = 0.015\n        elif (current_profit > 0.015):\n            sl_new = 0.0075\n\n        return sl_new\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['hl2'] = (dataframe['high'] + dataframe['low']) / 2\n        dataframe['mama'], dataframe['fama'] = ta.MAMA(dataframe['hl2'], 0.5, 0.05)\n\n        dataframe['mama_diff'] = dataframe['mama'] - dataframe['fama']\n        dataframe['mama_diff_ratio'] = dataframe['mama_diff'] / dataframe['hl2']\n\n        dataframe['zero'] = 0\n\n        dataframe['rsi'] = ta.RSI(dataframe['close'], timeperiod=14)\n\n        # EMA 50\n        dataframe['ema50'] = ta.EMA(dataframe['close'], timeperiod=50)\n\n        # EMA 200\n        dataframe['ema200'] = ta.EMA(dataframe['close'], timeperiod=200)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['rsi'] < 80) &\n                (dataframe['mama'] >  dataframe['fama']) & # uptrend\n                (dataframe['mama_diff_ratio'] > 0.04) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['mama_diff_ratio'] < 0.01) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n\n\nimport random\nfrom functools import reduce\n\nclass SuperBuy(Uptrend):\n    \"\"\"\n\tIdea is to build random buy signales from populate_indicators, with luck we'll get a good buy signal\n\t\"\"\"\n\n    generator = IntParameter(0, 100000000000, default=99295874569, optimize=True, space='buy')  # generate unique matrix of conditions for your dataframe\n    operators_used_to_compare_between_columns = IntParameter(0, 3, default=3, optimize=True, space='buy')  # number of conditions you will keep to build buy signal\n    operators_used_to_with_best_point = IntParameter(0, 3, default=1, optimize=True, space='buy')  # number of conditions you will keep to build buy signal\n    condition_selector = IntParameter(0, 100, default=50, optimize=True, space='buy')  # how to select the desired conditions beteween all conditions generated (seed random)\n\n    best_buy_point = None\n    best_buy_point_dict = dict()\n    bad_buy_point_dict = dict()\n    all_points_dict = dict()\n    buy_signal_already_printed = False\n\n    columns = []\n    columns_to_compare_to_best_point = []\n    columns_to_compare_to_volume = []\n    columns_to_compare_to_price = []\n\n    operators = {\n        0: '<',\n        1: '>',\n        2: '<=',\n        3: '>=',\n        4: '==',\n        5: '!='\n    }\n\n    top_index_criteria = {\n\n        # best point criteria\n        'min_close_hh_ratio': 0.08,\n        'max_candles_to_get_ratio': 8,\n        'candles_after_dip_to_buy': 0,\n\n        # parameters selection criteria\n        'select_parameter_if_in_more_than_x_percent_of_best_points': 97,\n        'select_prameter_if_prop_is_x_percent_higher_in_best_points': 10,\n    }\n\n    def find_best_entry_point(self, dataframe: DataFrame, metadata: dict):\n        lookahead_candles = self.top_index_criteria['max_candles_to_get_ratio']\n\n        workdataframe = dataframe.copy()\n        workdataframe['higher_high'] = workdataframe['high'].rolling(lookahead_candles).max()\n        workdataframe['close_shifted_lookehead'] = workdataframe['close'].shift(lookahead_candles)\n        workdataframe['higher_high_close_ratio'] = workdataframe['higher_high'] / workdataframe['close_shifted_lookehead']\n\n        df_mask = workdataframe['higher_high_close_ratio'] >= 1 + self.top_index_criteria['min_close_hh_ratio']\n        # print(1 + self.top_index_criteria['min_close_hh_ratio'])\n        filtered_df = workdataframe[df_mask]\n\n        filtered_df = filtered_df.sort_values(by=[\"higher_high_close_ratio\"], ascending=False)\n        filtered_df[\"shifted_index\"] = filtered_df.index - lookahead_candles + self.top_index_criteria['candles_after_dip_to_buy']\n\n        if filtered_df.empty:\n            if self.config['runmode'].value != 'hyperopt':\n                print(\"No entry point found for {}\".format(metadata['pair']))\n            return filtered_df, workdataframe\n        # print(metadata['pair'])\n        # print(filtered_df[[\"date\", \"shifted_index\", \"higher_high_close_ratio\", \"close_shifted_lookehead\", \"close\", \"higher_high\"]])\n        return filtered_df, workdataframe.drop(filtered_df['shifted_index'])\n\n    def common_points_for_every_best_entry(self, dataframe: DataFrame, metadata: dict, columns: list) -> list:\n        full_pairlist = self.dp.current_whitelist()\n        current_pair = metadata['pair']\n\n        if current_pair not in self.best_buy_point_dict:\n            self.best_buy_point_dict[current_pair], self.bad_buy_point_dict[current_pair] = self.find_best_entry_point(dataframe, metadata)\n            self.all_points_dict[current_pair] = dataframe.copy()\n\n        for pair in full_pairlist:\n            current_df = self.dp.get_pair_dataframe(pair=pair, timeframe=self.timeframe)\n            if (pair not in self.best_buy_point_dict) and not current_df.empty:\n                # print(\"No entry point found for {}\".format(pair))\n                return []\n\n        all_best_points = None\n        all_bad_points = None\n        all_points = None\n        for pair in full_pairlist:\n            # NO DATA FOR THIS PAIR\n            if not pair in self.best_buy_point_dict:\n                continue\n            if all_best_points is None:\n                all_best_points = self.best_buy_point_dict[pair]\n                all_bad_points = self.bad_buy_point_dict[pair]\n                all_points = self.all_points_dict[pair]\n            else:\n                all_best_points = all_best_points.append(self.best_buy_point_dict[pair])\n                all_bad_points = all_bad_points.append(self.bad_buy_point_dict[pair])\n                all_points = all_points.append(self.all_points_dict[pair])\n\n        print(\"HERE COMMON VALUES FOR ALL BEST POINTS !!!!!!!!!!\")\n        res = list()\n        best_indicators = []\n        for column in columns:\n            all_points_values_count = all_points[column].value_counts()\n            all_bad_points_values_count = all_bad_points[column].value_counts()\n            count = all_best_points[column].value_counts()\n            # keep only values in more than x% of all points\n            df_mask = count >= 1 / 100 * all_best_points.shape[0]\n            count = count[df_mask]\n\n            if not count.empty and not column in ['buy', 'buy_tag']:\n                count_normalized = count / all_best_points.shape[0]\n                all_bad_points_values_count_normalized = all_bad_points_values_count / all_bad_points.shape[0]\n                df_all = count.to_frame(name='best_points').join(all_bad_points_values_count.to_frame(name='bad_points'))\n                df_all['best_point_percent'] = count_normalized\n                df_all['bad_point_percent'] = all_bad_points_values_count_normalized\n                df_all['part_of_best_points'] = 100 * df_all['best_points'] / (df_all['best_points'] + df_all['bad_points'])\n                df_all['part_of_best_points_percent'] = count_normalized / all_bad_points_values_count_normalized\n                print(column)\n                print(df_all)\n                values = df_all.query(\n                    f\"part_of_best_points > 3 & \"  # the part of best points should be at least 3% for the value\n                    \"part_of_best_points_percent > 13 & \"  # proportion of value is X* more important in best points than in bad points\n                    \"best_points > 12\"  # minimum number of the value (because we don't want close=1.121213243482902183 as result)\n                ).index.tolist()  # & df_all[\"part_of_best_points_percent\"] > 10)]\n                print(values)\n                for elt in values:\n                    best_indicators.append(f\"dataframe['{column}'] == {elt}\")\n\n            if column in ['buy', 'buy_tag']:\n                print(column)\n                print(all_best_points[column].value_counts())\n            elif not count.empty:\n                res.append({\n                    'column': column,\n                    'value': count.index[0],\n                    'ratio_for_best': count.iloc[0] / all_best_points.shape[0],\n                    'ratio_for_all': all_points_values_count[count.index[0]] / all_points.shape[0],\n                    'ratio_diff': count.iloc[0] / all_best_points.shape[0] - all_points_values_count[count.index[0]] / all_points.shape[0]\n                })\n        for item in sorted(res, key=lambda x: x['ratio_diff']):\n            print(f\"({item['column']} == {item['value']}), {100 * item['ratio_for_best']:.2f}% in best vs {100 * item['ratio_for_all']:.2f}% average\")\n        print(\"END OF COMMON VALUES FOR ALL BEST POINTS !!!!!!!!!!\")\n\n        print(\"Suggested buy signal:\")\n        print(\"( # main buy signals found\")\n        for item in best_indicators:\n            print(f\"    ({item})|\")\n        print(\")\")\n        print(\"& ( # protections\")\n        for item in sorted(res, key=lambda x: x['ratio_diff']):\n            if (((100 * item['ratio_for_best']) - (100 * item['ratio_for_all'])) > self.top_index_criteria['select_prameter_if_prop_is_x_percent_higher_in_best_points']) and (100 * item['ratio_for_best']) > self.top_index_criteria['select_parameter_if_in_more_than_x_percent_of_best_points']:\n                print(f\"(dataframe['{item['column']}'] == {item['value']}) &\")\n        print(\")\")\n        return []\n\n    def is_same_dimension_as_price(self, dataframe: DataFrame, column_name: str) -> bool:\n        if dataframe['close'].dtype != dataframe[column_name].dtype:\n            # prevent impossible comparisons\n            return False\n        return (dataframe[column_name].max() <= dataframe['high'].max() and dataframe[column_name].min() >= dataframe['low'].min())\n\n    def is_same_dimension_as_volume(self, dataframe: DataFrame, column_name: str) -> bool:\n        if dataframe['volume'].dtype != dataframe[column_name].dtype:\n            # prevent impossible comparisons\n            return False\n        if 'volume' in column_name:\n            return True\n        return False\n\n    def generate_superbuy_signal(self, dataframe: DataFrame, metadata: dict) -> list:\n        # every indicators names\n        columns = list(dataframe.columns)\n        columns.remove('date')\n        columns.remove('sell')\n        columns.remove('buy')\n        columns.remove('buy_tag')\n        columns = [column for column in columns if not 'date' in column]\n\n        # generated random conditions\n        buy_conds = []\n\n        # operators we will use as a string \"123423232\" which will be used to sequentially pick in operators\n        generators = \"\"\n        base_generators = str(self.generator.value)\n        while len(generators) < len(columns) * len(columns):\n            generators = generators + base_generators\n\n        # get best buy point for first pair, will indicators will be used for each pair\n        # THE PAIR YOU WANT TO USE AS REFERENCE MUST BE FIRST IN YOUR PAIRLIST !!!!!!!!\n        if self.best_buy_point is None:\n            try:\n                top_index, _ = self.find_best_entry_point(dataframe, metadata)[\"shifted_index\"].iloc[0]\n                self.best_buy_point = dataframe.iloc[top_index]\n                print(f\"pair used as reference is {metadata['pair']}\")\n                print(top_index)\n            except:\n                self.best_buy_point = None\n                pass\n\n        # sort columns by category\n        if len(self.columns_to_compare_to_best_point) == 0 and len(self.columns_to_compare_to_volume) == 0 and len(self.columns_to_compare_to_price) == 0:\n            self.columns = columns\n            for column in columns:\n                if self.is_same_dimension_as_price(dataframe, column):\n                    self.columns_to_compare_to_price.append(column)\n                elif self.is_same_dimension_as_volume(dataframe, column):\n                    self.columns_to_compare_to_volume.append(column)\n                else:\n                    self.columns_to_compare_to_best_point.append(column)\n            print(f\"columns_to_compare_to_price : {self.columns_to_compare_to_price}\")\n            print(f\"columns_to_compare_to_volume : {self.columns_to_compare_to_volume}\")\n\n            # remove NAN columns for best point...\n            if self.best_buy_point is not None:\n                for column in self.columns_to_compare_to_best_point:\n                    if str(self.best_buy_point[column]) == 'nan':\n                        self.columns_to_compare_to_best_point.remove(column)\n            print(f\"columns_to_compare_to_best_point : {self.columns_to_compare_to_best_point}\")\n\n        # generate matrix of all operators for all combinations of columns and create buy conditions\n        index = 0\n        for left_elt in self.columns_to_compare_to_price:\n            for right_elt in self.columns_to_compare_to_price:\n                if index > len(generators):\n                    break\n                generator = generators[index]\n                index += 1\n                if left_elt == right_elt:\n                    continue\n                if int(generator) not in self.operators:\n                    # pass if no operator is selected\n                    continue\n                # print(\"(dataframe['\" + left_elt + \"'] \" + self.operators[int(generator)] + \" dataframe['\" + right_elt + \"'])\")\n                buy_conds.append(\n                    \"(dataframe['\" + left_elt + \"'] \" + self.operators[int(generator)] + \" dataframe['\" + right_elt + \"'])\"\n                )\n\n        for left_elt in self.columns_to_compare_to_volume:\n            for right_elt in self.columns_to_compare_to_volume:\n                if index > len(generators):\n                    break\n                generator = generators[index]\n                index += 1\n                if left_elt == right_elt:\n                    continue\n                if int(generator) not in self.operators:\n                    # pass if no operator is selected\n                    continue\n                # print(\"(dataframe['\" + left_elt + \"'] \" + self.operators[int(generator)] + \" dataframe['\" + right_elt + \"'])\")\n                buy_conds.append(\n                    \"(dataframe['\" + left_elt + \"'] \" + self.operators[int(generator)] + \" dataframe['\" + right_elt + \"'])\"\n                )\n\n        buy_conds_best_point = []\n        # generate buy conditions with best buy point\n        for column in self.columns_to_compare_to_best_point:\n            if self.best_buy_point is None:\n                continue\n            if index > len(generators):\n                break\n            generator = generators[index]\n            index += 1\n            if int(generator) not in self.operators:\n                # pass if no operator is selected\n                continue\n            # print(\"(dataframe['\" + column + \"'] \" + self.operators[int(generator)] + \" best_buy_point['\" + column + \"']))\")\n            # print(eval(\"best_buy_point['\" + column + \"']\"))\n            buy_conds_best_point.append(\n                \"(dataframe['\" + column + \"'] \" + self.operators[int(generator)] + \" \" + str(self.best_buy_point[column]) + \")\"\n            )\n\n        # select a few buy conditions\n        random.seed(self.condition_selector.value)\n        try:\n            buy_conds = random.sample(buy_conds, self.operators_used_to_compare_between_columns.value)\n        except ValueError:\n            print(\"not enough conditions to compare between columns\")\n            # Sample larger than population or is negative\n            pass\n        try:\n            buy_conds += random.sample(buy_conds_best_point, self.operators_used_to_with_best_point.value)\n        except ValueError as e:\n            if self.config['runmode'].value != 'hyperopt':\n                print(\"not enough conditions to compare with best point\")\n            # Sample larger than population or is negative\n            pass\n        if self.config['runmode'].value in ('backtest', 'hyperopt') and self.buy_signal_already_printed != buy_conds:\n            print(buy_conds)\n            self.buy_signal_already_printed = buy_conds\n        try:\n            buy_conds = [eval(buy_cond, globals(), {'dataframe': dataframe, 'best_buy_point': self.best_buy_point}) for buy_cond in buy_conds]\n        except:\n            return []\n        return buy_conds\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        buy_conds = self.generate_superbuy_signal(dataframe, metadata)\n\n        if self.config['runmode'].value in ('backtest'):  # backtest, we want to check must common buy tags...\n            dataframe = super().populate_buy_trend(dataframe, metadata)  # get buy tags\n            self.common_points_for_every_best_entry(dataframe, metadata, self.columns + ['buy', 'buy_tag'])\n        elif self.config['runmode'].value in ('hyperopt'):  # hyperopt, we want to test new buy signals\n            is_additional_check = (\n                    (  # main buy signals found\n                        (dataframe['not_res1_1h'] == True)\n                    )\n                    & (  # protections\n                            (dataframe['rsi_fast_lower_20'] == 0) &\n                            (dataframe['rsi_fast_lower_30'] == 0) &\n                            (dataframe['r_14_lower_minus_80'] == 0) &\n                            (dataframe['r_32_lower_minus_80'] == 0) &\n                            (dataframe['r_96_lower_minus_80'] == 0)\n                    ) &\n                    (\n                        # (dataframe['ema_50_lin'] < dataframe['ema_26_lin']) |\n                        # (dataframe['sma_15'] > dataframe['ema_50_1h']) |\n                        # (dataframe['ema_slow'] <= dataframe['sup1']) |\n                        (dataframe['res1'] >= dataframe['bb_upperband2_1h'])\n                    )\n            )\n\n            if buy_conds:\n                dataframe.loc[\n                    is_additional_check\n                    &\n                    reduce(lambda x, y: x & y, buy_conds)\n\n                    , 'buy'] = 1\n        # THIS STRAT SHOULD NOT BE USED IN LIVE/DRYRUN MODE\n        return dataframe\n"
  },
  {
    "path": "strategies/UziChan/UziChan.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport logging\nimport pandas_ta as pta\n\nfrom pandas import DataFrame, Series\nfrom datetime import datetime, timezone\nfrom freqtrade.persistence import Trade\n\n\nlogger = logging.getLogger(__name__)\n\n\n\nclass UziChan(IStrategy):\n\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    stoploss = -0.10\n    timeframe = '5m'\n\n    # def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):     \n    #     dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)        \n    #     if current_profit*100 > 1: \n    #         return 'sell_1.2pc'\n    #     return None\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n       \n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\n        dataframe['perc_norm'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\n\n        # Uzirox's channel prezzo\n        periodo = 15\n        dataframe['uc_mid']  = pta.ssf(dataframe['close'],5)\n        dataframe['uc_stdv'] = ta.STDDEV(dataframe['uc_mid'], periodo).round(5)\n        dataframe['uc_low']  = ta.EMA(dataframe['uc_mid'] - dataframe['uc_stdv'],3).round(5)\n        dataframe['uc_up']   = ta.EMA(dataframe['uc_mid'] + dataframe['uc_stdv'],3).round(5)            \n\n        dataframe['co']      = ta.ADOSC(dataframe,fastperiod = 30, slowperiod = 100).round(3)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                ((dataframe['close'] < dataframe['uc_low']) | (dataframe['open'] < dataframe['uc_low'])) &\n                (dataframe['co'] > dataframe['co'].shift())\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['high'] > dataframe['uc_up']) &\n                (dataframe['co'] > dataframe['co'].shift())\n            ),\n            'sell'] = 1\n        return dataframe\n     \n\nclass UziChanTB(UziChan):\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n    custom_info_trail_sell = dict()    \n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_sell_order_enabled = True    \n    #trailing_expire_seconds = 1800      #NOTE 5m timeframe\n    trailing_expire_seconds = 1800/5    #NOTE 1m timeframe\n    #trailing_expire_seconds = 1800*3    #NOTE 15m timeframe\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = True\n    trailing_sell_uptrend_enabled = True    \n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    trailing_sell_max_stop = 0.02   # stop trailing sell if current_price < starting_price * (1+trailing_buy_max_stop)\n    trailing_sell_max_sell = 0.000  # sell if price between downlimit (=max of serie (current_price * (1 + trailing_sell_offset())) and (start_price * 1+trailing_sell_max_sell))\n\n    abort_trailing_when_sell_signal_triggered = True\n\n\n    init_trailing_buy_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,  \n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    init_trailing_sell_dict = {\n        'trailing_sell_order_started': False,\n        'trailing_sell_order_downlimit': 0,        \n        'start_trailing_sell_price': 0,\n        'sell_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_sell_trailing': False,\n    }    \n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_buy_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_sell(self, pair, reinit=False):\n        # returns trailing sell info for pair (init if necessary)\n        if not pair in self.custom_info_trail_sell:\n            self.custom_info_trail_sell[pair] = dict()\n        if (reinit or not 'trailing_sell' in self.custom_info_trail_sell[pair]):\n            self.custom_info_trail_sell[pair]['trailing_sell'] = self.init_trailing_sell_dict.copy()\n        return self.custom_info_trail_sell[pair]['trailing_sell']\n\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_buy_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n\n\n    def trailing_sell_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_sell = self.trailing_sell(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_sell['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\"'\\033[36m'SELL: \"\n                f\"pair: {pair} : \"\n                f\"start: {trailing_sell['start_trailing_sell_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"downlimit: {trailing_sell['trailing_sell_order_downlimit']:.4f}, \"\n                f\"profit: {self.current_trailing_sell_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_sell['offset']}\")\n\n    def current_trailing_buy_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def current_trailing_sell_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_sell = self.trailing_sell(pair)\n        if trailing_sell['trailing_sell_order_started']:\n            return (current_price - trailing_sell['start_trailing_sell_price'])/ trailing_sell['start_trailing_sell_price']\n            #return 0-((trailing_sell['start_trailing_sell_price'] - current_price) / trailing_sell['start_trailing_sell_price'])\n        else:\n            return 0\n\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_buy_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.0045 * (1 + adapt)        #NOTE: default_offset 0.0045 <--> 0.009\n        \n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    def trailing_sell_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_sell_profit_ratio = self.current_trailing_sell_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\n        \n        trailing_sell  = self.trailing_sell(pair)\n        if not trailing_sell['trailing_sell_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_sell['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_sell_profit_ratio > 0) and (last_candle['sell'] == 1)):\n                # more than 1h, price over first signal, sell signal still active -> sell\n                return 'forcesell'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_sell_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_sell_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is falling, sell \n            return 'forcesell'\n\n        if current_trailing_sell_profit_ratio > 0:\n            # current price is lower than initial price\n            return default_offset\n\n        trailing_sell_offset = {\n            # 0.06: 0.02,\n            # 0.03: 0.01,\n            0.1: default_offset,\n        }\n\n        for key in trailing_sell_offset:\n            if current_trailing_sell_profit_ratio < key:\n                return trailing_sell_offset[key]\n\n        return default_offset\n\n    # end of trailing sell parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])   \n        self.trailing_sell(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n            val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n            \n            if val:\n                if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                    val = False\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    if(len(dataframe) >= 1):\n                        last_candle = dataframe.iloc[-1].squeeze()\n                        current_price = rate\n                        trailing_buy = self.trailing_buy(pair)\n                        trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                        if trailing_buy['allow_trailing']:\n                            if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                                # start trailing buy\n                                \n                                trailing_buy['trailing_buy_order_started'] = True\n                                trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                                trailing_buy['start_trailing_price'] = last_candle['close']\n                                trailing_buy['buy_tag'] = last_candle['buy_tag']\n                                trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                                trailing_buy['offset'] = 0\n                                \n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                            elif trailing_buy['trailing_buy_order_started']:\n                                if trailing_buy_offset == 'forcebuy':\n                                    # buy in custom conditions\n                                    val = True\n                                    ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                                elif trailing_buy_offset is None:\n                                    # stop trailing buy custom conditions\n                                    self.trailing_buy(pair, reinit=True)\n                                    logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                                elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                    # update uplimit\n                                    old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                                elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                    # buy ! current price > uplimit && lower thant starting price\n                                    val = True\n                                    ratio = \"%.2f\" % ((self.current_trailing_profit_ratio(pair, current_price)) * 100)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                                elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                    # stop trailing buy because price is too high\n                                    self.trailing_buy(pair, reinit=True)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                                else:\n                                    # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'price too high for {pair} !')\n\n                        else:\n                            logger.info(f\"Wait for next buy signal for {pair}\")\n\n                    if (val == True):\n                        self.trailing_buy_info(pair, rate)\n                        self.trailing_buy(pair, reinit=True)\n                        logger.info(f'STOP trailing buy for {pair} because I buy it')\n            \n            return val\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super().confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)        \n        \n        if val:\n            if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_sell= self.trailing_sell(pair)\n                    trailing_sell_offset = self.trailing_sell_offset(dataframe, pair, current_price)\n\n                    if trailing_sell['allow_sell_trailing']:\n                        if (not trailing_sell['trailing_sell_order_started'] and (last_candle['sell'] == 1)):\n                            trailing_sell['trailing_sell_order_started'] = True\n                            trailing_sell['trailing_sell_order_downlimit'] = last_candle['close']\n                            trailing_sell['start_trailing_sell_price'] = trade.open_rate\n                            trailing_sell['sell_tag'] = last_candle['sell_tag']\n                            trailing_sell['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_sell['offset'] = 0\n                            \n                            self.trailing_sell_info(pair, current_price)\n                            logger.info(f'start trailing sell for {pair} at {trade.open_rate}')\n\n                        elif trailing_sell['trailing_sell_order_started']:\n                            if trailing_sell_offset == 'forcesell':\n                                # sell in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f\"price OK for {pair} ({ratio} %, {current_price})\")\n\n                            elif trailing_sell_offset is None:\n                                # stop trailing sell custom conditions\n                                self.trailing_sell(pair, reinit=True)\n                                logger.info(f'STOP trailing sell for {pair} because \"trailing sell offset\" returned None')\n\n                            elif current_price > trailing_sell['trailing_sell_order_downlimit']:\n                                # update downlimit\n                                old_downlimit = trailing_sell[\"trailing_sell_order_downlimit\"]\n                                self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'] = max(current_price * (1 - trailing_sell_offset), self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'])\n                                self.custom_info_trail_sell[pair]['trailing_sell']['offset'] = trailing_sell_offset\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'update trailing sell for {pair} at {old_downlimit} -> {self.custom_info_trail_sell[pair][\"trailing_sell\"][\"trailing_sell_order_downlimit\"]}')\n\n                            elif current_price > (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_sell)):\n                                # sell! current price < downlimit && higher than starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) < downlimit ({trailing_sell['trailing_sell_order_downlimit']}) but higher than starting price ({(trailing_sell['start_trailing_sell_price'] * (1 + self.trailing_sell_max_sell))}). OK for {pair} ({ratio} %)\")\n\n                            elif current_price < (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_stop)):\n                                # stop trailing, sell fast, price too low\n                                val = True                                \n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'STOP trailing sell for {pair} because of the price is much lower than starting price * {1 + self.trailing_sell_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'price too low for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next sell signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_sell_info(pair, rate)\n                    self.trailing_sell(pair, reinit=True)\n                    logger.info(f'STOP trailing sell for {pair} because I SOLD it')\n\n        if sell_reason != 'sell_signal':\n            val = True\n\n        return val\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"                        \n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_sell_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.abort_trailing_when_sell_signal_triggered and self.config['runmode'].value in ('live', 'dry_run'):\n            last_candle = dataframe.iloc[-1].squeeze()\n            if (last_candle['sell'] == 1):\n                trailing_buy = self.trailing_buy(metadata['pair'])\n                if trailing_buy['trailing_buy_order_started']:\n                    logger.info(f\"Sell signal for {metadata['pair']} is triggered!!! Abort trailing\")\n                    self.trailing_buy(metadata['pair'], reinit=True)        \n\n        if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_sell = self.trailing_sell(metadata['pair'])\n            if (last_candle['sell'] != 0):\n                if not trailing_sell['trailing_sell_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    #if not open_trades: \n                    if open_trades:\n                        logger.info(f\"Set 'allow_SELL_trailing' to True for {metadata['pair']} to start *SELL* trailing\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_sell['allow_sell_trailing'] = True\n                        initial_sell_tag = last_candle['sell_tag'] if 'sell_tag' in last_candle else 'sell signal'\n                        dataframe.loc[:, 'sell_tag'] = f\"{initial_sell_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_sell['trailing_sell_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger sell signal!\")\n                    dataframe.loc[:,'sell'] = 1\n                    dataframe.loc[:, 'sell_tag'] = trailing_sell['sell_tag']\n\n        return dataframe\n\n\n    plot_config = {\n      'main_plot':{\n            'uc_up':{'color':'gray'},\n            'uc_mid':{'color':'green'},\n            'uc_low' :{'color':'gray'},        \n            },\n      'subplots': {                 \n      }  \n    }     "
  },
  {
    "path": "strategies/UziChan2/UziChan2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport logging\nimport pandas_ta as pta\n\nfrom pandas import DataFrame, Series\nfrom datetime import datetime, timezone\nfrom freqtrade.persistence import Trade\n\n\nlogger = logging.getLogger(__name__)\n\n\n\nclass UziChan2(IStrategy):\n\n    minimal_roi = {\n        \"0\": 0.1\n    }\n\n    stoploss = -0.10\n    timeframe = '1m'\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):     \n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)        \n        if current_profit*100 > 1: \n            logger.info(f'custom sell for {pair} at {current_rate}')\n            return 'sell_1.2pc'\n        return None\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n       \n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\n        dataframe['perc_norm'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\n\n        # Uzirox's channel prezzo\n        periodo = 15\n        dataframe['uc_mid']  = pta.ssf(dataframe['close'],5)\n        dataframe['uc_stdv'] = ta.STDDEV(dataframe['uc_mid'], periodo).round(5)\n        dataframe['uc_low']  = ta.EMA(dataframe['uc_mid'] - dataframe['uc_stdv'],3).round(5)\n        dataframe['uc_up']   = ta.EMA(dataframe['uc_mid'] + dataframe['uc_stdv'],3).round(5)            \n\n        dataframe['co']      = ta.ADOSC(dataframe,fastperiod = 30, slowperiod = 100).round(3)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                ((dataframe['close'] < dataframe['uc_low']) | (dataframe['open'] < dataframe['uc_low'])) &\n                (dataframe['co'] > dataframe['co'].shift())\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['high'] > dataframe['uc_up']) &\n                (dataframe['co'] > dataframe['co'].shift())\n            ),\n            'sell'] = 1\n        return dataframe\n     \n\nclass UziChanTB2(UziChan2):\n\n    process_only_new_candles = True\n\n    custom_info_trail_buy = dict()\n    custom_info_trail_sell = dict()    \n\n    # Trailing buy parameters\n    trailing_buy_order_enabled = True\n    trailing_sell_order_enabled = True    \n    #trailing_expire_seconds = 1800      #NOTE 5m timeframe\n    trailing_expire_seconds = 1800/5    #NOTE 1m timeframe\n    #trailing_expire_seconds = 1800*3    #NOTE 15m timeframe\n\n    # If the current candle goes above min_uptrend_trailing_profit % before trailing_expire_seconds_uptrend seconds, buy the coin\n    trailing_buy_uptrend_enabled = True\n    trailing_sell_uptrend_enabled = True    \n    trailing_expire_seconds_uptrend = 90\n    min_uptrend_trailing_profit = 0.02\n\n    debug_mode = True\n    trailing_buy_max_stop = 0.02  # stop trailing buy if current_price > starting_price * (1+trailing_buy_max_stop)\n    trailing_buy_max_buy = 0.000  # buy if price between uplimit (=min of serie (current_price * (1 + trailing_buy_offset())) and (start_price * 1+trailing_buy_max_buy))\n\n    trailing_sell_max_stop = 0.02   # stop trailing sell if current_price < starting_price * (1+trailing_buy_max_stop)\n    trailing_sell_max_sell = 0.000  # sell if price between downlimit (=max of serie (current_price * (1 + trailing_sell_offset())) and (start_price * 1+trailing_sell_max_sell))\n\n    abort_trailing_when_sell_signal_triggered = True\n\n\n    init_trailing_buy_dict = {\n        'trailing_buy_order_started': False,\n        'trailing_buy_order_uplimit': 0,  \n        'start_trailing_price': 0,\n        'buy_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_trailing': False,\n    }\n\n    init_trailing_sell_dict = {\n        'trailing_sell_order_started': False,\n        'trailing_sell_order_downlimit': 0,        \n        'start_trailing_sell_price': 0,\n        'sell_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_sell_trailing': False,\n    }    \n\n    def trailing_buy(self, pair, reinit=False):\n        # returns trailing buy info for pair (init if necessary)\n        if not pair in self.custom_info_trail_buy:\n            self.custom_info_trail_buy[pair] = dict()\n        if (reinit or not 'trailing_buy' in self.custom_info_trail_buy[pair]):\n            self.custom_info_trail_buy[pair]['trailing_buy'] = self.init_trailing_buy_dict.copy()\n        return self.custom_info_trail_buy[pair]['trailing_buy']\n\n    def trailing_sell(self, pair, reinit=False):\n        # returns trailing sell info for pair (init if necessary)\n        if not pair in self.custom_info_trail_sell:\n            self.custom_info_trail_sell[pair] = dict()\n        if (reinit or not 'trailing_sell' in self.custom_info_trail_sell[pair]):\n            self.custom_info_trail_sell[pair]['trailing_sell'] = self.init_trailing_sell_dict.copy()\n        return self.custom_info_trail_sell[pair]['trailing_sell']\n\n\n    def trailing_buy_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_buy = self.trailing_buy(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_buy['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\n                f\"pair: {pair} : \"\n                f\"start: {trailing_buy['start_trailing_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"uplimit: {trailing_buy['trailing_buy_order_uplimit']:.4f}, \"\n                f\"profit: {self.current_trailing_buy_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_buy['offset']}\")\n\n\n\n    def trailing_sell_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_sell = self.trailing_sell(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_sell['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            logger.info(\"'\\033[36m'SELL: \"\n                f\"pair: {pair} : \"\n                f\"start: {trailing_sell['start_trailing_sell_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"downlimit: {trailing_sell['trailing_sell_order_downlimit']:.4f}, \"\n                f\"profit: {self.current_trailing_sell_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_sell['offset']}\")\n\n    def current_trailing_buy_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_buy = self.trailing_buy(pair)\n        if trailing_buy['trailing_buy_order_started']:\n            return (trailing_buy['start_trailing_price'] - current_price) / trailing_buy['start_trailing_price']\n        else:\n            return 0\n\n    def current_trailing_sell_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_sell = self.trailing_sell(pair)\n        if trailing_sell['trailing_sell_order_started']:\n            return (current_price - trailing_sell['start_trailing_sell_price'])/ trailing_sell['start_trailing_sell_price']\n            #return 0-((trailing_sell['start_trailing_sell_price'] - current_price) / trailing_sell['start_trailing_sell_price'])\n        else:\n            return 0\n\n\n    def trailing_buy_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_profit_ratio = self.current_trailing_buy_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.0045 * (1 + adapt)        #NOTE: default_offset 0.0045 <--> 0.009\n        \n\n        trailing_buy = self.trailing_buy(pair)\n        if not trailing_buy['trailing_buy_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration = current_time - trailing_buy['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_profit_ratio > 0) and (last_candle['buy'] == 1)):\n                # more than 1h, price under first signal, buy signal still active -> buy\n                return 'forcebuy'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_buy_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is rising, buy\n            return 'forcebuy'\n\n        if current_trailing_profit_ratio < 0:\n            # current price is higher than initial price\n            return default_offset\n\n        trailing_buy_offset = {\n            0.06: 0.02,\n            0.03: 0.01,\n            0: default_offset,\n        }\n\n        for key in trailing_buy_offset:\n            if current_trailing_profit_ratio > key:\n                return trailing_buy_offset[key]\n\n        return default_offset\n\n    def trailing_sell_offset(self, dataframe, pair: str, current_price: float):\n        # return rebound limit before a buy in % of initial price, function of current price\n        # return None to stop trailing buy (will start again at next buy signal)\n        # return 'forcebuy' to force immediate buy\n        # (example with 0.5%. initial price : 100 (uplimit is 100.5), 2nd price : 99 (no buy, uplimit updated to 99.5), 3price 98 (no buy uplimit updated to 98.5), 4th price 99 -> BUY\n        current_trailing_sell_profit_ratio = self.current_trailing_sell_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\n        \n        trailing_sell  = self.trailing_sell(pair)\n        if not trailing_sell['trailing_sell_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration =  current_time - trailing_sell['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_sell_profit_ratio > 0) and (last_candle['sell'] != 0)):\n                # more than 1h, price over first signal, sell signal still active -> sell\n                return 'forcesell'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_sell_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_sell_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is falling, sell \n            return 'forcesell'\n\n        if current_trailing_sell_profit_ratio > 0:\n            # current price is lower than initial price\n            return default_offset\n\n        trailing_sell_offset = {\n            # 0.06: 0.02,\n            # 0.03: 0.01,\n            0.1: default_offset,\n        }\n\n        for key in trailing_sell_offset:\n            if current_trailing_sell_profit_ratio < key:\n                return trailing_sell_offset[key]\n\n        return default_offset\n\n    # end of trailing sell parameters\n    # -----------------------------------------------------\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_indicators(dataframe, metadata)\n        self.trailing_buy(metadata['pair'])   \n        self.trailing_sell(metadata['pair'])\n        return dataframe\n\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n            val = super().confirm_trade_entry(pair, order_type, amount, rate, time_in_force, **kwargs)\n            \n            if val:\n                if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                    val = False\n                    dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                    if(len(dataframe) >= 1):\n                        last_candle = dataframe.iloc[-1].squeeze()\n                        current_price = rate\n                        trailing_buy = self.trailing_buy(pair)\n                        trailing_buy_offset = self.trailing_buy_offset(dataframe, pair, current_price)\n\n                        if trailing_buy['allow_trailing']:\n                            if (not trailing_buy['trailing_buy_order_started'] and (last_candle['buy'] == 1)):\n                                # start trailing buy\n                                \n                                trailing_buy['trailing_buy_order_started'] = True\n                                trailing_buy['trailing_buy_order_uplimit'] = last_candle['close']\n                                trailing_buy['start_trailing_price'] = last_candle['close']\n                                trailing_buy['buy_tag'] = last_candle['buy_tag']\n                                trailing_buy['start_trailing_time'] = datetime.now(timezone.utc)\n                                trailing_buy['offset'] = 0\n                                \n                                self.trailing_buy_info(pair, current_price)\n                                logger.info(f'start trailing buy for {pair} at {last_candle[\"close\"]}')\n\n                            elif trailing_buy['trailing_buy_order_started']:\n                                if trailing_buy_offset == 'forcebuy':\n                                    # buy in custom conditions\n                                    val = True\n                                    ratio = \"%.2f\" % ((self.current_trailing_buy_profit_ratio(pair, current_price)) * 100)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f\"price OK for {pair} ({ratio} %, {current_price}), order may not be triggered if all slots are full\")\n\n                                elif trailing_buy_offset is None:\n                                    # stop trailing buy custom conditions\n                                    self.trailing_buy(pair, reinit=True)\n                                    logger.info(f'STOP trailing buy for {pair} because \"trailing buy offset\" returned None')\n\n                                elif current_price < trailing_buy['trailing_buy_order_uplimit']:\n                                    # update uplimit\n                                    old_uplimit = trailing_buy[\"trailing_buy_order_uplimit\"]\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'] = min(current_price * (1 + trailing_buy_offset), self.custom_info_trail_buy[pair]['trailing_buy']['trailing_buy_order_uplimit'])\n                                    self.custom_info_trail_buy[pair]['trailing_buy']['offset'] = trailing_buy_offset\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'update trailing buy for {pair} at {old_uplimit} -> {self.custom_info_trail_buy[pair][\"trailing_buy\"][\"trailing_buy_order_uplimit\"]}')\n                                elif current_price < (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy)):\n                                    # buy ! current price > uplimit && lower thant starting price\n                                    val = True\n                                    ratio = \"%.2f\" % ((self.current_trailing_buy_profit_ratio(pair, current_price)) * 100)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f\"current price ({current_price}) > uplimit ({trailing_buy['trailing_buy_order_uplimit']}) and lower than starting price price ({(trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_buy))}). OK for {pair} ({ratio} %), order may not be triggered if all slots are full\")\n\n                                elif current_price > (trailing_buy['start_trailing_price'] * (1 + self.trailing_buy_max_stop)):\n                                    # stop trailing buy because price is too high\n                                    self.trailing_buy(pair, reinit=True)\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'STOP trailing buy for {pair} because of the price is higher than starting price * {1 + self.trailing_buy_max_stop}')\n                                else:\n                                    # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                    self.trailing_buy_info(pair, current_price)\n                                    logger.info(f'price too high for {pair} !')\n\n                        else:\n                            logger.info(f\"Wait for next buy signal for {pair}\")\n\n                    if (val == True):\n                        self.trailing_buy_info(pair, rate)\n                        self.trailing_buy(pair, reinit=True)\n                        logger.info(f'STOP trailing buy for {pair} because I buy it')\n            \n            return val\n\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super().confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)        \n        \n        if val:\n            if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_sell= self.trailing_sell(pair)\n                    trailing_sell_offset = self.trailing_sell_offset(dataframe, pair, current_price)\n\n                    if trailing_sell['allow_sell_trailing']:\n                        if (not trailing_sell['trailing_sell_order_started'] and (last_candle['sell'] != 0)):\n                            trailing_sell['trailing_sell_order_started'] = True\n                            trailing_sell['trailing_sell_order_downlimit'] = last_candle['close']\n                            trailing_sell['start_trailing_sell_price'] = last_candle['close']\n                            trailing_sell['sell_tag'] = last_candle['sell_tag']\n                            trailing_sell['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_sell['offset'] = 0\n                            \n                            self.trailing_sell_info(pair, current_price)\n                            logger.info(f'start trailing sell for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_sell['trailing_sell_order_started']:\n                            if trailing_sell_offset == 'forcesell':\n                                # sell in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f\"FORCESELL for {pair} ({ratio} %, {current_price})\")\n\n                            elif trailing_sell_offset is None:\n                                # stop trailing sell custom conditions\n                                self.trailing_sell(pair, reinit=True)\n                                logger.info(f'STOP trailing sell for {pair} because \"trailing sell offset\" returned None')\n\n                            elif current_price > trailing_sell['trailing_sell_order_downlimit']:\n                                # update downlimit\n                                old_downlimit = trailing_sell[\"trailing_sell_order_downlimit\"]\n                                self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'] = max(current_price * (1 - trailing_sell_offset), self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'])\n                                self.custom_info_trail_sell[pair]['trailing_sell']['offset'] = trailing_sell_offset\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'update trailing sell for {pair} at {old_downlimit} -> {self.custom_info_trail_sell[pair][\"trailing_sell\"][\"trailing_sell_order_downlimit\"]}')\n\n                            elif current_price > (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_sell)):\n                                # sell! current price < downlimit && higher than starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f\"current price ({current_price}) < downlimit ({trailing_sell['trailing_sell_order_downlimit']}) but higher than starting price ({(trailing_sell['start_trailing_sell_price'] * (1 + self.trailing_sell_max_sell))}). OK for {pair} ({ratio} %)\")\n\n                            elif current_price < (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_stop)):\n                                # stop trailing, sell fast, price too low\n                                val = True                                \n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'STOP trailing sell for {pair} because of the price is much lower than starting price * {1 + self.trailing_sell_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_sell_info(pair, current_price)\n                                logger.info(f'price too low for {pair} !')\n\n                    else:\n                        logger.info(f\"Wait for next sell signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_sell_info(pair, rate)\n                    self.trailing_sell(pair, reinit=True)\n                    logger.info(f'STOP trailing sell for {pair} because I SOLD it')\n\n        if sell_reason != 'sell_signal':\n            val = True\n\n        return val\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_buy_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_buy = self.trailing_buy(metadata['pair'])\n            if (last_candle['buy'] == 1):\n                if not trailing_buy['trailing_buy_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if not open_trades:\n                        logger.info(f\"Set 'allow_trailing' to True for {metadata['pair']} to start trailing!!!\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_buy['allow_trailing'] = True\n                        initial_buy_tag = last_candle['buy_tag'] if 'buy_tag' in last_candle else 'buy signal'\n                        dataframe.loc[:, 'buy_tag'] = f\"{initial_buy_tag} (start trail price {last_candle['close']})\"                        \n            else:\n                if (trailing_buy['trailing_buy_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger buy signal!!\")\n                    dataframe.loc[:,'buy'] = 1\n                    dataframe.loc[:, 'buy_tag'] = trailing_buy['buy_tag']\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe = super().populate_sell_trend(dataframe, metadata)\n\n        if self.trailing_buy_order_enabled and self.abort_trailing_when_sell_signal_triggered and self.config['runmode'].value in ('live', 'dry_run'):\n            last_candle = dataframe.iloc[-1].squeeze()\n            if (last_candle['sell'] != 0):\n                trailing_buy = self.trailing_buy(metadata['pair'])\n                if trailing_buy['trailing_buy_order_started']:\n                    logger.info(f\"Sell signal for {metadata['pair']} is triggered!!! Abort trailing\")\n                    self.trailing_buy(metadata['pair'], reinit=True)        \n\n        if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_sell = self.trailing_sell(metadata['pair'])\n            if (last_candle['sell'] != 0):\n                if not trailing_sell['trailing_sell_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    #if not open_trades: \n                    if open_trades:\n                        logger.info(f\"Set 'allow_SELL_trailing' to True for {metadata['pair']} to start *SELL* trailing\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_sell['allow_sell_trailing'] = True\n                        initial_sell_tag = last_candle['sell_tag'] if 'sell_tag' in last_candle else 'sell signal'\n                        dataframe.loc[:, 'sell_tag'] = f\"{initial_sell_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_sell['trailing_sell_order_started'] == True):\n                    logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger sell signal!\")\n                    dataframe.loc[:,'sell'] = 1\n                    dataframe.loc[:, 'sell_tag'] = trailing_sell['sell_tag']\n\n        return dataframe\n\n\n    plot_config = {\n      'main_plot':{\n            'uc_up':{'color':'gray'},\n            'uc_mid':{'color':'green'},\n            'uc_low' :{'color':'gray'},        \n            },\n      'subplots': {                 \n      }  \n    }     "
  },
  {
    "path": "strategies/VWAP/VWAP.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas_ta as pta\nimport talib.abstract as ta\n# --------------------------------\n\n# VWAP bands\ndef VWAPB(dataframe, window_size=20, num_of_std=1):\n    df = dataframe.copy()\n    df['vwap'] = qtpylib.rolling_vwap(df,window=window_size)\n    rolling_std = df['vwap'].rolling(window=window_size).std()\n    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)\n    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)\n    return df['vwap_low'], df['vwap'], df['vwap_high']\n\ndef top_percent_change(dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\nclass VWAP(IStrategy):\n    \"\"\"\n\n    author: @jilv220\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.02\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.15\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        vwap_low, vwap, vwap_high = VWAPB(dataframe, 20, 1)\n        dataframe['vwap_low'] = vwap_low\n        dataframe['tcp_percent_4'] = top_percent_change(dataframe , 4)\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['close'] < dataframe['vwap_low']) &\n                (dataframe['tcp_percent_4'] > 0.04) &\n                (dataframe['cti'] < -0.8) &\n                (dataframe['rsi'] < 35) &\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/WaveTrendStra/WaveTrendStra.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass WaveTrendStra(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    just a skeleton\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 100   #disable roi\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.25\n\n    # Optimal timeframe for the strategy\n    timeframe = '4h'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        ap = (dataframe[\"high\"] + dataframe[\"low\"] + dataframe[\"close\"]) / 3\n\n        esa = ta.EMA(ap, 10)\n        d = ta.EMA(abs(ap - esa), 10)\n        ci = (ap - esa) / (0.015 * d)\n        tci = ta.EMA(ci, 21)\n\n        dataframe[\"wt1\"] = tci\n        dataframe[\"wt2\"] = ta.SMA(dataframe[\"wt1\"], 4)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (qtpylib.crossed_above(dataframe[\"wt1\"], dataframe[\"wt2\"]))\n            ,'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (qtpylib.crossed_below(dataframe['wt1'], dataframe['wt2']))\n            ,'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/XebTradeStrat/XebTradeStrat.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\nimport numpy as np\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n\n    return rolling_mean, lower_band\n\n\nclass XebTradeStrat(IStrategy):\n    minimal_roi = {\n      \"4\": 0.002,\n      \"2\": 0.005,\n      \"0\": 0.01\n    }\n\n    stoploss = -0.01\n    timeframe = '1m'\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive_offset = 0.001  # Trigger positive stoploss once crosses above this percentage\n    trailing_stop_positive = 0.0005 # Sell asset if it dips down this much\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['ema5'] > dataframe['ema10']) &\n                (dataframe['ema5'] .shift(1) < dataframe['ema10'].shift(1)) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        no sell signal\n        \"\"\"\n        dataframe.loc[:, 'sell'] = 0\n        return dataframe"
  },
  {
    "path": "strategies/XtraThicc/XtraThicc.py",
    "content": "# -*- coding: utf-8 -*-\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IStrategy, merge_informative_pair\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nimport numpy as np\n# --------------------------------\n\n\"\"\"\n\nXtraThicc v69\n\"\"\"\n\nclass XtraThicc(IStrategy):\n\n    minimal_roi = {\n         \"0\": 100\n    }\n\n    # Stoploss:\n    stoploss = -0.10\n\n    timeframe = '5m'\n    inf_timeframe = '1h'\n\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    trailing_stop = False\n    trailing_stop_positive = 0.002\n    trailing_stop_positive_offset = 0.02\n    trailing_only_offset_is_reached = True\n\n    startup_candle_count: int = 72\n    process_only_new_candles = False\n\n    def informative_pairs(self):\n        # add all whitelisted pairs on informative timeframe\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.inf_timeframe) for pair in pairs]\n        \n        return informative_pairs\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Base Thiccness\n        dataframe['color'] = np.where(dataframe['close'] > dataframe['open'], 'green', 'red')\n\n        dataframe['how-thicc'] = (dataframe['close'] - dataframe['open']).abs()\n        dataframe['avg-thicc'] = dataframe['how-thicc'].abs().rolling(36).mean()\n        dataframe['not-thicc'] = dataframe['how-thicc'] < (dataframe['avg-thicc'])\n        dataframe['rly-thicc'] = dataframe['how-thicc'] > (dataframe['avg-thicc'])\n        dataframe['xtra-thicc'] = np.where(dataframe['rly-thicc'].rolling(8).sum() >= 5,1,0)\n\n        dataframe['roc'] = ta.ROC(dataframe, timeperiod=6)\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_timeframe)\n        informative['3d-low'] = informative['close'].rolling(72).min()\n        informative['3d-high'] = informative['close'].rolling(72).max()\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.inf_timeframe, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['color'] == 'green') &\n                (dataframe['color'].shift(1) == 'green') &\n                (dataframe['color'].shift(2) == 'red') &\n                (dataframe['color'].shift(3) == 'red') &\n                (dataframe['xtra-thicc'] == 1) &\n                (dataframe['rly-thicc'] == 0) &\n                (dataframe['close'] > dataframe[f\"3d-low_{self.inf_timeframe}\"]) &\n                (dataframe['close'] < dataframe[f\"3d-high_{self.inf_timeframe}\"])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        dataframe['sell'] = 0\n\n        return dataframe\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n                    \n        dataframe, _ = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n\n        if current_profit > 0.01 and last_candle['roc'] < 0.5:\n            return 'rode_that_ass'\n\n        return None"
  },
  {
    "path": "strategies/YOLO/YOLO.py",
    "content": "import freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, DatetimeIndex, merge, Series\n\n\nclass YOLO(IStrategy):\n\n    # Buy hyperspace params:\n    buy_params = {\n\t\t'adx': 34, \n\t\t'aroon-down': 33, \n\t\t'aroon-up': 98\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.03,\n        \"7\": 0.02,\n        \"33\": 0.01,\n        \"71\": 0.005\n    }\n\n    # Stoploss:\n    stoploss = -0.01\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.03289\n    trailing_stop_positive_offset = 0.05723\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n    \n    timeframe = '1m'\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=90) #90\n        aroon = ta.AROON(dataframe, timeperiod=60) #60\n\n        dataframe['aroon-down'] = aroon['aroondown'] \n        dataframe['aroon-up'] = aroon['aroonup']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        params = self.buy_params\n\n        dataframe.loc[\n            ( \n                (dataframe['adx'] > params['adx']) &\n                (dataframe['aroon-up'] > params['aroon-up']) &\n                (dataframe['aroon-down'] < params['aroon-down']) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        no sell signal\n        \"\"\"\n        dataframe['sell'] = 0\n        return dataframe"
  },
  {
    "path": "strategies/adaptive/adaptive.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas_ta as pta\nimport talib.abstract as ta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\n\n# --------------------------------\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\nclass adaptive(IStrategy):\n    \"\"\"\n\n    author: @jilv220\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.02\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.109\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # MAMA, FAMA, KAMA\n        dataframe['hl2'] = (dataframe['high'] + dataframe['low']) / 2\n        dataframe['mama'], dataframe['fama'] = ta.MAMA(dataframe['hl2'], 0.25, 0.025)\n        dataframe['mama_diff'] = ( ( dataframe['mama'] - dataframe['fama'] ) / dataframe['hl2'] )\n        dataframe['kama'] = ta.KAMA(dataframe['close'], 84)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['kama'] > dataframe['fama']) &\n                (dataframe['fama'] > dataframe['mama'] * 0.981) &\n                (dataframe['r_14'] < -61.3) &\n                (dataframe['mama_diff'] < -0.025) &\n                (dataframe['cti'] < -0.715)\n                &\n                (dataframe['close'].rolling(48).max() >= (dataframe['close'] * 1.05 )) &\n                ( (dataframe['close'].rolling(288).max() >= (dataframe['close'] * 1.125 )) )\n                &\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60)\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/adx_opt_strat/adx_opt_strat.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\n\n\n# --------------------------------\n\n\nclass adx_opt_strat(IStrategy):\n    \"\"\"\n    author@: Gert Wohlgemuth\n    converted from:\n        https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AdxMomentum.cs\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.0692,\n        \"7\": 0.02682,\n        \"10\": 0.00771,\n        \"32\": 0\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.32766\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.32634\n    trailing_stop_positive_offset = 0.34487  \n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '1m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        dataframe['sar'] = ta.SAR(dataframe)\n        dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['mom'] < 0) &\n                    (dataframe['minus_di'] > 48) &\n                    (dataframe['plus_di'] < dataframe['minus_di'])\n\n            ),\n            'buy'] = 1\n        \n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['mom'] > 0) &\n                    (dataframe['minus_di'] > 48) &\n                    (dataframe['plus_di'] > dataframe['minus_di'])\n\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/adxbbrsi2/adxbbrsi2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n\n# --------------------------------\n\n\nclass adxbbrsi2(IStrategy):\n    \"\"\"\n\n    author@: Gert Wohlgemuth\n\n    converted from:\n\n        https://github.com/sthewissen/Mynt/blob/master/src/Mynt.Core/Strategies/AdxMomentum.cs\n\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"0\": 0.16083,\n        \"33\": 0.04139,\n        \"85\": 0.01225,\n        \"197\": 0\n\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.32237\n\n    # Optimal timeframe for the strategy\n    timeframe = '1h'\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    ##Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.1195\n    trailing_stop_positive_offset = 0.1568\n    trailing_only_offset_is_reached = True\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['adx'] = ta.ADX(dataframe, timeperiod=14)\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe, timeperiod=25)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe, timeperiod=25)\n        # dataframe['mom'] = ta.MOM(dataframe, timeperiod=14)\n\n        ## Stochastic\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        #SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['adx'] > 47) &\n                (dataframe['fastd'] < 41)&\n                (dataframe['close'] < dataframe['bb_lowerband'])\n                    # (dataframe['mom'] > 0) &\n                    # (dataframe['minus_di'] > 25) &\n                    # (dataframe['plus_di'] > dataframe['minus_di'])\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['adx'] > 67) &\n                (dataframe['mfi'] > 97) &\n                # (dataframe['rsi'] > 97) &\n                (dataframe['fastd'] < 74)\n                # (dataframe['sar'] < 97)\n                #fastd 74\n                #mfi 97\n                # (dataframe['mom'] < 0) &\n                # (dataframe['minus_di'] > 25) &\n                # (dataframe[\"close\"] > dataframe['bb_upperband'])\n                # (dataframe['plus_di'] < dataframe['minus_di'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/bb_rsi_opt_new/bb_rsi_opt_new.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass bb_rsi_opt_new(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.3,\n        \"20\": 0.2,\n        \"30\": 0.1,\n        \"100\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.29207\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.16347\n    trailing_stop_positive_offset = 0.23526  # Disabled / not configured\n\n    # Optimal ticker interval for the strategy.\n    ticker_interval = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n\n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        dataframe['bb_middleband4'] = bollinger4['mid']\n        dataframe['bb_upperband4'] = bollinger4['upper']\n\n# bb-band here should be 4 stdevs, using 2 to test with container\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 28) &\n                (dataframe['close'] < dataframe['bb_lowerband4'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        \"\"\"\n        no sell signal\n        \"\"\"\n        dataframe['sell'] = 0\n        return dataframe\n"
  },
  {
    "path": "strategies/bbema/bbema.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\nimport talib.abstract as ta\nfrom pandas import DataFrame\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\n\nclass bbema(IStrategy):\n    \"\"\"\n    Default Strategy provided by freqtrade bot.\n    You can override it with your own strategy\n    \"\"\"\n\n    # Minimal ROI designed for the strategy\n    minimal_roi = {\n        \"0\": 0.2\n    }\n\n    # Optimal stoploss designed for the strategy\n    stoploss = -0.10\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '1h'\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional time in force for orders\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Raw data from the exchange and parsed by parse_ticker_dataframe()\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n       \n        # Bollinger bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n            \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n       \n        dataframe['close10'] = dataframe['close'].shift(periods=-10)\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['ema10'], dataframe['ema50'])) \n            ), \n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['ema50'], dataframe['ema10'])) \n                # (dataframe['close'] < dataframe['close'].shift(periods=-10)) \n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/bbrsi1_strategy/bbrsi1_strategy.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass bbrsi1_strategy (IStrategy):\n\n   # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # Bollinger bands stds 2\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband_2'] = bollinger['lower']\n        dataframe['bb_middleband_2'] = bollinger['mid']\n        dataframe['bb_upperband_2'] = bollinger['upper']\n        \n        # Bollinger bands stds 3\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband_3'] = bollinger['lower']\n        dataframe['bb_middleband_3'] = bollinger['mid']\n        dataframe['bb_upperband_3'] = bollinger['upper']\n        \n        # Bollinger bands stds 4\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband_4'] = bollinger['lower']\n        dataframe['bb_middleband_4'] = bollinger['mid']\n        dataframe['bb_upperband_4'] = bollinger['upper']\n\n        return dataframe\n        \n    # Hyperoptable parameters\n    buy_rsi = IntParameter(low=1, high=50, default=30, space=\"buy\", optimize=True, load=True),\n    buy_rsi_enabled = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=True),\n    buy_trigger = CategoricalParameter([\"bb_lowerband_2\", \"bb_lowerband_3\", \"bb_lowerband_4\",], default=\"bb_lowerband_2\", space=\"buy\", \toptimize=True),\n    sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True),\n    sell_rsi_enabled = CategoricalParameter([True, False], default=True, space=\"sell\"),\n    sell_trigger = CategoricalParameter([\"bb_middleband_2\", \"bb_middleband_3\", \"bb_middleband_4\", \"bb_upperband_2\", \"bb_upperband_3\", \t\"bb_upperband_4\"], default=\"bb_upperband_2\", space=\"sell\")\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'] < 30) &\n                    (dataframe['close'] < dataframe['bb_lowerband_2']) &\n                    (dataframe['volume'] > 0)\n\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'] > 70) &\n                    (dataframe['volume'] > 0)\n\n            ),\n            'sell'] = 1\n        return dataframe\n\n"
  },
  {
    "path": "strategies/bbrsi4Freq/bbrsi4Freq.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass bbrsi4Freq(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.18656,\n        \"21\": 0.09694,\n        \"73\": 0.03081,\n        \"180\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.36727\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_stop_positive = 0.32349\n    trailing_stop_positive_offset = 0.34683\n    trailing_only_offset_is_reached = True\n\n    # Optimal ticker interval for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Bollinger Bands\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        dataframe['bb_middleband1'] = bollinger1['mid']\n        dataframe['bb_upperband1'] = bollinger1['upper']\n\n        bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        dataframe['bb_lowerband3'] = bollinger3['lower']\n        dataframe['bb_middleband3'] = bollinger3['mid']\n        dataframe['bb_upperband3'] = bollinger3['upper']\n\n        # dataframe[\"bb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n        #     (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        # )\n        # dataframe[\"bb_width\"] = (\n        #     (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        # )\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] > 8) &\n                (dataframe[\"close\"] < dataframe['bb_lowerband3'])\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # (dataframe['rsi'] > 46) &\n                (dataframe[\"close\"] > dataframe['bb_lowerband1'])\n            ),\n            'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/bestV2/bestV2.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport numpy as np\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport datetime\nfrom technical.util import resample_to_interval, resampled_merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\nimport technical.indicators as ftt\n\n# Buy hyperspace params:\nbuy_params = {\n    \"base_nb_candles_buy\": 31,\n    \"ewo_high\": 4.638,\n    \"ewo_low\": -16.993,\n    \"low_offset\": 0.978,\n    \"rsi_buy\": 55\n}\n\n# Sell hyperspace params:\nsell_params = {\n    \"base_nb_candles_sell\": 19,\n    \"high_offset\": 1.008\n}\n\ndef Kalman(dataframe: DataFrame):\n    \"\"\"\n    One-dimensional steady-state Kalman filter. It is obtained from the\n    alpha filter.\n    \"\"\"\n    df = dataframe.copy()\n    src = dataframe['close']\n    tr = ta.TRANGE(dataframe)\n    df['value1'] = 0.2 * (src - src.shift(1, fill_value=0)) \n    df['value1'] = df['value1'].rolling(2, min_periods=1).apply(lambda x: x.iloc[0] + 0.8 * x.iloc[-1])\n    df['value2'] = 0.1 * (tr)\n    df['value2'] = df['value2'].rolling(2, min_periods=1).apply(lambda x: x.iloc[0] + 0.8 * x.iloc[-1])\n\n    L = abs(df['value1'] / df['value2'])\n    # Alpha filter\n    alpha = (-L ** 2.0 + np.sqrt(L ** 4.0 + 16.0 * L ** 2.0)) / 8.0\n\n    df['value3'] =  alpha * src\n    df['value3'] = (1 - alpha) * df['value3'].shift(1, fill_value=0)\n    \n    return df['value3'].fillna(0)\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['close'] * 100\n    return emadif\n\nclass bestV2(IStrategy):\n    INTERFACE_VERSION = 2\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.12,\n        \"10\": 0.079,\n        \"39\": 0.05,\n        \"157\": 0.02\n    }\n\n    # Stoploss:\n    stoploss = -0.19\n\n    # SMAOffset\n    base_nb_candles_buy = IntParameter(\n        5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\n    base_nb_candles_sell = IntParameter(\n        5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\n    low_offset = DecimalParameter(\n        0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\n    high_offset = DecimalParameter(\n        0.99, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n\n    # Protection\n    fast_ewo = 50\n    slow_ewo = 200\n    ewo_low = DecimalParameter(-20.0, -8.0,\n                               default=buy_params['ewo_low'], space='buy', optimize=True)\n    ewo_high = DecimalParameter(\n        2.0, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.049\n    trailing_only_offset_is_reached = True\n\n    # Sell signal\n    use_sell_signal = True\n    sell_profit_only = False\n    sell_profit_offset = 0.01\n    ignore_roi_if_buy_signal = True\n\n    ## Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'ioc'\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n\n    process_only_new_candles = True\n    startup_candle_count = 120\n\n    plot_config = {\n        'main_plot': {\n            'ma_buy': {'color': 'orange'},\n            'ma_sell': {'color': 'orange'},\n        },\n    }\n\n    use_custom_stoploss = False\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Calculate all ma_buy values\n        for val in self.base_nb_candles_buy.range:\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\n        \n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] > self.ewo_high.value) &\n                (dataframe['rsi'] < self.rsi_buy.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        conditions.append(\n            (\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\n                (dataframe['EWO'] < self.ewo_low.value) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'buy'\n            ]=1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0)\n            )\n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ]=1\n\n        return dataframe"
  },
  {
    "path": "strategies/botbaby/botbaby.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass botbaby(IStrategy):\n\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n    # IMP NOTEEEEEEEE - also change this roi parameter after testing\n    minimal_roi = {\n\n        \"0\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    #  IMP NOTE -Hey listen, remeber to change stoploss after testing\n    stoploss = -0.007\n\n    # Trailing stoploss\n    trailing_stop = False\n\n    # Optimal timeframe for the strategy.\n    timeframe = '30m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n\n    def informative_pairs(self):\n\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # ADX\n\n\n         # EMA - Exponential Moving Average\n\n         dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n         dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n         dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n         dataframe['ema13'] = ta.EMA(dataframe, timeperiod = 13 )\n         dataframe['ema50'] = ta.EMA(dataframe, timeperiod = 50)\n\n         return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (\n                (dataframe['ema13'] > dataframe['ema50']) &\n                (dataframe['ema13'].shift(1) <= dataframe['ema50'].shift(1))\n                )\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (\n                (dataframe['ema13'] < dataframe['ema50'])\n                )\n            ),\n            'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/conny/conny.py",
    "content": "import numpy as np # noqa\nimport pandas as pd # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom technical.consensus import Consensus\n\nclass conny(IStrategy):\n\n    minimal_roi = {\n        \"0\": 0.025,\n        \"10\": 0.015,\n        \"20\": 0.01,\n        \"30\": 0.005,\n        \"120\": 0\n    }\n\n    stoploss = -0.0203\n\n    timeframe = '15m'\n\n    process_only_new_candles = True\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    startup_candle_count: int = 30\n\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Consensus strategy\n        # add c.evaluate_indicator bellow to include it in the consensus score (look at\n        # consensus.py in freqtrade technical)\n        # add custom indicator with c.evaluate_consensus(prefix=<indicator name>)\n        c = Consensus(dataframe)\n        c.evaluate_rsi()\n        c.evaluate_stoch()\n        c.evaluate_macd_cross_over()\n        c.evaluate_macd()\n        c.evaluate_hull()\n        c.evaluate_vwma()\n        c.evaluate_tema(period=12)\n        c.evaluate_ema(period=24)\n        c.evaluate_sma(period=12)\n        c.evaluate_laguerre()\n        c.evaluate_osc()\n        c.evaluate_cmf()\n        c.evaluate_cci()\n        c.evaluate_cmo()\n        c.evaluate_ichimoku()\n        c.evaluate_ultimate_oscilator()\n        c.evaluate_williams()\n        c.evaluate_momentum()\n        c.evaluate_adx()\n        dataframe['consensus_buy'] = c.score()['buy']\n        dataframe['consensus_sell'] = c.score()['sell']\n\n\n        print(dataframe)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['consensus_buy'] > 45) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['consensus_sell'] > 88) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/cryptohassle/cryptohassle.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.persistence import Trade\nfrom datetime import timedelta, datetime, timezone\n#from freqtrade.strategy.strategy_helper import  merge_informative_pair\nfrom typing import Dict, List\nimport numpy as np\n# --------------------------------\n# 11-Aug-20  - seems to be good making a few trades  5 days 33 wins 7 losses AVE 0.41% tot ROI 17.14%\n\nclass cryptohassle(IStrategy):\n    \"\"\"\n\n    author@: Sp0ngeB0bUK\n    Title:  Crypto Hassle \n    Version: 0.1\n\n    Heikin Ashi Candles - SSL Channel, Momentum cross supported by MACD\n    \n    \"\"\"\n    \n    \n   \n    minimal_roi = {\n        \"0\": 0.50,\n        #\"192\": -1\n        \n    }\n\n    # Stoploss:\n    stoploss = -0.20\n    \n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.07\n    trailing_only_offset_is_reached = True\n    \n    \n\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '1h'\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': True\n    }\n    plot_config = {\n        'main_plot': {\n            # Configuration for main plot indicators.\n            # Specifies `ema10` to be red, and `ema50` to be a shade of gray\n            'ha_ema9': {'color': 'green'},\n            'ha_ema20': {'color': 'red'}\n        },\n        'subplots': {\n            # Additional subplot RSI\n            \"ADX\": {\n                'ha_adx': {'color': 'blue'}\n            }\n        }\n    }\n    \n    \n       \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        # # Heikin Ashi Strategy\n        heikinashi = qtpylib.heikinashi(dataframe)\n        # Heikinashi EMA\n        #dataframe['ha_ema9'] = ta.EMA(heikinashi, timeperiod=9)\n        #dataframe['ha_ema20'] = ta.EMA(heikinashi, timeperiod=20)\n        # Heikinashi ADX\n        #dataframe['ha_adx'] = ta.ADX(heikinashi)\n        # HeikinAshi EMA cross to ADX cross rolling delta\n        #dataframe['ha_adx_cross'] = qtpylib.crossed_above(dataframe['ha_adx'],25)\n        # HeikinAhi EMA9 crossed above EMA20\n        #dataframe['ha_ema_cross_above'] = qtpylib.crossed_above(dataframe['ha_ema9'],dataframe['ha_ema20'])\n        # HeikinAhi EMA9 crossed below EMA20\n        #dataframe['ha_ema_cross_below'] = qtpylib.crossed_below(dataframe['ha_ema9'],dataframe['ha_ema20'])\n        # Heikin Ashi Momentum\n        #Momentum\n        dataframe['ha_mom'] = ta.MOM(heikinashi, timeperiod=14)\n        dataframe['ha_mom_cross_above'] = qtpylib.crossed_above(dataframe['ha_mom'],0)\n        # Heikin Ashi Candles\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']  \n        dataframe['ha_high'] = heikinashi['high'] \n        dataframe['ha_low'] = heikinashi['low']\n        # Heikin Ashi MACD\n        macd = ta.MACD(heikinashi)\n        dataframe['ha_macd'] = macd['macd']\n        dataframe['ha_macdsignal'] = macd['macdsignal']\n        dataframe['ha_macdhist'] = macd['macdhist']\n        dataframe['ha_macd_cross_above'] = qtpylib.crossed_above(dataframe['ha_macd'],dataframe['ha_macdsignal'])\n        # Heikin Ashi SSl Channels\n        def SSLChannels(dataframe, length = 10, mode='sma'):\n            \"\"\"\n            Source: https://www.tradingview.com/script/xzIoaIJC-SSL-channel/\n            Author: xmatthias\n            Pinescript Author: ErwinBeckers\n            SSL Channels.\n            Average over highs and lows form a channel - lines \"flip\" when close crosses either of the 2 lines.\n            Trading ideas:\n                * Channel cross\n                * as confirmation based on up > down for long\n                MC - MODIFIED FOR HA CANDLES\n            \"\"\"\n            if mode not in ('sma'):\n                raise ValueError(f\"Mode {mode} not supported yet\")\n            df = dataframe.copy()\n            if mode == 'sma':\n                df['smaHigh'] = df['ha_high'].rolling(length).mean()\n                df['smaLow'] = df['ha_low'].rolling(length).mean()\n            df['hlv'] = np.where(df['ha_close'] > df['smaHigh'], 1, np.where(df['ha_close'] < df['smaLow'], -1, np.NAN))\n            df['hlv'] = df['hlv'].ffill()\n            df['ha_sslDown'] = np.where(df['hlv'] < 0, df['smaHigh'], df['smaLow'])\n            df['ha_sslUp'] = np.where(df['hlv'] < 0, df['smaLow'], df['smaHigh'])\n            return df['ha_sslDown'], df['ha_sslUp']\n        ssl = SSLChannels(dataframe, 10)\n        dataframe['ha_sslDown'] = ssl[0]\n        dataframe['ha_sslUp'] = ssl[1]\n        dataframe['ha_ssl_cross_above'] = qtpylib.crossed_above(dataframe['ha_sslUp'],dataframe['ha_sslDown'])\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    \n                    # Heikin Ashi SSL Channels\n                    (dataframe['ha_ssl_cross_above'].rolling(5).apply(lambda x: x.any(), raw=False) == 1) &\n                    # Momentum\n                    (dataframe['ha_mom_cross_above'].rolling(5).apply(lambda x: x.any(), raw=False) == 1) &\n                    # Heikin Ashi MacD\n                    (dataframe['ha_macd_cross_above'].rolling(5).apply(lambda x: x.any(), raw=False) == 1) &\n                    # Volume\n                    (dataframe['volume'] > 1000)\n                    \n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                \n                qtpylib.crossed_below(dataframe['ha_sslUp'],dataframe['ha_sslDown']) &\n                (dataframe['volume'] > 0)\n                              \n            ),\n        'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/custom/custom.py",
    "content": "# --- Do not remove these libs ---\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom typing import Dict, List\r\nfrom functools import reduce\r\nfrom pandas import DataFrame\r\n# --------------------------------\r\n\r\nimport talib.abstract as ta\r\nimport numpy as np\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport datetime\r\nfrom technical.util import resample_to_interval, resampled_merge\r\nfrom datetime import datetime, timedelta\r\nfrom freqtrade.persistence import Trade\r\nfrom freqtrade.strategy import stoploss_from_open, merge_informative_pair, DecimalParameter, IntParameter, CategoricalParameter\r\nimport technical.indicators as ftt\r\n\r\n\r\n#Divergence variables\r\nrangeUpper = 60\r\nrangeLower = 5\r\n\r\n# Buy hyperspace params:\r\nbuy_params = {\r\n      \"antipump_threshold\": 0.257,\r\n      \"base_nb_candles_buy\": 14,\r\n      \"ewo_high\": 2.327,\r\n      \"ewo_high_2\": -2.327,\r\n      \"ewo_low\": -20.988,\r\n      \"low_offset\": 0.975,\r\n      \"low_offset_2\": 0.955,\r\n      \"rsi_buy\": 40,\r\n\r\n      #SMAOffsetProtectOptV1\r\n      \"base_nb_candles_buy2\": 16,\r\n      \"ewo_high2\": 5.638,\r\n      \"ewo_low2\": -19.993,\r\n      \"low_offset2\": 0.978,\r\n      \"rsi_buy2\": 61,\r\n}\r\n\r\n# Sell hyperspace params:\r\nsell_params = {\r\n      \"base_nb_candles_sell\": 24,\r\n      \"high_offset\": 0.991,\r\n      \"high_offset_2\": 0.997,\r\n      #SMAOffsetProtectOptV1\r\n      \"base_nb_candles_sell2\": 49,\r\n      \"high_offset2\": 1.006, \"cstp_bail_how\": \"roc\",\r\n      #####\r\n      \"cstp_bail_roc\": -0.032,\r\n      \"cstp_bail_time\": 1108,\r\n      \"cstp_bb_trailing_input\": \"bb_lowerband_neutral_inf\",\r\n      \"cstp_threshold\": -0.036,\r\n      \"cstp_trailing_max_stoploss\": 0.054,\r\n      \"cstp_trailing_only_offset_is_reached\": 0.06,\r\n      \"cstp_trailing_stop_profit_devider\": 2,\r\n      \"droi_pullback\": True,\r\n      \"droi_pullback_amount\": 0.03,\r\n      \"droi_pullback_respect_table\": False,\r\n      \"droi_trend_type\": \"any\",\r\n}\r\n\r\n\r\n\r\n\r\nclass custom(IStrategy):\r\n    INTERFACE_VERSION = 2\r\n\r\n    # Modified ROI - 20210620\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.028,\r\n        \"10\": 0.018,\r\n        \"30\": 0.010,\r\n        \"40\": 0.005\r\n    }\r\n\r\n\r\n    custom_trade_info = {}\r\n\r\n    # Stoploss:\r\n    stoploss = -0.11\r\n\r\n    antipump_threshold = DecimalParameter(0, 0.4, default=0.25, space='buy', optimize=True)\r\n\r\n    # SMAOffset\r\n    base_nb_candles_buy = IntParameter(5, 80, default=buy_params['base_nb_candles_buy'], space='buy', optimize=True)\r\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\r\n    low_offset = DecimalParameter(0.9, 0.99, default=buy_params['low_offset'], space='buy', optimize=True)\r\n    low_offset_2 = DecimalParameter(0.9, 0.99, default=buy_params['low_offset_2'], space='buy', optimize=True)\r\n    high_offset = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\r\n    high_offset_2 = DecimalParameter(0.99, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\r\n\r\n    #SMAOffsetProtectOptV1\r\n    low_offset2 = DecimalParameter(0.9, 0.99, default=buy_params['low_offset2'], space='buy', optimize=True)\r\n    base_nb_candles_buy2 = IntParameter(5, 80, default=buy_params['base_nb_candles_buy2'], space='buy', optimize=True)\r\n    base_nb_candles_sell2 = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=True)\r\n    high_offset2 = DecimalParameter(0.95, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\r\n\r\n    # Protection\r\n    fast_ewo = 50\r\n    slow_ewo = 200\r\n    ewo_low = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low'], space='buy', optimize=True)\r\n    ewo_high = DecimalParameter(2.00, 12.0, default=buy_params['ewo_high'], space='buy', optimize=True)\r\n    ewo_high_2 = DecimalParameter(-6.0, 12.0, default=buy_params['ewo_high_2'], space='buy', optimize=True)\r\n    rsi_buy = IntParameter(30, 70, default=buy_params['rsi_buy'], space='buy', optimize=True)\r\n\r\n    #SMAOffsetProtectOptV1\r\n    ewo_low2 = DecimalParameter(-20.0, -8.0, default=buy_params['ewo_low2'], space='buy', optimize=True)\r\n    ewo_high2 = DecimalParameter(2.0, 12.0, default=buy_params['ewo_high2'], space='buy', optimize=True)\r\n    rsi_buy2 = IntParameter(30, 70, default=buy_params['rsi_buy2'], space='buy', optimize=True)\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    #trailing_stop_positive = 0.005\r\n    #trailing_stop_positive_offset = 0.03\r\n    #trailing_only_offset_is_reached = True\r\n\r\n    # Sell signal\r\n    use_sell_signal = False\r\n    sell_profit_only = False\r\n    sell_profit_offset = 0.01\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Optimal timeframe for the strategy\r\n    timeframe = '5m'\r\n    informative_timeframe = '1h'\r\n\r\n    process_only_new_candles = True\r\n    startup_candle_count: int = 100\r\n\r\n    plot_config = {\r\n        'main_plot': {\r\n            'ma_buy': {'color': 'orange'},\r\n            'ma_sell': {'color': 'orange'},\r\n        },\r\n    }\r\n    # Strategy Specific Variable Storage\r\n    custom_trade_info = {}\r\n\r\n\r\n    def informative_pairs(self):\r\n\r\n        pairs = self.dp.current_whitelist()\r\n        informative_pairs = [(pair, self.informative_timeframe) for pair in pairs]\r\n\r\n        return informative_pairs\r\n\r\n    def get_informative_indicators(self, metadata: dict):\r\n\r\n        dataframe = self.dp.get_pair_dataframe(\r\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\r\n\r\n        return dataframe\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n\r\n        len = 14\r\n        src = dataframe['close']\r\n        lbL = 10 #5\r\n        dataframe['osc'] = ta.RSI(src, len)\r\n        dataframe['osc'] = dataframe['osc'].fillna(0)\r\n\r\n        # plFound = na(pivotlow(osc, lbL, lbR)) ? false : true\r\n        dataframe['min'] = dataframe['osc'].rolling(lbL).min()\r\n        dataframe['prevMin'] = np.where(dataframe['min'] > dataframe['min'].shift(), dataframe['min'].shift(), dataframe['min'])\r\n        dataframe.loc[\r\n            (dataframe['osc'] == dataframe['prevMin'])\r\n        , 'plFound'] = 1\r\n        dataframe['plFound'] = dataframe['plFound'].fillna(0)\r\n\r\n        # phFound = na(pivothigh(osc, lbL, lbR)) ? false : true\r\n        dataframe['max'] = dataframe['osc'].rolling(lbL).max()\r\n        dataframe['prevMax'] = np.where(dataframe['max'] < dataframe['max'].shift(), dataframe['max'].shift(), dataframe['max'])\r\n        dataframe.loc[\r\n            (dataframe['osc'] == dataframe['prevMax'])\r\n        , 'phFound'] = 1\r\n        dataframe['phFound'] = dataframe['phFound'].fillna(0)\r\n\r\n\r\n        #------------------------------------------------------------------------------\r\n        # Regular Bullish\r\n        # Osc: Higher Low\r\n        # oscHL = osc[lbR] > valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])\r\n        dataframe['valuewhen_plFound_osc'], dataframe['inrange_plFound_osc'] = valuewhen(dataframe, 'plFound', 'osc', 1)\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['osc'] > dataframe['valuewhen_plFound_osc']) &\r\n                (dataframe['inrange_plFound_osc'] == 1)\r\n             )\r\n        , 'oscHL'] = 1\r\n\r\n        # Price: Lower Low\r\n        # priceLL = low[lbR] < valuewhen(plFound, low[lbR], 1)\r\n        dataframe['valuewhen_plFound_low'], dataframe['inrange_plFound_low'] = valuewhen(dataframe, 'plFound', 'low', 1)\r\n        dataframe.loc[\r\n            (dataframe['low'] < dataframe['valuewhen_plFound_low'])\r\n            , 'priceLL'] = 1\r\n        #bullCond = plotBull and priceLL and oscHL and plFound\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['priceLL'] == 1) &\r\n                (dataframe['oscHL'] == 1) &\r\n                (dataframe['plFound'] == 1)\r\n            )\r\n            , 'bullCond'] = 1\r\n\r\n        # //------------------------------------------------------------------------------\r\n        # // Hidden Bullish\r\n        # // Osc: Lower Low\r\n        #\r\n        # oscLL = osc[lbR] < valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])\r\n        dataframe['valuewhen_plFound_osc'], dataframe['inrange_plFound_osc'] = valuewhen(dataframe, 'plFound', 'osc', 1)\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['osc'] < dataframe['valuewhen_plFound_osc']) &\r\n                (dataframe['inrange_plFound_osc'] == 1)\r\n             )\r\n        , 'oscLL'] = 1\r\n        #\r\n        # // Price: Higher Low\r\n        #\r\n        # priceHL = low[lbR] > valuewhen(plFound, low[lbR], 1)\r\n        dataframe['valuewhen_plFound_low'], dataframe['inrange_plFound_low'] = valuewhen(dataframe,'plFound', 'low', 1)\r\n        dataframe.loc[\r\n            (dataframe['low'] > dataframe['valuewhen_plFound_low'])\r\n            , 'priceHL'] = 1\r\n        # hiddenBullCond = plotHiddenBull and priceHL and oscLL and plFound\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['priceHL'] == 1) &\r\n                (dataframe['oscLL'] == 1) &\r\n                (dataframe['plFound'] == 1)\r\n            )\r\n            , 'hiddenBullCond'] = 1\r\n\r\n        # //------------------------------------------------------------------------------\r\n        # // Regular Bearish\r\n        # // Osc: Lower High\r\n        #\r\n        # oscLH = osc[lbR] < valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])\r\n        dataframe['valuewhen_phFound_osc'], dataframe['inrange_phFound_osc'] = valuewhen(dataframe, 'phFound', 'osc', 1)\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['osc'] < dataframe['valuewhen_phFound_osc']) &\r\n                (dataframe['inrange_phFound_osc'] == 1)\r\n             )\r\n        , 'oscLH'] = 1\r\n        #\r\n        # // Price: Higher High\r\n        #\r\n        # priceHH = high[lbR] > valuewhen(phFound, high[lbR], 1)\r\n        dataframe['valuewhen_phFound_high'], dataframe['inrange_phFound_high'] = valuewhen(dataframe, 'phFound', 'high', 1)\r\n        dataframe.loc[\r\n            (dataframe['high'] > dataframe['valuewhen_phFound_high'])\r\n            , 'priceHH'] = 1\r\n        #\r\n        # bearCond = plotBear and priceHH and oscLH and phFound\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['priceHH'] == 1) &\r\n                (dataframe['oscLH'] == 1) &\r\n                (dataframe['phFound'] == 1)\r\n            )\r\n            , 'bearCond'] = 1\r\n\r\n        # //------------------------------------------------------------------------------\r\n        # // Hidden Bearish\r\n        # // Osc: Higher High\r\n        #\r\n        # oscHH = osc[lbR] > valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])\r\n        dataframe['valuewhen_phFound_osc'], dataframe['inrange_phFound_osc'] = valuewhen(dataframe, 'phFound', 'osc', 1)\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['osc'] > dataframe['valuewhen_phFound_osc']) &\r\n                (dataframe['inrange_phFound_osc'] == 1)\r\n             )\r\n        , 'oscHH'] = 1\r\n        #\r\n        # // Price: Lower High\r\n        #\r\n        # priceLH = high[lbR] < valuewhen(phFound, high[lbR], 1)\r\n        dataframe['valuewhen_phFound_high'], dataframe['inrange_phFound_high'] = valuewhen(dataframe, 'phFound', 'high', 1)\r\n        dataframe.loc[\r\n            (dataframe['high'] < dataframe['valuewhen_phFound_high'])\r\n            , 'priceLH'] = 1\r\n        #\r\n        # hiddenBearCond = plotHiddenBear and priceLH and oscHH and phFound\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['priceLH'] == 1) &\r\n                (dataframe['oscHH'] == 1) &\r\n                (dataframe['phFound'] == 1)\r\n            )\r\n            , 'hiddenBearCond'] = 1\r\n\r\n        # Calculate all ma_buy values\r\n        for val in self.base_nb_candles_buy.range:\r\n            dataframe[f'ma_buy_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        # Calculate all ma_buy values\r\n        for val in self.base_nb_candles_buy2.range:\r\n            dataframe[f'ma_buy2_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        # Calculate all ma_sell values\r\n        for val in self.base_nb_candles_sell.range:\r\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        # Calculate all ma_sell values\r\n        for val in self.base_nb_candles_sell2.range:\r\n            dataframe[f'ma_sell2_{val}'] = ta.EMA(dataframe, timeperiod=val)\r\n\r\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\r\n        dataframe['hma_9'] = qtpylib.hull_moving_average(dataframe['close'], window=9)\r\n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\r\n\r\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\r\n        dataframe['ema_9'] = ta.EMA(dataframe, timeperiod=9)\r\n\r\n        # Elliot\r\n        dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)\r\n\r\n        #pump stregth\r\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\r\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\r\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\r\n\r\n        # RSI\r\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\r\n\r\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\r\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\r\n\r\n        dataframe['rmi'] = RMI(dataframe, length=24, mom=5)\r\n\r\n        dataframe['roc'] = dataframe['close'].pct_change(12).rolling(12).max() * 100\r\n\r\n        # Base pair informative timeframe indicators\r\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\r\n\r\n        # Get the \"average day range\" between the 1d high and 1d low to set up guards\r\n        informative['1d-high'] = informative['close'].rolling(24).max()\r\n        informative['1d-low'] = informative['close'].rolling(24).min()\r\n\r\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, self.informative_timeframe, ffill=True)\r\n\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        dont_buy_conditions = []\r\n\r\n        dont_buy_conditions.append(\r\n            (dataframe['pump_strength'] > self.antipump_threshold.value) &\r\n            (dataframe['bearCond'] < 1) &\r\n            (dataframe['hiddenBearCond'] < 1)\r\n        )\r\n        #\"\"\r\n\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n                (dataframe['rsi_fast'] <35)&\r\n                (dataframe['rsi_fast'] >4)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\r\n                (dataframe['EWO'] > self.ewo_high.value) &\r\n                (dataframe['rsi'] < self.rsi_buy.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\r\n            )\r\n        )\r\n\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n                (dataframe['rsi_fast'] <35)&\r\n                (dataframe['rsi_fast'] >4)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\r\n                (dataframe['EWO'] > self.ewo_high_2.value) &\r\n                (dataframe['rsi'] < self.rsi_buy.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\r\n                (dataframe['rsi']<25)\r\n            )\r\n        )\r\n\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n                (dataframe['rsi_fast'] < 35)&\r\n                (dataframe['rsi_fast'] >4)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\r\n                (dataframe['EWO'] < self.ewo_low.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\r\n            )\r\n        )\r\n        #\"\"\r\n\r\n        #SMAOffsetProtectOptV1\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['close'] < (dataframe[f'ma_buy2_{self.base_nb_candles_buy2.value}'] * self.low_offset2.value)) &\r\n                (dataframe['EWO'] > self.ewo_high2.value) &\r\n                (dataframe['rsi'] < self.rsi_buy2.value) &\r\n                (dataframe['volume'] > 0)\r\n            )\r\n        )\r\n\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['close'] < (dataframe[f'ma_buy2_{self.base_nb_candles_buy2.value}'] * self.low_offset2.value)) &\r\n                (dataframe['EWO'] < self.ewo_low2.value) &\r\n                (dataframe['volume'] > 0)\r\n            )\r\n        )\r\n\r\n\r\n        if conditions:\r\n            dataframe.loc[\r\n                reduce(lambda x, y: x | y, conditions),\r\n                'buy'\r\n            ]=1\r\n\r\n        if dont_buy_conditions:\r\n            for condition in dont_buy_conditions:\r\n                dataframe.loc[condition, 'buy'] = 0\r\n\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        dataframe.loc[:, 'sell'] = 0\r\n\r\n        \"\"\"\r\n        conditions.append(\r\n            (\r\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\r\n                (dataframe['volume'] > 0)\r\n            )\r\n        )\r\n        conditions.append(\r\n            (\r\n                (dataframe['close'] > (dataframe[f'ma_sell2_{self.base_nb_candles_sell2.value}'] * self.high_offset2.value)) &\r\n                (dataframe['volume'] > 0)\r\n            )\r\n        )\r\n        \"\"\"\r\n\r\n        if conditions:\r\n            dataframe.loc[\r\n                reduce(lambda x, y: x | y, conditions),\r\n                'sell'\r\n            ]=1\r\n\r\n        return dataframe\r\n\r\n    #\"\"\r\n    def custom_sell(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,\r\n                    current_profit: float, **kwargs):\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n        last_candle = dataframe.iloc[-1].squeeze()\r\n\r\n        # only neg\r\n        #if current_profit < -0.1:\r\n        #    if last_candle['hiddenBearCond'] == 1:\r\n        #        return 'Hidden_Bear_div_loss'\r\n\r\n        #if current_profit < -0.1:\r\n        #    if last_candle['bearCond'] == 1:\r\n        #        return 'Bear on neg'\r\n\r\n        #only pos\r\n        if current_profit > 0:\r\n            if last_candle['hiddenBearCond'] == 1:\r\n                return 'Hidden_Bear_div_profit'\r\n\r\n        if current_profit > 0:\r\n            if last_candle['bearCond'] == 1:\r\n                return 'Bear_div_profit'\r\n\r\n        # both\r\n        #if current_profit > 0 or current_profit < -0.01:\r\n        #    if last_candle['hiddenBearCond'] == 1:\r\n        #        return 'Hidden_Bear'\r\n\r\n        #if current_profit > 0 or current_profit < -0.01:\r\n        #    if last_candle['bearCond'] == 1:\r\n        #        return 'Bear'\r\n\r\n\r\n        return None\r\n    #\"\"\r\n\r\n\r\n\r\n\r\nclass SMAoffset_antipump_div(custom):\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        conditions = []\r\n        dont_buy_conditions = []\r\n\r\n        dont_buy_conditions.append(\r\n            (dataframe['pump_strength'] > self.antipump_threshold.value) &\r\n            (dataframe['bearCond'] < 1) &\r\n            (dataframe['hiddenBearCond'] < 1)\r\n        )\r\n        #\"\"\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n                (dataframe['rsi_fast'] <35)&\r\n                (dataframe['rsi_fast'] >4)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\r\n                (dataframe['EWO'] > self.ewo_high.value) &\r\n                (dataframe['rsi'] < self.rsi_buy.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\r\n            )\r\n        )\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n                (dataframe['rsi_fast'] <35)&\r\n                (dataframe['rsi_fast'] >4)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset_2.value)) &\r\n                (dataframe['EWO'] > self.ewo_high_2.value) &\r\n                (dataframe['rsi'] < self.rsi_buy.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))&\r\n                (dataframe['rsi']<25)\r\n            )\r\n        )\r\n\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['sma_9'] < dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'])&\r\n                (dataframe['rsi_fast'] < 35)&\r\n                (dataframe['rsi_fast'] >4)&\r\n                (dataframe['close'] < (dataframe[f'ma_buy_{self.base_nb_candles_buy.value}'] * self.low_offset.value)) &\r\n                (dataframe['EWO'] < self.ewo_low.value) &\r\n                (dataframe['volume'] > 0)&\r\n                (dataframe['close'] < (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value))\r\n            )\r\n        )\r\n        #\"\"\r\n\r\n        #SMAOffsetProtectOptV1\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['close'] < (dataframe[f'ma_buy2_{self.base_nb_candles_buy2.value}'] * self.low_offset2.value)) &\r\n                (dataframe['EWO'] > self.ewo_high2.value) &\r\n                (dataframe['rsi'] < self.rsi_buy2.value) &\r\n                (dataframe['volume'] > 0)\r\n            )\r\n        )\r\n\r\n        #\"\"\r\n        conditions.append(\r\n            (\r\n                ( (dataframe['bullCond'] > 0) | (dataframe['hiddenBullCond'] > 0) )&\r\n                (dataframe['close'] < (dataframe[f'ma_buy2_{self.base_nb_candles_buy2.value}'] * self.low_offset2.value)) &\r\n                (dataframe['EWO'] < self.ewo_low2.value) &\r\n                (dataframe['volume'] > 0)\r\n            )\r\n        )\r\n        #\"\"\r\n\r\n        if conditions:\r\n            dataframe.loc[\r\n                reduce(lambda x, y: x | y, conditions),\r\n                'buy'\r\n            ]=1\r\n\r\n        if dont_buy_conditions:\r\n            for condition in dont_buy_conditions:\r\n                dataframe.loc[condition, 'buy'] = 0\r\n\r\n        return dataframe\r\n\r\n\r\n\r\n    \"\"\"\r\n    Custom Stoploss\r\n    \"\"\"\r\n    def custom_stoploss_test(self, pair: str, trade: 'Trade', current_time: datetime,\r\n                        current_rate: float, current_profit: float, **kwargs) -> float:\r\n        sl_new = 1\r\n\r\n        if not self.config['runmode'].value in ('backtest', 'hyperopt'):\r\n            dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n            if(len(dataframe) >= 1):\r\n                last_candle = dataframe.iloc[-1]\r\n                if((last_candle['sell_copy'] == 1) & (last_candle['buy_copy'] == 0)):\r\n                    sl_new = 0.001\r\n\r\n        return sl_new\r\n\r\n\r\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float:\r\n\r\n        trade_dur = int((current_time.timestamp() - trade.open_date_utc.timestamp()) // 60)\r\n\r\n        if self.config['runmode'].value in ('live', 'dry_run'):\r\n            dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe)\r\n            sroc = dataframe['sroc'].iat[-1]\r\n        # If in backtest or hyperopt, get the indicator values out of the trades dict (Thanks @JoeSchr!)\r\n        else:\r\n            sroc = self.custom_trade_info[trade.pair]['sroc'].loc[current_time]['sroc']\r\n\r\n        if current_profit < self.cstp_threshold.value:\r\n            if self.cstp_bail_how.value == 'roc' or self.cstp_bail_how.value == 'any':\r\n                # Dynamic bailout based on rate of change\r\n                if (sroc/100) <= self.cstp_bail_roc.value:\r\n                    return 0.001\r\n            if self.cstp_bail_how.value == 'time' or self.cstp_bail_how.value == 'any':\r\n                # Dynamic bailout based on time\r\n                if trade_dur > self.cstp_bail_time.value:\r\n                    return 0.001\r\n\r\n        return 1\r\n\r\ndef valuewhen(dataframe, condition, source, occurrence):\r\n    copy = dataframe.copy()\r\n    copy['colFromIndex'] = copy.index\r\n    copy = copy.sort_values(by=[condition, 'colFromIndex'], ascending=False).reset_index(drop=True)\r\n    copy['valuewhen'] = np.where(copy[condition] > 0, copy[source].shift(-occurrence), 100)\r\n    copy['valuewhen'] = copy['valuewhen'].fillna(100)\r\n    copy['barrsince'] = copy['colFromIndex'] - copy['colFromIndex'].shift(-occurrence)\r\n    copy.loc[\r\n        (\r\n            (rangeLower <= copy['barrsince']) &\r\n            (copy['barrsince']  <= rangeUpper)\r\n        )\r\n    , \"in_range\"] = 1\r\n    copy['in_range'] = copy['in_range'].fillna(0)\r\n    copy = copy.sort_values(by=['colFromIndex'], ascending=True).reset_index(drop=True)\r\n    return copy['valuewhen'], copy['in_range']\r\n\r\ndef EWO(dataframe, ema_length=5, ema2_length=35):\r\n    df = dataframe.copy()\r\n    ema1 = ta.EMA(df, timeperiod=ema_length)\r\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\r\n    emadif = (ema1 - ema2) / df['close'] * 100\r\n    return emadif\r\n\r\ndef RMI(dataframe, *, length=20, mom=5):\r\n    df = dataframe.copy()\r\n\r\n    df['maxup'] = (df['close'] - df['close'].shift(mom)).clip(lower=0)\r\n    df['maxdown'] = (df['close'].shift(mom) - df['close']).clip(lower=0)\r\n\r\n    df.fillna(0, inplace=True)\r\n\r\n    df[\"emaInc\"] = ta.EMA(df, price='maxup', timeperiod=length)\r\n    df[\"emaDec\"] = ta.EMA(df, price='maxdown', timeperiod=length)\r\n\r\n    df['RMI'] = np.where(df['emaDec'] == 0, 0, 100 - 100 / (1 + df[\"emaInc\"] / df[\"emaDec\"]))\r\n\r\n    return df[\"RMI\"]\r\n\r\ndef SROC(dataframe, roclen=21, emalen=13, smooth=21):\r\n    df = dataframe.copy()\r\n\r\n    roc = ta.ROC(df, timeperiod=roclen)\r\n    ema = ta.EMA(df, timeperiod=emalen)\r\n    sroc = ta.ROC(ema, timeperiod=smooth)\r\n\r\n    return sroc\r\n"
  },
  {
    "path": "strategies/custom_sell/custom_sell.py",
    "content": "# --- Do not remove these libs ---\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nfrom datetime import datetime, timedelta, timezone\r\n\r\nfrom functools import reduce\r\nfrom freqtrade.strategy import CategoricalParameter, DecimalParameter, IntParameter\r\n#from technical.indicators import vwma, Rmi, WTO, IIIX, PMAX, vwmacd\r\n\r\nimport numpy as np\r\nimport sys\r\n# --------------------------------\r\nimport talib.abstract as ta\r\n#from freqtrade.strategy.interface import IStrategy\r\nfrom freqtrade.strategy import IStrategy, merge_informative_pair, informative\r\nfrom pandas import DataFrame, Series, DatetimeIndex, merge, to_numeric\r\nfrom freqtrade.persistence import Trade\r\nfrom freqtrade.exchange import timeframe_to_prev_date\r\nimport pandas as pd\r\n\r\nfrom warnings import simplefilter\r\nsimplefilter(action=\"ignore\", category=pd.errors.PerformanceWarning)\r\n\r\nimport arrow\r\nfrom freqtrade.exchange import timeframe_to_minutes\r\nimport time\r\n\r\nclass custom_sell(IStrategy):\r\n    custom_info = {}\r\n\r\n    buy_signal_buy6 = CategoricalParameter([True, False], default=True, space=\"buy\", optimize=False)\r\n\r\n    order_types = {\r\n        \"buy\": 'limit',\r\n        \"sell\": 'market',\r\n        \"stoploss\": 'market',\r\n        \"stoploss_on_exchange\": True,\r\n        \"stoploss_on_exchange_interval\": 60,\r\n        \"stoploss_on_exchange_limit_ratio\": 0.99,\r\n    }\r\n\r\n\r\n    protections = [\r\n    {\r\n        \"method\": \"StoplossGuard\",\r\n        \"lookback_period_candles\": 300,\r\n        \"trade_limit\": 2,\r\n        \"stop_duration_candles\": 300,\r\n        \"only_per_pair\": \"true\"\r\n    },\r\n    {\r\n        \"method\": \"LowProfitPairs\",\r\n        \"lookback_period_candles\": 24,\r\n        \"trade_limit\": 1,\r\n        \"stop_duration\": 300,\r\n        \"required_profit\": 0.001\r\n    },\r\n    {\r\n        \"method\": \"CooldownPeriod\",\r\n        \"stop_duration_candles\": 2\r\n    },\r\n    {\r\n        \"method\": \"MaxDrawdown\",\r\n        \"lookback_period_candles\": 96,\r\n        \"trade_limit\": 5,\r\n        \"stop_duration_candles\": 48,\r\n        \"max_allowed_drawdown\": 0.2\r\n    }\r\n    ]\r\n\r\n    # ROI table:\r\n    minimal_roi = {\r\n        \"0\": 0.034,\r\n        \"35\": 0.024,\r\n        \"92\": 0.011,\r\n        \"170\": 0\r\n    }\r\n\r\n    # Trailing stop:\r\n    trailing_stop = False\r\n    trailing_stop_positive = 0.098\r\n    trailing_stop_positive_offset = 0.193\r\n    trailing_only_offset_is_reached = True\r\n\r\n    # Stoploss:\r\n    stoploss = -0.347\r\n\r\n    timeframe = '5m'\r\n    startup_candle_count = 450\r\n    process_only_new_candles = True\r\n\r\n    use_sell_signal = True\r\n    sell_profit_only = False\r\n    ignore_roi_if_buy_signal = False\r\n\r\n    # Custom stoploss\r\n    use_custom_stoploss = False\r\n\r\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\r\n                    current_profit: float, **kwargs):\r\n\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n        last_candle = dataframe.iloc[-1].squeeze()\r\n\r\n        if trade.buy_tag:\r\n           buy_tag = trade.buy_tag\r\n\r\n        if buy_tag == 'buy6':\r\n\r\n           if current_profit > 0:\r\n              #print(\"selling \" + str(current_profit))\r\n              return 'plus0percent' + '_' + buy_tag\r\n           elif current_profit < 0:\r\n              #print(\"selling \" + str(current_profit))\r\n              return 'minus0percent' + '_' + buy_tag\r\n\r\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\r\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\r\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\r\n        #last_candle = dataframe.iloc[-1].squeeze()\r\n\r\n\r\n        if (sell_reason == 'roi') & (trade.buy_tag == \"buy6\"):\r\n            #print(\"REJECTED: \" + trade.buy_tag + \"/\" + sell_reason)\r\n            return False\r\n\r\n        #print(\"SOLD: \" + trade.buy_tag + \"/\" + sell_reason)\r\n        return True\r\n\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\r\n\r\n        return dataframe\r\n\r\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # Informative\r\n        if not self.dp:\r\n            # Don't do anything if DataProvider is not available.\r\n            return dataframe\r\n\r\n        # Keltner\r\n        keltner = qtpylib.keltner_channel(dataframe, window=17, atrs=2)\r\n        dataframe['keltner_lower'] = keltner['lower']\r\n        dataframe['keltner_middle'] = keltner['mid']\r\n        dataframe['keltner_upper'] = keltner['upper']\r\n        return dataframe\r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        # BUY6\r\n        if (self.buy_signal_buy6.value):\r\n          dataframe.loc[\r\n           (\r\n             (\r\n               (dataframe['close'] > dataframe['keltner_middle'])\r\n             )\r\n           ),\r\n           ['buy', 'buy_tag']] = (1, 'buy6')\r\n\r\n\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe.loc[:, 'sell'] = 0\r\n        return dataframe"
  },
  {
    "path": "strategies/e6v34/e6v34.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import RealParameter, IntParameter\nfrom functools import reduce\nfrom pandas import DataFrame\n\n\n\nshma = 15 #short hull moving average\nlhma = 35 #long hull moving average\n\n# shma_c = 10 #short hull moving average de cierre\n# lhma_c = 25 #long hull moving average de cierre\n\npwill = 12 #period williams r\npvol = 100 #period pvt\n# pmv = 50 #period ema williams r\n\nclass e6v34(IStrategy):\n\n    bwill = RealParameter(-25, -15, default=-20, space='buy')\n    swill = RealParameter(-55, -35, default=-50, space='sell')\n\n    # bwill = -20 #buy williams r\n    # swill = -50 #sell williams r\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.555,\n        \"300\": 0.35,\n        \"500\": 0.247,\n        \"1200\": 0.0936,\n        \"2100\": 0.04,\n        \"4000\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.54\n\n    # Trailing stop:\n    trailing_stop = True\n    trailing_stop_positive = 0.18\n    trailing_stop_positive_offset = 0.20\n    trailing_only_offset_is_reached = True\n\n    # Optimal timeframe use it in your config\n    timeframe = '15m'\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # SMA - ex Moving Average\n        dataframe[f'hma{shma}'] = qtpylib.hma(dataframe['close'], window=shma)\n        dataframe[f'hma{lhma}'] = qtpylib.hma(dataframe['close'], window=lhma)\n        # dataframe[f'hma{shma_c}'] = qtpylib.hma(dataframe['close'], window=shma_c)\n        # dataframe[f'hma{lhma_c}'] = qtpylib.hma(dataframe['close'], window=lhma_c)\n        dataframe['willr'] = ta.WILLR(dataframe['high'], dataframe['low'],dataframe['close'], timeperiod=pwill)\n        # dataframe['will_mean'] = ta.EMA(dataframe, timeperiod=pmv, price='willr')\n        dataframe['vol_mean'] = ta.EMA(dataframe, timeperiod=pvol, price='volume')\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n        conditions.append(dataframe[f'hma{shma}'].shift(1) - dataframe[f'hma{lhma}'].shift(1) < dataframe[f'hma{shma}'] - dataframe[f'hma{lhma}'])\n        conditions.append(dataframe[f'hma{shma}'].shift(2) - dataframe[f'hma{lhma}'].shift(2) < dataframe[f'hma{shma}'].shift(1)  - dataframe[f'hma{lhma}'].shift(1) )\n\n        conditions.append(dataframe['willr'] > self.bwill.value)\n        conditions.append(dataframe['willr'].shift(1) < self.bwill.value)\n        # conditions.append(dataframe['will_mean'] > -50)\n\n        conditions.append(dataframe['volume'] > dataframe['vol_mean'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x,y: x&y, conditions),\n                'buy']=1\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                # ( (dataframe[f'hma{lhma_c}'] > dataframe[f'hma{shma_c}']) &\n                # (dataframe[f'hma{lhma_c}'].shift(1) < dataframe[f'hma{shma_c}'].shift(1)) ) |\n\n                (dataframe['willr'] < self.swill.value) &\n                (dataframe['willr'].shift(1) > self.swill.value)\n            ),\n            'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/ema/ema.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport datetime\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np# noqa\n\n\nclass ema(IStrategy):\n\n    max_open_trades = 10\n    stake_amount = 50\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -1\n\n    minimal_roi = {\n        \"0\": 10\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.1\n    trailing_stop_positive_offset = 0.2\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        dataframe['ema6'] = ta.EMA(dataframe, timeperiod=9)\n        dataframe['ema24'] = ta.EMA(dataframe, timeperiod=18)\n\n        dataframe['ema11'] = ta.EMA(dataframe, timeperiod=32)\n        dataframe['ema25'] = ta.EMA(dataframe, timeperiod=64)\n\n        dataframe['ema'] =dataframe['ema6']-dataframe['ema24']\n        dataframe['ema2'] = dataframe['ema11'] - dataframe['ema25']\n\n        dataframe['ema']= dataframe['ema']*0.6 + dataframe['ema2']*0.5\n        dataframe['ema2'] = ta.SMA(dataframe['ema'], timeperiod=29)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n\n        dataframe.loc[\n            (\n            (qtpylib.crossed_above(dataframe['ema'],dataframe['ema2']))\n            ),'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[(qtpylib.crossed_below(dataframe['ema'], dataframe['ema2'])),'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/epretrace/epretrace.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy.hyper import CategoricalParameter, DecimalParameter, IntParameter\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\nfrom freqtrade.persistence import Trade\nfrom datetime import datetime, date, timedelta\nfrom technical.indicators import ichimoku, chaikin_money_flow\nfrom freqtrade.exchange import timeframe_to_prev_date\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass epretrace(IStrategy):\n    \"\"\"\n\n    author@: ??\n\n    idea:\n        this strategy is based on the link here:\n\n        https://github.com/freqtrade/freqtrade-strategies/issues/95\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # adjust based on market conditions. We would recommend to keep it low for quick turn arounds\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        #\"14400\": 0.001,    # non loosing after 10 days\n        #\"0\": 0.\n        \"0\": 1000\n    }\n\n    # Stoploss -disable\n    stoploss = -0.999\n    #stoploss = -0.05\n    use_custom_stoploss = True\n    # Trailing stoploss\n    #trailing_stop = True\n    #trailing_only_offset_is_reached = True\n    #trailing_stop_positive = 0.015\n    #trailing_stop_positive_offset = 0.02\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\t\n    #buy params\n    ep_retracement_window = IntParameter(1, 100, default=50, space='buy')\n    #ep_window = IntParameter(1, 100, default=50, space='buy')\n    ep_retracement = DecimalParameter(\n        0, 1, decimals=2, default=0.95, space='buy')\n    ep_retracement2 = DecimalParameter(\n        0, 1, decimals=2, default=0.75, space='buy')\n    #epma1 = IntParameter(2, 210, default=50, space='buy')\n    #epma2 = IntParameter(2, 210, default=200, space='buy')\n    #epma1 = 50\n    #epma2 = 200\n    epcat1 = CategoricalParameter(['open', 'high', 'low', 'close',\n                                          #  'ma_fast', 'ma_slow', {...}\n                                          ], default='close', space='buy')\n    #sell params\n    ep_target = DecimalParameter(\n        0, 1, decimals=2, default=0.31, space='sell')\n    ep_stop = DecimalParameter(\n        0, 1, decimals=2, default=0.21, space='sell')\n    #ep_retracement_window = 35\n    #ep_retracement = 0.90\n    #ep_window = 3\n    #ep_target = 0.3\n    #ep_stop = 0.2\n    # buy params\n    \"\"\"epwindow = IntParameter(2, 100, default=7, space='buy')\n    #buy_fast_ma_timeframe = IntParameter(2, 100, default=14, space='buy')\n    #buy_slow_ma_timeframe = IntParameter(2, 100, default=28, space='buy')\n    eptarg = DecimalParameter(\n        0, 4, decimals=4, default=2.25446, space='sell')\n    epstop = DecimalParameter(\n        0, 4, decimals=4, default=0.29497, space='sell')\n    epcat1 = CategoricalParameter(['open', 'high', 'low', 'close', 'volume',\n                                          #  'ma_fast', 'ma_slow', {...}\n                                          ], default='close', space='buy')\n    epcat2 = CategoricalParameter(['open', 'high', 'low', 'close', 'volume',\n                                          #  'ma_fast', 'ma_slow', {...}\n                                          ], default='close', space='buy')\n    epma1 = IntParameter(2, 100, default=25, space='buy')\n    epma2 = IntParameter(2, 100, default=50, space='buy')\n    epma3 = IntParameter(2, 100, default=100, space='buy')\n    epma4 = IntParameter(2, 100, default=100, space='buy')\n    epma5 = IntParameter(2, 100, default=100, space='buy')\n    epma6 = IntParameter(2, 100, default=100, space='sell')\n    # sell params\n    #sell_mojo_ma_timeframe = IntParameter(2, 100, default=7, space='sell')\n    #sell_fast_ma_timeframe = IntParameter(2, 100, default=14, space='sell')\n    #sell_slow_ma_timeframe = IntParameter(2, 100, default=28, space='sell')\n    #sell_div_max = DecimalParameter(\n    #    0, 2, decimals=4, default=1.54593, space='sell')\n    #sell_div_min = DecimalParameter(\n    #    0, 2, decimals=4, default=2.81436, space='sell')\n    \"\"\"\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        # Indicators\n        #macd = ta.MACD(dataframe)\n        #dataframe['ema25'] = ta.EMA(dataframe, timeperiod=25)\n        #dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n        #dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        #dataframe['epma1'] = ta.EMA(dataframe,\n        #                                 timeperiod=self.epma1)\n        #dataframe['epma2'] = ta.EMA(dataframe,\n        #                                 timeperiod=self.epma2)\n        #dataframe['epm3'] = ta.EMA(dataframe,\n        #                                 timeperiod=self.epma3.value)\n        #dataframe['epm4'] = ta.EMA(dataframe,\n        #                                 timeperiod=self.epma4.value)\n        #dataframe['epm5'] = ta.EMA(dataframe,\n        #                                 timeperiod=self.epma5.value)\n        #dataframe['epm6'] = ta.EMA(dataframe,\n        #                                 timeperiod=self.epma6.value)\n        #dataframe['macd'] = macd['macd']\n        #dataframe['macdsignal'] = macd['macdsignal']\n        #dataframe['macdhist'] = macd['macdhist']\n        #result = chaikin_money_flow(testdata_1m_btc, 14)\n        #dataframe['cmf'] = chaikin_money_flow(dataframe)\n        #dataframe['cci'] = ta.CCI(dataframe)\n        #dataframe['eplow'] = dataframe['open'].rolling(2).min()\n        #dataframe['eplow'] = dataframe['eplow'].fillna(1000000)\n        #dataframe['target'] = dataframe['close'] + (dataframe[\"close\"] - dataframe[\"eplow\"]) * 1.5\n        #data_frame[self.value] = pd.rolling_min(data_frame[self.data], self.period)\n        \n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        #Buy if last 5 candles show a strong downtrend (linear regression angle) and close is inferior to the 25 candle linear regression line - 1 * ATR (over 25 candles)\n        dataframe.loc[\n            (\n                #(dataframe['epm1'].rolling(self.epwindow.value).min() > dataframe['epm2'].rolling(self.epwindow.value).max()) &\n                #(dataframe['epm2'].rolling(self.epwindow.value).min() > dataframe['epm3'].rolling(self.epwindow.value).max()) &\n                #(dataframe[self.epcat1.value].rolling(self.epwindow.value).min() > dataframe['epm4'].rolling(self.epwindow.value).max()) &\n                #(dataframe['close'].rolling(6).min() > dataframe['ema50'].rolling(6).max()) &\n                #(dataframe['epma1'] > dataframe['epma1'].shift(1).rolling(self.ep_window.value).max()) &\n                #(dataframe['epma1'] > dataframe['epma2']) &\n                (dataframe[self.epcat1.value] < (dataframe[self.epcat1.value].shift(1).rolling(self.ep_retracement_window.value).max())* self.ep_retracement.value) &\n                (dataframe[self.epcat1.value] > (dataframe[self.epcat1.value].shift(1).rolling(self.ep_retracement_window.value).max())* self.ep_retracement2.value) &\n                #qtpylib.crossed_above(dataframe[self.epcat2.value], dataframe['epm5']) &\n                #qtpylib.crossed_above(dataframe['ema25'], dataframe['ema50']) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Sell if RSI is greater than 31 and close is superior to the 25 candle linear regression line\n        dataframe.loc[\n            (\n                (dataframe['close'] > 1000000) &\n                #qtpylib.crossed_below(dataframe['close'], dataframe['ema25']) &\n                #(dataframe['senkou_a'] > dataframe['senkou_b']) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n                \n        # Obtain pair dataframe.\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n        # Look up trade candle.\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n        \n        if not trade_candle.empty:\n            #base_line = trade_candle['eplow'].iloc[0]\n            #base_line = trade_candle['ema50'].iloc[0]\n            #base_line = base_line + 0.5 \n            #open_price = trade_candle['open'].iloc[0]\n            #set_stoploss = (open_price / base_line) - 1.01\n            #set_stoploss = trade.open_rate - (trade.open_rate) * self.epstop.value\n            set_stoploss = trade.open_rate - (trade.open_rate) * self.ep_stop.value\n            if current_rate - set_stoploss <= 0.001:\n                #print (\"current_rate:\",current_rate)\n                #print (\"base_line:\",base_line)\n                #print (\"sub:\",current_rate - base_line)\n                return -0.000001\n              \n            #print (\"current_rate:\",current_rate)\n            #print (\"base_line:\",base_line)\n            \n        return 1\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n                \n        # Obtain pair dataframe.\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        trade_date = timeframe_to_prev_date(self.timeframe, trade.open_date_utc)\n        # Look up trade candle.\n        trade_candle = dataframe.loc[dataframe['date'] == trade_date]\n        \n        if not trade_candle.empty:\n            #epstoploss = trade_candle['eplow'].iloc[0]\n            #epstoploss = trade_candle['epm6'].iloc[0]\n            #open_price = trade_candle['open'].iloc[0]\n            #eptarget = trade.open_rate + (trade.open_rate - epstoploss) * 1.5\n            #eptarget = trade.open_rate + (trade.open_rate) * self.eptarg.value\n            eptarget = trade.open_rate + (trade.open_rate) * self.ep_target.value\n            #print (\"Target:\",eptarget)\n            #print (\"epstoploss:\",epstoploss)\n            #print (\"Price de abertura:\",trade.open_rate)\n            if current_rate >= eptarget: #Let prices stabilize before setting\n                #print (\"Atingiu a meta:\",current_rate)\n                #print (\"Price de abertura:\",trade.open_rate)\n                #print (\"epstoploss:\",epstoploss)\n                return 'sell_ep2mas'\n\n            \n        return 0 \n"
  },
  {
    "path": "strategies/fahmibah/fahmibah.py",
    "content": "from typing import Optional\nfrom functools import reduce\nfrom typing import List\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport pandas as pd\nimport pandas_ta as pta\nimport talib.abstract as ta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom freqtrade.strategy import merge_informative_pair, DecimalParameter, stoploss_from_open, RealParameter, IntParameter, BooleanParameter\nfrom pandas import DataFrame, Series\nfrom datetime import datetime, timedelta, timezone\n\n\ndef bollinger_bands(stock_price, window_size, num_of_std):\n    rolling_mean = stock_price.rolling(window=window_size).mean()\n    rolling_std = stock_price.rolling(window=window_size).std()\n    lower_band = rolling_mean - (rolling_std * num_of_std)\n    return np.nan_to_num(rolling_mean), np.nan_to_num(lower_band)\n\n\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\n\nclass fahmibah(IStrategy):\n    \"\"\"\n    PASTE OUTPUT FROM HYPEROPT HERE\n    Can be overridden for specific sub-strategies (stake currencies) at the bottom.\n    \"\"\"\n    \n    # hypered params\n    buy_params = {\n        \"clucha_enabled\": True,\n        \"bbdelta_close\": 0.01889,\n        \"bbdelta_tail\": 0.72235,\n        \"close_bblower\": 0.0127,\n        \"closedelta_close\": 0.00916,\n        \"rocr_1h\": 0.79492,\n        \"lambo1_enabled\": True,\n        \"lambo1_ema_14_factor\": 1.054,\n        \"lambo1_rsi_4_limit\": 18,\n        \"lambo1_rsi_14_limit\": 39,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        # custom stoploss params, come from BB_RPB_TSL\n        \"pHSL\": -0.10,\n        \"pPF_1\": 0.02,\n        \"pPF_2\": 0.03,\n        \"pSL_1\": 0.015,\n        \"pSL_2\": 0.025,\n\n        # sell signal params\n        'sell_fisher': 0.39075,\n        'sell_bbmiddle_close': 0.99754\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.033,\n        \"10\": 0.023,\n        \"40\": 0.01,\n    }\n\n    # Stoploss:\n    stoploss = -0.10  # use custom stoploss\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.001\n    trailing_stop_positive_offset = 0.012\n    trailing_only_offset_is_reached = False\n\n    \"\"\"\n    END HYPEROPT\n    \"\"\"\n\n    timeframe = '5m'\n\n    # Make sure these match or are not overridden in config\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Custom stoploss\n    use_custom_stoploss = True\n\n    process_only_new_candles = True\n    startup_candle_count = 168\n\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'emergencysell': 'limit',\n        'forcebuy': \"limit\",\n        'forcesell': 'limit',\n        'stoploss': 'limit',\n        'stoploss_on_exchange': False,\n\n        'stoploss_on_exchange_interval': 60,\n        'stoploss_on_exchange_limit_ratio': 0.99\n    }\n\n    # buy params ClucHA\n    clucha_enabled = BooleanParameter(default=buy_params['clucha_enabled'], space='buy', optimize=False)\n    rocr_1h = DecimalParameter(0.5, 1.0, default=0.54904, space='buy', decimals=5, optimize=False)\n    bbdelta_close = DecimalParameter(0.0005, 0.02, default=0.01965, space='buy', decimals=5, optimize=False)\n    closedelta_close = DecimalParameter(0.0005, 0.02, default=0.00556, space='buy', decimals=5, optimize=False)\n    bbdelta_tail = DecimalParameter(0.7, 1.0, default=0.95089, space='buy', decimals=5, optimize=False)\n    close_bblower = DecimalParameter(0.0005, 0.02, default=0.00799, space='buy', decimals=5, optimize=False)\n\n    # buy params lambo1\n    lambo1_enabled = BooleanParameter(default=buy_params['lambo1_enabled'], space='buy', optimize=False)\n    lambo1_ema_14_factor = DecimalParameter(0.5, 2.0, default=1.054, space='buy', decimals=3, optimize=True)\n    lambo1_rsi_4_limit = IntParameter(0, 50, default=buy_params['lambo1_rsi_4_limit'], space='buy', optimize=True)\n    lambo1_rsi_14_limit = IntParameter(0, 50, default=buy_params['lambo1_rsi_14_limit'], space='buy', optimize=True)\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.500, -0.040, default=-0.08, decimals=3, space='sell', load=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True)\n\n    def informative_pairs(self):\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        return informative_pairs\n\n    # come from BB_RPB_TSL\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if current_profit > PF_2:\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif current_profit > PF_1:\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if sl_profit >= current_profit:\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # # Heikin Ashi Candles\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        # Set Up Bollinger Bands\n        mid, lower = bollinger_bands(ha_typical_price(dataframe), window_size=40, num_of_std=2)\n        dataframe['lower'] = lower\n        dataframe['mid'] = mid\n\n        # Clucha\n\n        dataframe['bbdelta'] = (mid - dataframe['lower']).abs()\n        dataframe['closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n\n        dataframe['bb_lowerband'] = dataframe['lower']\n        dataframe['bb_middleband'] = dataframe['mid']\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # lambo1\n        dataframe['ema_14'] = ta.EMA(dataframe['ha_close'], timeperiod=14)\n        dataframe['rsi_4'] = ta.RSI(dataframe['ha_close'], timeperiod=4)\n        dataframe['rsi_14'] = ta.RSI(dataframe['ha_close'], timeperiod=14)\n\n        inf_tf = '1h'\n\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n\n        inf_heikinashi = qtpylib.heikinashi(informative)\n\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        lambo1 = (\n            bool(self.lambo1_enabled.value) &\n            (dataframe['ha_close'] < (dataframe['ema_14'] * self.lambo1_ema_14_factor.value)) &\n            (dataframe['rsi_4'] < self.lambo1_rsi_4_limit.value) &\n            (dataframe['rsi_14'] < self.lambo1_rsi_14_limit.value)\n        )\n        dataframe.loc[lambo1, 'buy_tag'] += 'lambo1_'\n        conditions.append(lambo1)\n\n        clucHA = (\n            bool(self.clucha_enabled.value) &\n            (dataframe['rocr_1h'].gt(self.rocr_1h.value)) &\n            ((\n                     (dataframe['lower'].shift().gt(0)) &\n                     (dataframe['bbdelta'].gt(dataframe['ha_close'] * self.bbdelta_close.value)) &\n                     (dataframe['closedelta'].gt(dataframe['ha_close'] * self.closedelta_close.value)) &\n                     (dataframe['tail'].lt(dataframe['bbdelta'] * self.bbdelta_tail.value)) &\n                     (dataframe['ha_close'].lt(dataframe['lower'].shift())) &\n                     (dataframe['ha_close'].le(dataframe['ha_close'].shift()))\n             ) |\n             (\n                     (dataframe['ha_close'] < dataframe['ema_slow']) &\n                     (dataframe['ha_close'] < self.close_bblower.value * dataframe['bb_lowerband'])\n             ))\n        )\n        dataframe.loc[clucHA, 'buy_tag'] += 'clucHA_'\n        conditions.append(clucHA)\n\n        dataframe.loc[\n            reduce(lambda x, y: x | y, conditions),\n            'buy'\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[(), 'sell'] = 1\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        trade.sell_reason = sell_reason + \"_\" + trade.buy_tag\n\n        return True\n"
  },
  {
    "path": "strategies/flawless_lambo/flawless_lambo.py",
    "content": "import logging\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom sqlalchemy.orm.base import RELATED_OBJECT_OK\nfrom sqlalchemy.sql.elements import or_\nimport talib.abstract as ta\nimport pandas_ta as pta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.exchange import timeframe_to_minutes\nfrom freqtrade.persistence import Trade\nfrom technical import indicators\nfrom datetime import datetime, timezone\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter, RealParameter,\n                                IStrategy, IntParameter, merge_informative_pair)\n\n\nclass flawless_lambo(IStrategy):\n\n    # Add some logging\n    logger = logging.getLogger(__name__)\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    @property\n    def protections(self):\n        return [\n            {\n                \"method\": \"MaxDrawdown\",\n                \"lookback_period\": 360,\n                \"trade_limit\": 1,\n                \"stop_duration\": 720,\n                \"max_allowed_drawdown\": 0.05\n            },\n            {\n                \"method\": \"StoplossGuard\",\n                \"lookback_period\": 4320,\n                \"trade_limit\": 1,\n                \"stop_duration\": 10080,\n                \"only_per_pair\": True\n            },\n            {\n                \"method\": \"LowProfitPairs\",\n                \"lookback_period\": 1440,\n                \"trade_limit\": 1,\n                \"stop_duration\": 1440,\n                \"required_profit\": 0.003\n            }\n        ]\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    # ROI1 table:\n    \n    minimal_roi = {\n            \"120\": 0.30135315985130107,\n            \"125\": 0.29907620817843866,\n            \"130\": 0.2967992565055762,\n            \"135\": 0.29452230483271374,\n            \"140\": 0.2922453531598513,\n            \"145\": 0.2899684014869888,\n            \"150\": 0.28769144981412637,\n            \"155\": 0.2854144981412639,\n            \"160\": 0.2831375464684015,\n            \"165\": 0.28086059479553904,\n            \"170\": 0.2785836431226766,\n            \"175\": 0.2763066914498141,\n            \"180\": 0.27402973977695166,\n            \"185\": 0.2717527881040892,\n            \"190\": 0.26947583643122675,\n            \"195\": 0.2671988847583643,\n            \"200\": 0.2649219330855018,\n            \"205\": 0.26264498141263937,\n            \"210\": 0.2603680297397769,\n            \"215\": 0.25809107806691445,\n            \"220\": 0.25581412639405204,\n            \"225\": 0.2535371747211896,\n            \"230\": 0.2512602230483271,\n            \"235\": 0.2489832713754647,\n            \"240\": 0.2467063197026022,\n            \"245\": 0.24442936802973975,\n            \"250\": 0.2421524163568773,\n            \"255\": 0.23987546468401488,\n            \"260\": 0.2375985130111524,\n            \"265\": 0.23532156133828996,\n            \"270\": 0.2330446096654275,\n            \"275\": 0.23076765799256505,\n            \"280\": 0.2284907063197026,\n            \"285\": 0.22621375464684013,\n            \"290\": 0.22393680297397767,\n            \"295\": 0.22165985130111523,\n            \"300\": 0.2193828996282528,\n            \"305\": 0.21710594795539032,\n            \"310\": 0.21482899628252783,\n            \"315\": 0.2125520446096654,\n            \"320\": 0.21027509293680297,\n            \"325\": 0.2079981412639405,\n            \"330\": 0.20572118959107805,\n            \"335\": 0.2034442379182156,\n            \"340\": 0.20116728624535313,\n            \"345\": 0.1988903345724907,\n            \"350\": 0.19661338289962824,\n            \"355\": 0.19433643122676575,\n            \"360\": 0.19205947955390332,\n            \"365\": 0.18978252788104089,\n            \"370\": 0.18750557620817845,\n            \"375\": 0.18522862453531597,\n            \"380\": 0.1829516728624535,\n            \"385\": 0.18067472118959105,\n            \"390\": 0.17839776951672862,\n            \"395\": 0.17612081784386616,\n            \"400\": 0.1738438661710037,\n            \"405\": 0.17156691449814124,\n            \"410\": 0.16928996282527878,\n            \"415\": 0.16701301115241635,\n            \"420\": 0.1647360594795539,\n            \"425\": 0.16245910780669143,\n            \"430\": 0.16018215613382897,\n            \"435\": 0.15790520446096654,\n            \"440\": 0.15562825278810408,\n            \"445\": 0.15335130111524162,\n            \"450\": 0.15107434944237916,\n            \"455\": 0.1487973977695167,\n            \"460\": 0.14652044609665427,\n            \"465\": 0.1442434944237918,\n            \"470\": 0.14196654275092935,\n            \"475\": 0.1396895910780669,\n            \"480\": 0.13741263940520443,\n            \"485\": 0.135135687732342,\n            \"490\": 0.13285873605947954,\n            \"495\": 0.13058178438661708,\n            \"500\": 0.12830483271375462,\n            \"505\": 0.1260278810408922,\n            \"510\": 0.12375092936802971,\n            \"515\": 0.12147397769516728,\n            \"520\": 0.1191970260223048,\n            \"525\": 0.11692007434944236,\n            \"530\": 0.11464312267657992,\n            \"535\": 0.11236617100371746,\n            \"540\": 0.11079597315436242,\n            \"545\": 0.11028590604026846,\n            \"550\": 0.1097758389261745,\n            \"555\": 0.10926577181208054,\n            \"560\": 0.10875570469798658,\n            \"565\": 0.10824563758389262,\n            \"570\": 0.10773557046979866,\n            \"575\": 0.1072255033557047,\n            \"580\": 0.10671543624161074,\n            \"585\": 0.10620536912751678,\n            \"590\": 0.10569530201342282,\n            \"595\": 0.10518523489932886,\n            \"600\": 0.1046751677852349,\n            \"605\": 0.10416510067114094,\n            \"610\": 0.103655033557047,\n            \"615\": 0.10314496644295304,\n            \"620\": 0.10263489932885908,\n            \"625\": 0.10212483221476512,\n            \"630\": 0.10161476510067116,\n            \"635\": 0.1011046979865772,\n            \"640\": 0.10059463087248324,\n            \"645\": 0.10008456375838928,\n            \"650\": 0.0995744966442953,\n            \"655\": 0.09906442953020134,\n            \"660\": 0.09855436241610738,\n            \"665\": 0.09804429530201342,\n            \"670\": 0.09753422818791946,\n            \"675\": 0.0970241610738255,\n            \"680\": 0.09651409395973154,\n            \"685\": 0.09600402684563758,\n            \"690\": 0.09549395973154362,\n            \"695\": 0.09498389261744966,\n            \"700\": 0.0944738255033557,\n            \"705\": 0.09396375838926174,\n            \"710\": 0.09345369127516778,\n            \"715\": 0.09294362416107382,\n            \"720\": 0.09243355704697986,\n            \"725\": 0.0919234899328859,\n            \"730\": 0.09141342281879196,\n            \"735\": 0.090903355704698,\n            \"740\": 0.09039328859060404,\n            \"745\": 0.08988322147651007,\n            \"750\": 0.08937315436241611,\n            \"755\": 0.08886308724832215,\n            \"760\": 0.08835302013422819,\n            \"765\": 0.08784295302013423,\n            \"770\": 0.08733288590604027,\n            \"775\": 0.08682281879194631,\n            \"780\": 0.08631275167785235,\n            \"785\": 0.08580268456375839,\n            \"790\": 0.08529261744966443,\n            \"795\": 0.08478255033557047,\n            \"800\": 0.08427248322147651,\n            \"805\": 0.08376241610738255,\n            \"810\": 0.0832523489932886,\n            \"815\": 0.08274228187919463,\n            \"820\": 0.08223221476510068,\n            \"825\": 0.08172214765100672,\n            \"830\": 0.08121208053691276,\n            \"835\": 0.0807020134228188,\n            \"840\": 0.08019194630872484,\n            \"845\": 0.07968187919463088,\n            \"850\": 0.07917181208053692,\n            \"855\": 0.07866174496644296,\n            \"860\": 0.078151677852349,\n            \"865\": 0.07764161073825504,\n            \"870\": 0.07713154362416108,\n            \"875\": 0.07662147651006712,\n            \"880\": 0.07611140939597316,\n            \"885\": 0.0756013422818792,\n            \"890\": 0.07509127516778524,\n            \"895\": 0.07458120805369128,\n            \"900\": 0.07407114093959732,\n            \"905\": 0.07356107382550336,\n            \"910\": 0.0730510067114094,\n            \"915\": 0.07254093959731545,\n            \"920\": 0.07203087248322149,\n            \"925\": 0.07152080536912753,\n            \"930\": 0.07101073825503357,\n            \"935\": 0.07050067114093961,\n            \"940\": 0.06999060402684565,\n            \"945\": 0.06948053691275169,\n            \"950\": 0.06897046979865773,\n            \"955\": 0.06846040268456377,\n            \"960\": 0.06795033557046981,\n            \"965\": 0.06744026845637585,\n            \"970\": 0.06693020134228189,\n            \"975\": 0.06642013422818793,\n            \"980\": 0.06591006711409397,\n            \"985\": 0.06540000000000001,\n            \"990\": 0.06488993288590604,\n            \"995\": 0.06437986577181208,\n            \"1000\": 0.06386979865771812,\n            \"1005\": 0.06335973154362416,\n            \"1010\": 0.0628496644295302,\n            \"1015\": 0.06233959731543624,\n            \"1020\": 0.06182953020134229,\n            \"1025\": 0.06131946308724832,\n            \"1030\": 0.060809395973154365,\n            \"1035\": 0.060299328859060405,\n            \"1040\": 0.059789261744966446,\n            \"1045\": 0.059279194630872487,\n            \"1050\": 0.05876912751677853,\n            \"1055\": 0.05825906040268457,\n            \"1060\": 0.05774899328859061,\n            \"1065\": 0.05723892617449665,\n            \"1070\": 0.05672885906040269,\n            \"1075\": 0.05621879194630873,\n            \"1080\": 0.05570872483221477,\n            \"1085\": 0.05519865771812081,\n            \"1090\": 0.05468859060402685,\n            \"1095\": 0.05417852348993289,\n            \"1100\": 0.05366845637583893,\n            \"1105\": 0.05315838926174497,\n            \"1110\": 0.052648322147651014,\n            \"1115\": 0.05213825503355705,\n            \"1120\": 0.05162818791946309,\n            \"1125\": 0.05111812080536913,\n            \"1130\": 0.05060805369127517,\n            \"1135\": 0.05009798657718121,\n            \"1140\": 0.04958791946308725,\n            \"1145\": 0.04907785234899329,\n            \"1150\": 0.04856778523489933,\n            \"1155\": 0.04805771812080538,\n            \"1160\": 0.04754765100671142,\n            \"1165\": 0.04703758389261746,\n            \"1170\": 0.0465275167785235,\n            \"1175\": 0.04601744966442954,\n            \"1180\": 0.04550738255033557,\n            \"1185\": 0.04499731543624161,\n            \"1190\": 0.04448724832214765,\n            \"1195\": 0.04397718120805369,\n            \"1200\": 0.04346711409395973,\n            \"1205\": 0.04295704697986577,\n            \"1210\": 0.04244697986577181,\n            \"1215\": 0.04193691275167785,\n            \"1220\": 0.04142684563758389,\n            \"1225\": 0.04091677852348993,\n            \"1230\": 0.04040671140939597,\n            \"1235\": 0.039896644295302014,\n            \"1240\": 0.039386577181208055,\n            \"1245\": 0.038876510067114095,\n            \"1250\": 0.038366442953020136,\n            \"1255\": 0.037856375838926176,\n            \"1260\": 0.03734630872483222,\n            \"1265\": 0.03683624161073826,\n            \"1270\": 0.0363261744966443,\n            \"1275\": 0.03581610738255034,\n            \"1280\": 0.03530604026845638,\n            \"1285\": 0.03497163695299838,\n            \"1290\": 0.03490072933549433,\n            \"1295\": 0.03482982171799028,\n            \"1300\": 0.034758914100486225,\n            \"1305\": 0.034688006482982175,\n            \"1310\": 0.034617098865478126,\n            \"1315\": 0.03454619124797407,\n            \"1320\": 0.03447528363047002,\n            \"1325\": 0.03440437601296597,\n            \"1330\": 0.03433346839546192,\n            \"1335\": 0.03426256077795786,\n            \"1340\": 0.03419165316045381,\n            \"1345\": 0.03412074554294976,\n            \"1350\": 0.034049837925445706,\n            \"1355\": 0.033978930307941656,\n            \"1360\": 0.033908022690437606,\n            \"1365\": 0.033837115072933556,\n            \"1370\": 0.0337662074554295,\n            \"1375\": 0.03369529983792545,\n            \"1380\": 0.0336243922204214,\n            \"1385\": 0.03355348460291734,\n            \"1390\": 0.03348257698541329,\n            \"1395\": 0.03341166936790924,\n            \"1400\": 0.03334076175040519,\n            \"1405\": 0.033269854132901136,\n            \"1410\": 0.033198946515397086,\n            \"1415\": 0.033128038897893036,\n            \"1420\": 0.03305713128038898,\n            \"1425\": 0.03298622366288493,\n            \"1430\": 0.03291531604538088,\n            \"1435\": 0.03284440842787682,\n            \"1440\": 0.03277350081037277,\n            \"1445\": 0.03270259319286872,\n            \"1450\": 0.03263168557536467,\n            \"1455\": 0.032560777957860616,\n            \"1460\": 0.032489870340356566,\n            \"1465\": 0.032418962722852517,\n            \"1470\": 0.03234805510534847,\n            \"1475\": 0.03227714748784441,\n            \"1480\": 0.03220623987034036,\n            \"1485\": 0.03213533225283631,\n            \"1490\": 0.03206442463533225,\n            \"1495\": 0.0319935170178282,\n            \"1500\": 0.03192260940032415,\n            \"1505\": 0.031851701782820104,\n            \"1510\": 0.03178079416531605,\n            \"1515\": 0.031709886547812,\n            \"1520\": 0.03163897893030795,\n            \"1525\": 0.03156807131280389,\n            \"1530\": 0.03149716369529984,\n            \"1535\": 0.03142625607779579,\n            \"1540\": 0.03135534846029174,\n            \"1545\": 0.031284440842787684,\n            \"1550\": 0.031213533225283634,\n            \"1555\": 0.03114262560777958,\n            \"1560\": 0.03107171799027553,\n            \"1565\": 0.031000810372771477,\n            \"1570\": 0.030929902755267427,\n            \"1575\": 0.030858995137763377,\n            \"1580\": 0.03078808752025932,\n            \"1585\": 0.03071717990275527,\n            \"1590\": 0.03064627228525122,\n            \"1595\": 0.030575364667747167,\n            \"1600\": 0.03050445705024311,\n            \"1605\": 0.030433549432739064,\n            \"1610\": 0.03036264181523501,\n            \"1615\": 0.030291734197730957,\n            \"1620\": 0.030220826580226907,\n            \"1625\": 0.030149918962722858,\n            \"1630\": 0.030079011345218804,\n            \"1635\": 0.03000810372771475,\n            \"1640\": 0.0299371961102107,\n            \"1645\": 0.029866288492706648,\n            \"1650\": 0.02979538087520259,\n            \"1655\": 0.029724473257698544,\n            \"1660\": 0.029653565640194494,\n            \"1665\": 0.02958265802269044,\n            \"1670\": 0.029511750405186388,\n            \"1675\": 0.029440842787682334,\n            \"1680\": 0.029369935170178284,\n            \"1685\": 0.02929902755267423,\n            \"1690\": 0.02922811993517018,\n            \"1695\": 0.02915721231766613,\n            \"1700\": 0.02908630470016208,\n            \"1705\": 0.029015397082658025,\n            \"1710\": 0.028944489465153975,\n            \"1715\": 0.02887358184764992,\n            \"1720\": 0.028802674230145868,\n            \"1725\": 0.028731766612641815,\n            \"1730\": 0.028660858995137768,\n            \"1735\": 0.028589951377633715,\n            \"1740\": 0.02851904376012966,\n            \"1745\": 0.02844813614262561,\n            \"1750\": 0.02837722852512156,\n            \"1755\": 0.028306320907617505,\n            \"1760\": 0.028235413290113455,\n            \"1765\": 0.028164505672609405,\n            \"1770\": 0.02809359805510535,\n            \"1775\": 0.0280226904376013,\n            \"1780\": 0.02795178282009725,\n            \"1785\": 0.027880875202593195,\n            \"1790\": 0.027809967585089145,\n            \"1795\": 0.027739059967585092,\n            \"1800\": 0.02766815235008104,\n            \"1805\": 0.02759724473257699,\n            \"1810\": 0.027526337115072935,\n            \"1815\": 0.027455429497568885,\n            \"1820\": 0.027384521880064832,\n            \"1825\": 0.02731361426256078,\n            \"1830\": 0.02724270664505673,\n            \"1835\": 0.02717179902755268,\n            \"1840\": 0.027100891410048625,\n            \"1845\": 0.027029983792544572,\n            \"1850\": 0.02695907617504052,\n            \"1855\": 0.02688816855753647,\n            \"1860\": 0.026817260940032416,\n            \"1865\": 0.02674635332252837,\n            \"1870\": 0.026675445705024316,\n            \"1875\": 0.026604538087520262,\n            \"1880\": 0.02653363047001621,\n            \"1885\": 0.02646272285251216,\n            \"1890\": 0.026391815235008102,\n            \"1895\": 0.026320907617504052,\n            \"1900\": 0.02625,\n            \"1905\": 0.026179092382495953,\n            \"1910\": 0.0261081847649919,\n            \"1915\": 0.02603727714748785,\n            \"1920\": 0.025966369529983796,\n            \"1925\": 0.025895461912479743,\n            \"1930\": 0.02582455429497569,\n            \"1935\": 0.02575364667747164,\n            \"1940\": 0.02568273905996759,\n            \"1945\": 0.025611831442463536,\n            \"1950\": 0.025540923824959483,\n            \"1955\": 0.025470016207455433,\n            \"1960\": 0.02539910858995138,\n            \"1965\": 0.02532820097244733,\n            \"1970\": 0.025257293354943276,\n            \"1975\": 0.025186385737439223,\n            \"1980\": 0.025115478119935173,\n            \"1985\": 0.02504457050243112,\n            \"1990\": 0.02497366288492707,\n            \"1995\": 0.024902755267423016,\n            \"2000\": 0.024831847649918963,\n            \"2005\": 0.024760940032414913,\n            \"2010\": 0.024690032414910863,\n            \"2015\": 0.02461912479740681,\n            \"2020\": 0.024548217179902757,\n            \"2025\": 0.024477309562398707,\n            \"2030\": 0.024406401944894653,\n            \"2035\": 0.0243354943273906,\n            \"2040\": 0.02426458670988655,\n            \"2045\": 0.0241936790923825,\n            \"2050\": 0.024122771474878447,\n            \"2055\": 0.024051863857374393,\n            \"2060\": 0.023980956239870344,\n            \"2065\": 0.02391004862236629,\n            \"2070\": 0.023839141004862237,\n            \"2075\": 0.023768233387358187,\n            \"2080\": 0.023697325769854137,\n            \"2085\": 0.023626418152350084,\n            \"2090\": 0.02355551053484603,\n            \"2095\": 0.02348460291734198,\n            \"2100\": 0.023413695299837927,\n            \"2105\": 0.023342787682333874,\n            \"2110\": 0.023271880064829824,\n            \"2115\": 0.023200972447325777,\n            \"2120\": 0.02313006482982172,\n            \"2125\": 0.023059157212317667,\n            \"2130\": 0.022988249594813617,\n            \"2135\": 0.022917341977309564,\n            \"2140\": 0.02284643435980551,\n            \"2145\": 0.02277552674230146,\n            \"2150\": 0.02270461912479741,\n            \"2155\": 0.022633711507293357,\n            \"2160\": 0.022562803889789304,\n            \"2165\": 0.022491896272285258,\n            \"2170\": 0.0224209886547812,\n            \"2175\": 0.022350081037277147,\n            \"2180\": 0.022279173419773098,\n            \"2185\": 0.022208265802269048,\n            \"2190\": 0.02213735818476499,\n            \"2195\": 0.02206645056726094,\n            \"2200\": 0.02199554294975689,\n            \"2205\": 0.02192463533225284,\n            \"2210\": 0.021853727714748784,\n            \"2215\": 0.021782820097244734,\n            \"2220\": 0.021711912479740685,\n            \"2225\": 0.02164100486223663,\n            \"2230\": 0.021570097244732574,\n            \"2235\": 0.021499189627228528,\n            \"2240\": 0.021428282009724475,\n            \"2245\": 0.02135737439222042,\n            \"2250\": 0.02128646677471637,\n            \"2255\": 0.02121555915721232,\n            \"2260\": 0.021144651539708268,\n            \"2265\": 0.021073743922204215,\n            \"2270\": 0.021002836304700165,\n            \"2275\": 0.02093192868719611,\n            \"2280\": 0.020861021069692055,\n            \"2285\": 0.020790113452188008,\n            \"2290\": 0.02071920583468396,\n            \"2295\": 0.020648298217179905,\n            \"2300\": 0.02057739059967585,\n            \"2305\": 0.0205064829821718,\n            \"2310\": 0.020435575364667752,\n            \"2315\": 0.020364667747163695,\n            \"2320\": 0.020293760129659645,\n            \"2325\": 0.020222852512155595,\n            \"2330\": 0.020151944894651545,\n            \"2335\": 0.02008103727714749,\n            \"2340\": 0.02001012965964344,\n            \"2345\": 0.01993922204213939,\n            \"2350\": 0.019868314424635332,\n            \"2355\": 0.01979740680713128,\n            \"2360\": 0.019726499189627232,\n            \"2365\": 0.01965559157212318,\n            \"2370\": 0.019584683954619125,\n            \"2375\": 0.019513776337115075,\n            \"2380\": 0.019442868719611026,\n            \"2385\": 0.019371961102106972,\n            \"2390\": 0.01930105348460292,\n            \"2395\": 0.01923014586709887,\n            \"2400\": 0.019159238249594816,\n            \"2405\": 0.01908833063209076,\n            \"2410\": 0.019017423014586712,\n            \"2415\": 0.01894651539708266,\n            \"2420\": 0.01887560777957861,\n            \"2425\": 0.018804700162074556,\n            \"2430\": 0.018733792544570502,\n            \"2435\": 0.018662884927066452,\n            \"2440\": 0.0185919773095624,\n            \"2445\": 0.01852106969205835,\n            \"2450\": 0.018450162074554296,\n            \"2455\": 0.01837925445705025,\n            \"2460\": 0.018308346839546193,\n            \"2465\": 0.018237439222042143,\n            \"2470\": 0.01816653160453809,\n            \"2475\": 0.018095623987034036,\n            \"2480\": 0.018024716369529983,\n            \"2485\": 0.017953808752025933,\n            \"2490\": 0.017882901134521883,\n            \"2495\": 0.01781199351701783,\n            \"2500\": 0.01774108589951378,\n            \"2505\": 0.017670178282009726,\n            \"2510\": 0.017599270664505673,\n            \"2515\": 0.017528363047001623,\n            \"2520\": 0.01745745542949757,\n            \"2525\": 0.01738654781199352,\n            \"2530\": 0.017315640194489466,\n            \"2535\": 0.017244732576985417,\n            \"2540\": 0.017173824959481363,\n            \"2545\": 0.01710291734197731,\n            \"2550\": 0.01703200972447326,\n            \"2555\": 0.016961102106969207,\n            \"2560\": 0.016890194489465157,\n            \"2565\": 0.016819286871961103,\n            \"2570\": 0.016748379254457053,\n            \"2575\": 0.016677471636953,\n            \"2580\": 0.016606564019448947,\n            \"2585\": 0.016535656401944897,\n            \"2590\": 0.016464748784440843,\n            \"2595\": 0.016393841166936794,\n            \"2600\": 0.01632293354943274,\n            \"2605\": 0.01625202593192869,\n            \"2610\": 0.016181118314424637,\n            \"2615\": 0.016110210696920584,\n            \"2620\": 0.016039303079416534,\n            \"2625\": 0.01596839546191248,\n            \"2630\": 0.01589748784440843,\n            \"2635\": 0.015826580226904377,\n            \"2640\": 0.015755672609400327,\n            \"2645\": 0.015684764991896274,\n            \"2650\": 0.01561385737439222,\n            \"2655\": 0.01554294975688817,\n            \"2660\": 0.015472042139384115,\n            \"2665\": 0.015401134521880067,\n            \"2670\": 0.015330226904376014,\n            \"2675\": 0.015259319286871964,\n            \"2680\": 0.01518841166936791,\n            \"2685\": 0.015117504051863856,\n            \"2690\": 0.015046596434359807,\n            \"2695\": 0.014975688816855754,\n            \"2700\": 0.014904781199351704,\n            \"2705\": 0.01483387358184765,\n            \"2710\": 0.0147629659643436,\n            \"2715\": 0.014692058346839548,\n            \"2720\": 0.014621150729335494,\n            \"2725\": 0.014550243111831444,\n            \"2730\": 0.014479335494327393,\n            \"2735\": 0.01440842787682334,\n            \"2740\": 0.014337520259319288,\n            \"2745\": 0.014266612641815238,\n            \"2750\": 0.014195705024311184,\n            \"2755\": 0.014124797406807133,\n            \"2760\": 0.01405388978930308,\n            \"2765\": 0.013982982171799028,\n            \"2770\": 0.013912074554294978,\n            \"2775\": 0.013841166936790925,\n            \"2780\": 0.013770259319286876,\n            \"2785\": 0.01369935170178282,\n            \"2790\": 0.013628444084278771,\n            \"2795\": 0.013557536466774718,\n            \"2800\": 0.013486628849270665,\n            \"2805\": 0.013415721231766617,\n            \"2810\": 0.01334481361426256,\n            \"2815\": 0.013273905996758512,\n            \"2820\": 0.013202998379254458,\n            \"2825\": 0.013132090761750408,\n            \"2830\": 0.013061183144246357,\n            \"2835\": 0.012990275526742302,\n            \"2840\": 0.012919367909238252,\n            \"2845\": 0.012848460291734198,\n            \"2850\": 0.012777552674230148,\n            \"2855\": 0.012706645056726097,\n            \"2860\": 0.012635737439222043,\n            \"2865\": 0.012564829821717992,\n            \"2870\": 0.012493922204213938,\n            \"2875\": 0.012423014586709889,\n            \"2880\": 0.012352106969205835,\n            \"2885\": 0.012281199351701784,\n            \"2890\": 0.012210291734197732,\n            \"2895\": 0.012139384116693682,\n            \"2900\": 0.012068476499189629,\n            \"2905\": 0.011997568881685575,\n            \"2910\": 0.011926661264181524,\n            \"2915\": 0.011855753646677472,\n            \"2920\": 0.011784846029173422,\n            \"2925\": 0.011713938411669369,\n            \"2930\": 0.01164303079416532,\n            \"2935\": 0.011572123176661266,\n            \"2940\": 0.011501215559157212,\n            \"2945\": 0.011430307941653162,\n            \"2950\": 0.011359400324149107,\n            \"2955\": 0.01128849270664506,\n            \"2960\": 0.011217585089141006,\n            \"2965\": 0.011146677471636956,\n            \"2970\": 0.011075769854132902,\n            \"2975\": 0.011004862236628847,\n            \"2980\": 0.0109339546191248,\n            \"2985\": 0.010863047001620746,\n            \"2990\": 0.010792139384116696,\n            \"2995\": 0.010721231766612644,\n            \"3000\": 0.010650324149108593,\n            \"3005\": 0.01057941653160454,\n            \"3010\": 0.010508508914100486,\n            \"3015\": 0.010437601296596436,\n            \"3020\": 0.010366693679092384,\n            \"3025\": 0.010295786061588331,\n            \"3030\": 0.01022487844408428,\n            \"3035\": 0.01015397082658023,\n            \"3040\": 0.010083063209076176,\n            \"3045\": 0.010012155591572125,\n            \"3050\": 0.009941247974068071,\n            \"3055\": 0.00987034035656402,\n            \"3060\": 0.00979943273905997,\n            \"3065\": 0.009728525121555916,\n            \"3070\": 0.009657617504051868,\n            \"3075\": 0.009586709886547811,\n            \"3080\": 0.00951580226904376,\n            \"3085\": 0.00944489465153971,\n            \"3090\": 0.009373987034035657,\n            \"3095\": 0.009303079416531608,\n            \"3100\": 0.009232171799027552,\n            \"3105\": 0.009161264181523503,\n            \"3110\": 0.00909035656401945,\n            \"3115\": 0.009019448946515397,\n            \"3120\": 0.008948541329011347,\n            \"3125\": 0.008877633711507293,\n            \"3130\": 0.008806726094003244,\n            \"3135\": 0.00873581847649919,\n            \"3140\": 0.00866491085899514,\n            \"3145\": 0.008594003241491087,\n            \"3150\": 0.008523095623987034,\n            \"3155\": 0.008452188006482984,\n            \"3160\": 0.00838128038897893,\n            \"3165\": 0.00831037277147488,\n            \"3170\": 0.008239465153970827,\n            \"3175\": 0.008168557536466777,\n            \"3180\": 0.008097649918962724,\n            \"3185\": 0.00802674230145867,\n            \"3190\": 0.00795583468395462,\n            \"3195\": 0.007884927066450567,\n            \"3200\": 0.007814019448946517,\n            \"3205\": 0.007743111831442464,\n            \"3210\": 0.007672204213938414,\n            \"3215\": 0.007601296596434361,\n            \"3220\": 0.007530388978930307,\n            \"3225\": 0.007459481361426257,\n            \"3230\": 0.007388573743922204,\n            \"3235\": 0.007317666126418154,\n            \"3240\": 0.007246758508914101,\n            \"3245\": 0.007175850891410051,\n            \"3250\": 0.0071049432739059976,\n            \"3255\": 0.007034035656401944,\n            \"3260\": 0.006963128038897894,\n            \"3265\": 0.006892220421393841,\n            \"3270\": 0.006821312803889791,\n            \"3275\": 0.006750405186385738,\n            \"3280\": 0.006679497568881688,\n            \"3285\": 0.0066085899513776344,\n            \"3290\": 0.006537682333873581,\n            \"3295\": 0.006466774716369531,\n            \"3300\": 0.006395867098865478,\n            \"3305\": 0.006324959481361428,\n            \"3310\": 0.006254051863857375,\n            \"3315\": 0.006183144246353325,\n            \"3320\": 0.006112236628849271,\n            \"3325\": 0.006041329011345218,\n            \"3330\": 0.005970421393841168,\n            \"3335\": 0.005899513776337115,\n            \"3340\": 0.005828606158833065,\n            \"3345\": 0.0057576985413290115,\n            \"3350\": 0.005686790923824962,\n            \"3355\": 0.005615883306320908,\n            \"3360\": 0.005544975688816855,\n            \"3365\": 0.005474068071312805,\n            \"3370\": 0.005403160453808752,\n            \"3375\": 0.005332252836304702,\n            \"3380\": 0.005261345218800648,\n            \"3385\": 0.0051904376012965985,\n            \"3390\": 0.005119529983792545,\n            \"3395\": 0.005048622366288495,\n            \"3400\": 0.004977714748784442,\n            \"3405\": 0.0049068071312803885,\n            \"3410\": 0.004835899513776339,\n            \"3415\": 0.004764991896272285,\n            \"3420\": 0.004694084278768235,\n            \"3425\": 0.004623176661264182,\n            \"3430\": 0.004552269043760132,\n            \"3435\": 0.004481361426256079,\n            \"3440\": 0.004410453808752025,\n            \"3445\": 0.0043395461912479755,\n            \"3450\": 0.004268638573743922,\n            \"3455\": 0.004197730956239872,\n            \"3460\": 0.004126823338735819,\n            \"3465\": 0.004055915721231769,\n            \"3470\": 0.003985008103727716,\n            \"3475\": 0.003914100486223662,\n            \"3480\": 0.003843192868719613,\n            \"3485\": 0.003772285251215559,\n            \"3490\": 0.0037013776337115056,\n            \"3495\": 0.003630470016207456,\n            \"3500\": 0.003559562398703406,\n            \"3505\": 0.003488654781199349,\n            \"3510\": 0.003417747163695299,\n            \"3515\": 0.0033468395461912492,\n            \"3520\": 0.0032759319286871993,\n            \"3525\": 0.0032050243111831425,\n            \"3530\": 0.0031341166936790926,\n            \"3535\": 0.0030632090761750427,\n            \"3540\": 0.002992301458670986,\n            \"3545\": 0.002921393841166936,\n            \"3550\": 0.002850486223662886,\n            \"3555\": 0.002779578606158836,\n            \"3560\": 0.0027086709886547794,\n            \"3565\": 0.0026377633711507295,\n            \"3570\": 0.0025668557536466796,\n            \"3575\": 0.002495948136142623,\n            \"3580\": 0.002425040518638573,\n            \"3585\": 0.002354132901134523,\n            \"3590\": 0.002283225283630473,\n            \"3595\": 0.0022123176661264163,\n            \"3600\": 0.0021414100486223664,\n            \"3605\": 0.0020705024311183165,\n            \"3610\": 0.0019995948136142597,\n            \"3615\": 0.0019286871961102096,\n            \"3620\": 0.00185777957860616,\n            \"3625\": 0.00178687196110211,\n            \"3630\": 0.0017159643435980532,\n            \"3635\": 0.0016450567260940033,\n            \"3640\": 0.0015741491085899534,\n            \"3645\": 0.0015032414910858966,\n            \"3650\": 0.0014323338735818469,\n            \"3655\": 0.0013614262560777968,\n            \"3660\": 0.0012905186385737469,\n            \"3665\": 0.00121961102106969,\n            \"3670\": 0.0011487034035656402,\n            \"3675\": 0.0010777957860615905,\n            \"3680\": 0.0010068881685575334,\n            \"3685\": 0.0009359805510534837,\n            \"3690\": 0.0008650729335494337,\n            \"3695\": 0.0007941653160453838,\n            \"3700\": 0.0007232576985413269,\n            \"3705\": 0.000652350081037277,\n            \"3710\": 0.0005814424635332271,\n            \"3715\": 0.0005105348460291703,\n            \"3720\": 0.0004396272285251204,\n            \"3725\": 0.00036871961102107054,\n            \"3730\": 0.00029781199351702065,\n            \"3735\": 0.00022690437601296384,\n            \"3740\": 0.00015599675850891392,\n            \"3745\": 8.508914100486403e-05,\n            \"3750\": 1.4181523500814142e-05,\n            \"3755\": 0,\n            \"3900\": -0.01,\n            \"3960\": -0.02,\n            \"4020\": -0.03\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    # use_custom_stoploss = True\n    stoploss = -1 #-0.10\n\n    # Trailing stop:\n    trailing_stop = False\n    trailing_stop_positive = 0.006\n    trailing_stop_positive_offset = 0.019\n    trailing_only_offset_is_reached = False\n    process_only_new_candles = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30 #30\n\n    # Optimal timeframe for the strategy.\n    timeframe = '15m'\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    # sell_profit_offset = 0.019\n    ignore_roi_if_buy_signal = False\n\n\n    # hyperopt params\n    sell_rsi = DecimalParameter(60, 100, default=70)\n    sell_williams = DecimalParameter(-30, 0, default=-10)\n\n    # trailing sell (borrowed from UziChanTB2)\n    custom_info_trail_sell = dict()\n    trailing_sell_order_enabled = True    \n    # trailing_expire_seconds = 1800      #NOTE 5m timeframe\n    # trailing_expire_seconds = 1800/5    #NOTE 1m timeframe\n    trailing_expire_seconds = 1800*3    #NOTE 15m timeframe\n    # trailing_expire_seconds = 1800*6\n    trailing_sell_uptrend_enabled = True    \n    trailing_expire_seconds_uptrend = 300\n    min_uptrend_trailing_profit = 0.02\n    debug_mode = True\n    trailing_sell_max_stop = 0.01   # stop trailing sell if current_price < starting_price * (1+trailing_buy_max_stop)\n    trailing_sell_max_sell = 0.000  # sell if price between downlimit (=max of serie (current_price * (1 + trailing_sell_offset())) and (start_price * 1+trailing_sell_max_sell))\n    abort_trailing_when_sell_signal_triggered = False\n\n    \n    init_trailing_sell_dict = {\n        'trailing_sell_order_started': False,\n        'trailing_sell_order_downlimit': 0,        \n        'start_trailing_sell_price': 0,\n        'sell_tag': None,\n        'start_trailing_time': None,\n        'offset': 0,\n        'allow_sell_trailing': False,\n    }\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    @property\n    def plot_config(self):\n        return {\n            \"main_plot\": {\n                \"bb.lower\": {\n                    \"color\": \"#9c6edc\",\n                    \"type\": \"line\"\n                },\n                \"bb.upper\": {\n                    \"color\": \"#9c6edc\",\n                    \"type\": \"line\"\n                },\n                \"vwma\": {\n                    \"color\": \"#4f9f02\",\n                    \"type\": \"line\"\n                }\n            },\n            \"subplots\": {\n                \"obv\": {\n                    \"OBV\": {\n                        \"color\": \"#1b61ab\",\n                        \"type\": \"line\"\n                    },\n                    \"OBVSlope\": {\n                        \"color\": \"#f18b7a\",\n                        \"type\": \"line\"\n                    }\n                },\n                \"vpci\": {\n                    \"vpci\": {\n                        \"color\": \"#d59a7a\",\n                        \"type\": \"line\"\n                    }\n                },\n                \"macd\": {\n                    \"macd\": {\n                        \"color\": \"#1c3d6a\",\n                        \"type\": \"line\"\n                    },\n                    \"macdsignal\": {\n                        \"color\": \"#873480\",\n                        \"type\": \"line\"\n                    },\n                    \"macdhist\": {\n                        \"color\": \"#478a87\",\n                        \"type\": \"bar\"\n                    }\n                },\n                \"wiliams\": {\n                    \"williamspercent\": {\n                        \"color\": \"#10f551\",\n                        \"type\": \"line\"\n                    }\n                },\n                \"stoch + rsi\": {\n                    \"rsi\": {\n                        \"color\": \"#d7affd\",\n                        \"type\": \"line\"\n                    },\n                    \"slowd\": {\n                        \"color\": \"#d7cc5c\",\n                        \"type\": \"line\"\n                    },\n                    \"fastk\": {\n                        \"color\": \"#186f86\",\n                        \"type\": \"line\"\n                    }\n                },\n                \"adx\": {\n                    \"adx\": {\n                        \"color\": \"#c392cd\",\n                        \"type\": \"line\"\n                    },\n                    \"plus.di\": {\n                        \"color\": \"#bcd6c5\",\n                        \"type\": \"line\"\n                    },\n                    \"plus.di.slope\": {\n                            \"color\": \"#ffffff\",\n                            \"type\": \"line\"\n                    },\n                    \"minus.di\": {\n                        \"color\": \"#eb044c\",\n                        \"type\": \"line\"\n                    }\n                }\n            }\n        }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, self.timeframe) for pair in pairs]\n\n        return informative_pairs\n\n    def trailing_sell(self, pair, reinit=False):\n        # returns trailing sell info for pair (init if necessary)\n        if not pair in self.custom_info_trail_sell:\n            self.custom_info_trail_sell[pair] = dict()\n        if (reinit or not 'trailing_sell' in self.custom_info_trail_sell[pair]):\n            self.custom_info_trail_sell[pair]['trailing_sell'] = self.init_trailing_sell_dict.copy()\n        \n        return self.custom_info_trail_sell[pair]['trailing_sell']\n\n    def trailing_sell_info(self, pair: str, current_price: float):\n        # current_time live, dry run\n        current_time = datetime.now(timezone.utc)\n        if not self.debug_mode:\n            return\n        trailing_sell = self.trailing_sell(pair)\n\n        duration = 0\n        try:\n            duration = (current_time - trailing_sell['start_trailing_time'])\n        except TypeError:\n            duration = 0\n        finally:\n            self.logger.info(\"'\\033[36m'SELL: \"\n                f\"pair: {pair} : \"\n                f\"start: {trailing_sell['start_trailing_sell_price']:.4f}, \"\n                f\"duration: {duration}, \"\n                f\"current: {current_price:.4f}, \"\n                f\"downlimit: {trailing_sell['trailing_sell_order_downlimit']:.4f}, \"\n                f\"profit: {self.current_trailing_sell_profit_ratio(pair, current_price)*100:.2f}%, \"\n                f\"offset: {trailing_sell['offset']}\")\n\n    def current_trailing_sell_profit_ratio(self, pair: str, current_price: float) -> float:\n        trailing_sell = self.trailing_sell(pair)\n        if trailing_sell['trailing_sell_order_started']:\n            return (current_price - trailing_sell['start_trailing_sell_price'])/ trailing_sell['start_trailing_sell_price']\n            #return 0-((trailing_sell['start_trailing_sell_price'] - current_price) / trailing_sell['start_trailing_sell_price'])\n        else:\n            return 0\n    \n    def trailing_sell_offset(self, dataframe, pair: str, current_price: float):\n        current_trailing_sell_profit_ratio = self.current_trailing_sell_profit_ratio(pair, current_price)\n        last_candle = dataframe.iloc[-1]\n        adapt  = (last_candle['perc_norm']).round(5)\n        default_offset = 0.003 * (1 + adapt)        #NOTE: default_offset 0.003 <--> 0.006\n        \n        trailing_sell  = self.trailing_sell(pair)\n        if not trailing_sell['trailing_sell_order_started']:\n            return default_offset\n\n        # example with duration and indicators\n        # dry run, live only\n        last_candle = dataframe.iloc[-1]\n        current_time = datetime.now(timezone.utc)\n        trailing_duration =  current_time - trailing_sell['start_trailing_time']\n        if trailing_duration.total_seconds() > self.trailing_expire_seconds:\n            if ((current_trailing_sell_profit_ratio > 0) and (last_candle['sell'] != 0)):\n                # more than 1h, price over first signal, sell signal still active -> sell\n                return 'forcesell'\n            else:\n                # wait for next signal\n                return None\n        elif (self.trailing_sell_uptrend_enabled and (trailing_duration.total_seconds() < self.trailing_expire_seconds_uptrend) and (current_trailing_sell_profit_ratio < (-1 * self.min_uptrend_trailing_profit))):\n            # less than 90s and price is falling, sell \n            return 'forcesell'\n\n        if current_trailing_sell_profit_ratio > 0:\n            # current price is lower than initial price\n            return default_offset\n\n        trailing_sell_offset = {\n            # 0.06: 0.02,\n            # 0.03: 0.01,\n            0.1: default_offset,\n        }\n\n        for key in trailing_sell_offset:\n            if current_trailing_sell_profit_ratio < key:\n                return trailing_sell_offset[key]\n\n        return default_offset\n\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \n        # first check if dataprovider is available\n        # if self.dp:\n        #    if self.dp.runmode.value in ('live', 'dry_run'):\n        #        ob = self.dp.orderbook(metadata['pair'], 1)\n        #        dataframe['best_bid'] = ob['bids'][0][0]\n        #        dataframe['best_ask'] = ob['asks'][0][0]\n\n\n        # Bollinger!\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb.lower'] = bollinger['lower']\n        dataframe['bb.middle'] = bollinger['mid']\n        dataframe['bb.upper'] = bollinger['upper']\n\n        # Added PCB Style OBV\n        dataframe['OBV'] = ta.OBV(dataframe)\n        dataframe['OBVSlope'] = pta.momentum.slope(dataframe['OBV'])\n\n        # VWMA\n        # vwma_period = 13\n        # dataframe['vwma'] = ((dataframe[\"close\"] * dataframe[\"volume\"]).rolling(vwma_period).sum() / \n                    # dataframe['volume'].rolling(vwma_period).sum())\n        \n        # VWAP\n        # vwap_period = 20\n        # dataframe['vwap'] = qtpylib.rolling_vwap(dataframe, window=vwap_period)\n        \n        # VPCI\n        dataframe['vpci'] = indicators.vpci(dataframe, period_long=14)\n        \n        #williamsR\n        dataframe['williamspercent'] = indicators.williams_percent(dataframe)\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['plus.di'] = ta.PLUS_DI(dataframe)\n        dataframe['minus.di'] = ta.MINUS_DI(dataframe)\n        dataframe['plus.di.slope'] = pta.momentum.slope(dataframe['plus.di'])\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n\n        # Stochastic Slow\n        stoch_slow = ta.STOCH(dataframe)\n        dataframe['slowd'] = stoch_slow['slowd']\n        dataframe['slowk'] = stoch_slow['slowk']\n\n        # Perc\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\n        dataframe['perc_norm'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max() - dataframe['perc'].rolling(50).min())\n\n        self.trailing_sell(metadata['pair'])\n\n        return dataframe\n\n\n    def do_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Bollinger!\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb.lower'] = bollinger['lower']\n        dataframe['bb.middle'] = bollinger['mid']\n        dataframe['bb.upper'] = bollinger['upper']\n\n        # Added PCB Style OBV\n        dataframe['OBV'] = ta.OBV(dataframe)\n        dataframe['OBVSlope'] = pta.momentum.slope(dataframe['OBV'])\n        \n\n        # VWMA\n        # vwma_period = 13\n        # dataframe['vwma'] = ((dataframe[\"close\"] * dataframe[\"volume\"]).rolling(vwma_period).sum() / \n                    # dataframe['volume'].rolling(vwma_period).sum())\n\n        # VWAP\n        # vwap_period = 20\n        # dataframe['vwap'] = qtpylib.rolling_vwap(dataframe, window=vwap_period)\n                \n        # VPCI\n        dataframe['vpci'] = indicators.vpci(dataframe, period_long=14)\n\n        #williamsR\n        dataframe['williamspercent'] = indicators.williams_percent(dataframe)\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['plus.di'] = ta.PLUS_DI(dataframe)\n        dataframe['minus.di'] = ta.MINUS_DI(dataframe)\n        dataframe['plus.di.slope'] = pta.momentum.slope(dataframe['plus.di'])\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # Stochastic Slow\n        stoch_slow = ta.STOCH(dataframe)\n        dataframe['slowd'] = stoch_slow['slowd']\n        dataframe['slowk'] = stoch_slow['slowk']\n\n        # Perc\n        dataframe['perc'] = ((dataframe['high'] - dataframe['low']) / dataframe['low']*100)\n        dataframe['avg3_perc'] = ta.EMA(dataframe['perc'], 3)\n        dataframe['perc_norm'] = (dataframe['perc'] - dataframe['perc'].rolling(50).min())/(dataframe['perc'].rolling(50).max()-dataframe['perc'].rolling(50).min())\n\n        self.trailing_sell(metadata['pair'])\n\n        return dataframe\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:\n        val = super().confirm_trade_exit(pair, trade, order_type, amount, rate, time_in_force, sell_reason, **kwargs)        \n        \n        if val:\n            if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'):\n                val = False\n                dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n                if(len(dataframe) >= 1):\n                    last_candle = dataframe.iloc[-1].squeeze()\n                    current_price = rate\n                    trailing_sell= self.trailing_sell(pair)\n                    trailing_sell_offset = self.trailing_sell_offset(dataframe, pair, current_price)\n\n                    if trailing_sell['allow_sell_trailing']:\n                        if (not trailing_sell['trailing_sell_order_started'] and (last_candle['sell'] != 0)):\n                            trailing_sell['trailing_sell_order_started'] = True\n                            trailing_sell['trailing_sell_order_downlimit'] = last_candle['close']\n                            trailing_sell['start_trailing_sell_price'] = last_candle['close']\n                            trailing_sell['sell_tag'] = last_candle['sell_tag']\n                            trailing_sell['start_trailing_time'] = datetime.now(timezone.utc)\n                            trailing_sell['offset'] = 0\n                            \n                            self.trailing_sell_info(pair, current_price)\n                            self.logger.info(f'start trailing sell for {pair} at {last_candle[\"close\"]}')\n\n                        elif trailing_sell['trailing_sell_order_started']:\n                            if trailing_sell_offset == 'forcesell':\n                                # sell in custom conditions\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                self.logger.info(f\"FORCESELL for {pair} ({ratio} %, {current_price})\")\n\n                            elif trailing_sell_offset is None:\n                                # stop trailing sell custom conditions\n                                self.trailing_sell(pair, reinit=True)\n                                self.logger.info(f'STOP trailing sell for {pair} because \"trailing sell offset\" returned None')\n\n                            elif current_price > trailing_sell['trailing_sell_order_downlimit']:\n                                # update downlimit\n                                old_downlimit = trailing_sell[\"trailing_sell_order_downlimit\"]\n                                self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'] = max(current_price * (1 - trailing_sell_offset), self.custom_info_trail_sell[pair]['trailing_sell']['trailing_sell_order_downlimit'])\n                                self.custom_info_trail_sell[pair]['trailing_sell']['offset'] = trailing_sell_offset\n                                self.trailing_sell_info(pair, current_price)\n                                self.logger.info(f'update trailing sell for {pair} at {old_downlimit} -> {self.custom_info_trail_sell[pair][\"trailing_sell\"][\"trailing_sell_order_downlimit\"]}')\n\n                            elif current_price > (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_sell)):\n                                # sell! current price < downlimit && higher than starting price\n                                val = True\n                                ratio = \"%.2f\" % ((self.current_trailing_sell_profit_ratio(pair, current_price)) * 100)\n                                self.trailing_sell_info(pair, current_price)\n                                self.logger.info(f\"current price ({current_price}) < downlimit ({trailing_sell['trailing_sell_order_downlimit']}) but higher than starting price ({(trailing_sell['start_trailing_sell_price'] * (1 + self.trailing_sell_max_sell))}). OK for {pair} ({ratio} %)\")\n\n                            elif current_price < (trailing_sell['start_trailing_sell_price'] * (1 - self.trailing_sell_max_stop)):\n                                # stop trailing, sell fast, price too low\n                                val = True                                \n                                self.trailing_sell_info(pair, current_price)\n                                self.logger.info(f'STOP trailing sell for {pair} because of the price is much lower than starting price * {1 + self.trailing_sell_max_stop}')\n                            else:\n                                # uplimit > current_price > max_price, continue trailing and wait for the price to go down\n                                self.trailing_sell_info(pair, current_price)\n                                self.logger.info(f'price too low for {pair} !')\n\n                    else:\n                        self.logger.info(f\"Wait for next sell signal for {pair}\")\n\n                if (val == True):\n                    self.trailing_sell_info(pair, rate)\n                    self.trailing_sell(pair, reinit=True)\n                    self.logger.info(f'STOP trailing sell for {pair} because I SOLD it')\n\n        if sell_reason != 'sell_signal':\n            val = True\n\n        return val\n        \n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n            (dataframe['volume'] > 0) &\n            (dataframe['OBVSlope'] > 0) &\n            (dataframe['plus.di.slope'] > 0) &\n            (dataframe['williamspercent'] < -66) &\n            (qtpylib.crossed_above(dataframe['close'], dataframe['bb.lower']))\n            ),'buy'] = 1\n        \n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['volume'] > 0) &\n                (dataframe['close'] > dataframe['bb.upper']) &\n                (dataframe['plus.di.slope'] < 0) &\n                (dataframe['williamspercent'] >= self.sell_williams.value) &\n                (dataframe['rsi'] >= self.sell_rsi.value)\n            ),\n            'sell'] = 1\n\n        if self.trailing_sell_order_enabled and self.config['runmode'].value in ('live', 'dry_run'): \n            last_candle = dataframe.iloc[-1].squeeze()\n            trailing_sell = self.trailing_sell(metadata['pair'])\n            if (last_candle['sell'] != 0):\n                if not trailing_sell['trailing_sell_order_started']:\n                    open_trades = Trade.get_trades([Trade.pair == metadata['pair'], Trade.is_open.is_(True), ]).all()\n                    if open_trades:\n                        self.logger.info(f\"Set 'allow_SELL_trailing' to True for {metadata['pair']} to start *SELL* trailing\")\n                        # self.custom_info_trail_buy[metadata['pair']]['trailing_buy']['allow_trailing'] = True\n                        trailing_sell['allow_sell_trailing'] = True\n                        initial_sell_tag = last_candle['sell_tag'] if 'sell_tag' in last_candle else 'sell signal'\n                        dataframe.loc[:, 'sell_tag'] = f\"{initial_sell_tag} (start trail price {last_candle['close']})\"\n            else:\n                if (trailing_sell['trailing_sell_order_started'] == True):\n                    self.logger.info(f\"Continue trailing for {metadata['pair']}. Manually trigger sell signal!\")\n                    dataframe.loc[:,'sell'] = 1\n                    dataframe.loc[:, 'sell_tag'] = trailing_sell['sell_tag']\n\n        return dataframe\n\n    \n    # \"All watched over by machines with loving grace...\"\n"
  },
  {
    "path": "strategies/hansencandlepatternV1/hansencandlepatternV1.py",
    "content": "# --- Do not remove these libs --- freqtrade backtesting --strategy SmoothScalp --timerange 20210110-20210410\r\nfrom freqtrade.strategy.interface import IStrategy\r\nfrom typing import Dict, List\r\nfrom functools import reduce\r\nfrom pandas import DataFrame\r\n# --------------------------------\r\nimport talib.abstract as ta\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nfrom typing import Dict, List\r\nfrom functools import reduce\r\nfrom pandas import DataFrame, DatetimeIndex, merge\r\n# --------------------------------\r\nimport talib.abstract as ta\r\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\r\nimport numpy  # noqa\r\n\r\n\r\nclass hansencandlepatternV1(IStrategy):\r\n    \"\"\"\r\n        This strategy is only an experiment using candlestick pattern to be used as buy or sell indicator. Do not use this strategy live.\r\n    \"\"\"\r\n\r\n    timeframe = '1h'\r\n    minimal_roi = {\r\n        \"0\": 10,\r\n    }\r\n    stoploss = -0.1\r\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:   \r\n        dataframe['3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe['open'], dataframe['high'], dataframe['low'], dataframe['close'])\r\n        dataframe['EVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe['open'], dataframe['high'], dataframe['low'], dataframe['close'])\r\n        dataframe['ABANDONEDBABY'] = ta.CDLEVENINGSTAR(dataframe['open'], dataframe['high'], dataframe['low'], dataframe['close'])\r\n        dataframe['HARAMI'] = ta.CDLHARAMI(dataframe['open'], dataframe['high'], dataframe['low'], dataframe['close'])\r\n        dataframe['INVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe['open'], dataframe['high'], dataframe['low'], dataframe['close'])\r\n        dataframe['ENGULFING'] = ta.CDLENGULFING(dataframe['open'], dataframe['high'], dataframe['low'], dataframe['close'])\r\n        dataframe['hclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\r\n        dataframe['hopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2)\r\n        dataframe['hhigh']=dataframe[['open','close','high']].max(axis=1)\r\n        dataframe['hlow']=dataframe[['open','close','low']].min(axis=1)\r\n        dataframe['emac'] = ta.SMA(dataframe['hclose'], timeperiod=6)\r\n        dataframe['emao'] = ta.SMA(dataframe['hopen'], timeperiod=6)\r\n        return dataframe\r\n        \r\n\r\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe.loc[\r\n            (\r\n                ((dataframe['3LINESTRIKE'] < 0)|(dataframe['EVENINGSTAR'] > 0)|(dataframe['ABANDONEDBABY'] > 0)|(dataframe['HARAMI'] > 0)|(dataframe['ENGULFING'] > 0))&\r\n                (dataframe['emao'] < dataframe['emac'])\r\n                \r\n            ),\r\n            'buy'] = 1\r\n        return dataframe\r\n\r\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\r\n        dataframe.loc[\r\n            (\r\n                (dataframe['emao'] > dataframe['emac'])\r\n            ),\r\n            'sell'] = 1\r\n        return dataframe\r\n"
  },
  {
    "path": "strategies/heikin/heikin.py",
    "content": "# --- Do not remove these libs --- freqtrade backtesting --strategy SmoothScalp --timerange 20210110-20210410\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame, DatetimeIndex, merge\n# --------------------------------\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy\n\n#V1\nclass heikin(IStrategy):\n    #do not use this strategy in live mod. It is not good enough yet and can only be use to find trends.\n    timeframe = '1h'\n    #I haven't found the best roi and stoplost, so feel free to explore.\n    minimal_roi = {\n        \"0\": 10,\n    }\n    stoploss = -0.99\n    \n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:   \n        dataframe['hclose']=(dataframe['open'] + dataframe['high'] + dataframe['low'] + dataframe['close']) / 4\n        dataframe['hopen']= ((dataframe['open'].shift(2) + dataframe['close'].shift(2))/ 2) #it is not the same as real heikin ashi since I found that this is better.\n        dataframe['hhigh']=dataframe[['open','close','high']].max(axis=1)\n        dataframe['hlow']=dataframe[['open','close','low']].min(axis=1)\n\n        dataframe['emac'] = ta.SMA(dataframe['hclose'], timeperiod=6) #to smooth out the data and thus less noise.\n        dataframe['emao'] = ta.SMA(dataframe['hopen'], timeperiod=6)\n        return dataframe\n        \n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['emao'] < dataframe['emac'])\n            ),\n            'buy'] = 1\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['emao'] > dataframe['emac'])\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/hlhb/hlhb.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy import IStrategy\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass hlhb(IStrategy):\n    \"\"\"\n    The HLHB (\"Huck loves her bucks!\") System simply aims to catch short-term forex trends.\n    More information in https://www.babypips.com/trading/forex-hlhb-system-explained\n    \"\"\"\n\n    INTERFACE_VERSION = 2\n\n    position_stacking = \"True\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.6225,\n        \"703\": 0.2187,\n        \"2849\": 0.0363,\n        \"5520\": 0\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.3211\n\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_stop_positive = 0.0117\n    trailing_stop_positive_offset = 0.0186\n    trailing_only_offset_is_reached = True\n\n    # Optimal timeframe for the strategy.\n    timeframe = '4h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'ema5': {},\n            'ema10': {},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            },\n            \"ADX\": {\n                'adx': {},\n            }\n        }\n    }\n    \n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['hl2'] = (dataframe[\"close\"] + dataframe[\"open\"]) / 2\n\n        # Momentum Indicators\n        # ------------------------------------\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=10, price='hl2')\n\n        # # EMA - Exponential Moving Average\n        dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['rsi'], 50)) &\n                (qtpylib.crossed_above(dataframe['ema5'], dataframe['ema10'])) &\n                (dataframe['adx'] > 25) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['rsi'], 50)) &\n                (qtpylib.crossed_below(dataframe['ema5'], dataframe['ema10'])) &\n                (dataframe['adx'] > 25) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    \n"
  },
  {
    "path": "strategies/ichiV1/ichiV1.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas as pd  # noqa\npd.options.mode.chained_assignment = None  # default='warn'\nimport technical.indicators as ftt\nfrom functools import reduce\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair\nimport numpy as np\nfrom freqtrade.strategy import stoploss_from_open\n\n\nclass ichiV1(IStrategy):\n\n    # NOTE: settings as of the 25th july 21\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_trend_above_senkou_level\": 1,\n        \"buy_trend_bullish_level\": 6,\n        \"buy_fan_magnitude_shift_value\": 3,\n        \"buy_min_fan_magnitude_gain\": 1.002 # NOTE: Good value (Win% ~70%), alot of trades\n        #\"buy_min_fan_magnitude_gain\": 1.008 # NOTE: Very save value (Win% ~90%), only the biggest moves 1.008,\n    }\n\n    # Sell hyperspace params:\n    # NOTE: was 15m but kept bailing out in dryrun\n    sell_params = {\n        \"sell_trend_indicator\": \"trend_close_2h\",\n    }\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.059,\n        \"10\": 0.037,\n        \"41\": 0.012,\n        \"114\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.275\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n\n    startup_candle_count = 96\n    process_only_new_candles = False\n\n    trailing_stop = False\n    #trailing_stop_positive = 0.002\n    #trailing_stop_positive_offset = 0.025\n    #trailing_only_offset_is_reached = True\n\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    plot_config = {\n        'main_plot': {\n            # fill area between senkou_a and senkou_b\n            'senkou_a': {\n                'color': 'green', #optional\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud', #optional\n                'fill_color': 'rgba(255,76,46,0.2)', #optional\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {},\n            'trend_close_5m': {'color': '#FF5733'},\n            'trend_close_15m': {'color': '#FF8333'},\n            'trend_close_30m': {'color': '#FFB533'},\n            'trend_close_1h': {'color': '#FFE633'},\n            'trend_close_2h': {'color': '#E3FF33'},\n            'trend_close_4h': {'color': '#C4FF33'},\n            'trend_close_6h': {'color': '#61FF33'},\n            'trend_close_8h': {'color': '#33FF7D'}\n        },\n        'subplots': {\n            'fan_magnitude': {\n                'fan_magnitude': {}\n            },\n            'fan_magnitude_gain': {\n                'fan_magnitude_gain': {}\n            }\n        }\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['open'] = heikinashi['open']\n        #dataframe['close'] = heikinashi['close']\n        dataframe['high'] = heikinashi['high']\n        dataframe['low'] = heikinashi['low']\n\n        dataframe['trend_close_5m'] = dataframe['close']\n        dataframe['trend_close_15m'] = ta.EMA(dataframe['close'], timeperiod=3)\n        dataframe['trend_close_30m'] = ta.EMA(dataframe['close'], timeperiod=6)\n        dataframe['trend_close_1h'] = ta.EMA(dataframe['close'], timeperiod=12)\n        dataframe['trend_close_2h'] = ta.EMA(dataframe['close'], timeperiod=24)\n        dataframe['trend_close_4h'] = ta.EMA(dataframe['close'], timeperiod=48)\n        dataframe['trend_close_6h'] = ta.EMA(dataframe['close'], timeperiod=72)\n        dataframe['trend_close_8h'] = ta.EMA(dataframe['close'], timeperiod=96)\n\n        dataframe['trend_open_5m'] = dataframe['open']\n        dataframe['trend_open_15m'] = ta.EMA(dataframe['open'], timeperiod=3)\n        dataframe['trend_open_30m'] = ta.EMA(dataframe['open'], timeperiod=6)\n        dataframe['trend_open_1h'] = ta.EMA(dataframe['open'], timeperiod=12)\n        dataframe['trend_open_2h'] = ta.EMA(dataframe['open'], timeperiod=24)\n        dataframe['trend_open_4h'] = ta.EMA(dataframe['open'], timeperiod=48)\n        dataframe['trend_open_6h'] = ta.EMA(dataframe['open'], timeperiod=72)\n        dataframe['trend_open_8h'] = ta.EMA(dataframe['open'], timeperiod=96)\n\n        dataframe['fan_magnitude'] = (dataframe['trend_close_1h'] / dataframe['trend_close_8h'])\n        dataframe['fan_magnitude_gain'] = dataframe['fan_magnitude'] / dataframe['fan_magnitude'].shift(1)\n\n        ichimoku = ftt.ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green']\n        dataframe['cloud_red'] = ichimoku['cloud_red']\n\n        dataframe['atr'] = ta.ATR(dataframe)\n\n        return dataframe\n\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        # Trending market\n        if self.buy_params['buy_trend_above_senkou_level'] >= 1:\n            conditions.append(dataframe['trend_close_5m'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_5m'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 2:\n            conditions.append(dataframe['trend_close_15m'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_15m'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 3:\n            conditions.append(dataframe['trend_close_30m'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_30m'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 4:\n            conditions.append(dataframe['trend_close_1h'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_1h'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 5:\n            conditions.append(dataframe['trend_close_2h'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_2h'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 6:\n            conditions.append(dataframe['trend_close_4h'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_4h'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 7:\n            conditions.append(dataframe['trend_close_6h'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_6h'] > dataframe['senkou_b'])\n\n        if self.buy_params['buy_trend_above_senkou_level'] >= 8:\n            conditions.append(dataframe['trend_close_8h'] > dataframe['senkou_a'])\n            conditions.append(dataframe['trend_close_8h'] > dataframe['senkou_b'])\n\n        # Trends bullish\n        if self.buy_params['buy_trend_bullish_level'] >= 1:\n            conditions.append(dataframe['trend_close_5m'] > dataframe['trend_open_5m'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 2:\n            conditions.append(dataframe['trend_close_15m'] > dataframe['trend_open_15m'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 3:\n            conditions.append(dataframe['trend_close_30m'] > dataframe['trend_open_30m'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 4:\n            conditions.append(dataframe['trend_close_1h'] > dataframe['trend_open_1h'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 5:\n            conditions.append(dataframe['trend_close_2h'] > dataframe['trend_open_2h'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 6:\n            conditions.append(dataframe['trend_close_4h'] > dataframe['trend_open_4h'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 7:\n            conditions.append(dataframe['trend_close_6h'] > dataframe['trend_open_6h'])\n\n        if self.buy_params['buy_trend_bullish_level'] >= 8:\n            conditions.append(dataframe['trend_close_8h'] > dataframe['trend_open_8h'])\n\n        # Trends magnitude\n        conditions.append(dataframe['fan_magnitude_gain'] >= self.buy_params['buy_min_fan_magnitude_gain'])\n        conditions.append(dataframe['fan_magnitude'] > 1)\n\n        for x in range(self.buy_params['buy_fan_magnitude_shift_value']):\n            conditions.append(dataframe['fan_magnitude'].shift(x+1) < dataframe['fan_magnitude'])\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(qtpylib.crossed_below(dataframe['trend_close_5m'], dataframe[self.sell_params['sell_trend_indicator']]))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n"
  },
  {
    "path": "strategies/ichiV1_Marius/ichiV1_Marius.py",
    "content": "# --- Do not remove these libs ---\nfrom sqlalchemy import true\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series\nimport copy\nimport logging\nimport pathlib\nimport rapidjson\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas as pd  # noqa\npd.options.mode.chained_assignment = None  # default='warn'\nimport technical.indicators as ftt\nfrom freqtrade.exchange import timeframe_to_prev_date\nfrom functools import reduce\nfrom datetime import datetime, timedelta, timezone\nimport numpy as np\nfrom technical.util import resample_to_interval, resampled_merge\nfrom freqtrade.strategy import informative\nfrom freqtrade.strategy import stoploss_from_open\nfrom freqtrade.strategy import (BooleanParameter,timeframe_to_minutes, merge_informative_pair,\n                                DecimalParameter, IntParameter, CategoricalParameter)\nfrom freqtrade.persistence import Trade\nfrom typing import Dict\nimport numpy # noqa\nimport math\nimport pandas_ta as pta\nfrom typing import List\nfrom skopt.space import Dimension, Integer\nimport time\nfrom warnings import simplefilter\n\nfrom technical.indicators import zema\n\nlogger = logging.getLogger(__name__)\n\nsimplefilter(action=\"ignore\", category=pd.errors.PerformanceWarning)\n\n##### SETINGS #####\n# It hyperopt just one set of params for all buy and sell strategies if true.\nDUALFIT = False\nCOUNT = 10\nGAP = 3\n### END SETINGS ###\n\ndef max_pump_detect_price_15m(dataframe, period=14, pause = 288 ):\n    df = dataframe.copy()\n    df['size'] = df['high'] - df['low']\n    cumulativeup = 0\n    countup = 0\n    cumulativedown = 0\n    countdown = 0\n    for i in range(period):\n\n        cumulativeup = cumulativeup + df['volume'].shift(i) * df['size'].shift(i) * np.where(df['close'].shift(i) > df['open'].shift(i), 1, 0)\n        cumulativedown = cumulativedown + df['volume'].shift(i) * df['size'].shift(i) * np.where(df['close'].shift(i) > df['open'].shift(i), 0, 1)\n            \n    flow_price = cumulativeup - cumulativedown\n    flow_price_normalized = flow_price / (df['volume'].rolling(499).mean() * (df['high']-df['low']).rolling(499).mean())\n    max_flow_price = flow_price_normalized.rolling(pause).max()\n    \n    return max_flow_price\n\ndef flow_price_15m(dataframe, period=14, pause = 288 ):\n    df = dataframe.copy()\n    df['size'] = df['high'] - df['low']\n    cumulativeup = 0\n    countup = 0\n    cumulativedown = 0\n    countdown = 0\n    for i in range(period):\n\n        cumulativeup = cumulativeup + df['volume'].shift(i) * df['size'].shift(i) * np.where(df['close'].shift(i) > df['open'].shift(i), 1, 0)\n        cumulativedown = cumulativedown + df['volume'].shift(i) * df['size'].shift(i) * np.where(df['close'].shift(i) > df['open'].shift(i), 0, 1)\n            \n    flow_price = cumulativeup - cumulativedown\n    flow_price_normalized = flow_price / (df['volume'].rolling(499).mean() * (df['high']-df['low']).rolling(499).mean())\n    \n    return flow_price_normalized\n\ndef to_minutes(**timdelta_kwargs):\n    return int(timedelta(**timdelta_kwargs).total_seconds() / 60)\n\n#########################################################\n#######################  ichiV1_Mod #####################\n#########################################################\n      #############################################\nclass ichiV1_Marius(IStrategy):\n\n    class HyperOpt:\n        @staticmethod\n        def generate_roi_table(params: dict):\n            \"\"\"\n            Generate the ROI table that will be used by Hyperopt\n            This implementation generates the default legacy Freqtrade ROI tables.\n            Change it if you need different number of steps in the generated\n            ROI tables or other structure of the ROI tables.\n            Please keep it aligned with parameters in the 'roi' optimization\n            hyperspace defined by the roi_space method.\n            \"\"\"\n            roi_table = {}\n            roi_table[0] = 0.05\n            roi_table[params['roi_t6']] = 0.04\n            roi_table[params['roi_t5']] = 0.03\n            roi_table[params['roi_t4']] = 0.02\n            roi_table[params['roi_t3']] = 0.01\n            roi_table[params['roi_t2']] = 0.0001\n            roi_table[params['roi_t1']] = -10\n\n            return roi_table\n\n        @staticmethod\n        def roi_space() -> List[Dimension]:\n            \"\"\"\n            Values to search for each ROI steps\n            Override it if you need some different ranges for the parameters in the\n            'roi' optimization hyperspace.\n            Please keep it aligned with the implementation of the\n            generate_roi_table method.\n            \"\"\"\n            return [\n                Integer(240, 720, name='roi_t1'),\n                Integer(120, 240, name='roi_t2'),\n                Integer(90, 120, name='roi_t3'),\n                Integer(60, 90, name='roi_t4'),\n                Integer(30, 60, name='roi_t5'),\n                Integer(1, 30, name='roi_t6'),\n            ]\n\n    DATESTAMP = 0\n    SELLMA = 1\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"max_slip\": 0.668,\n        \"antipump_threshold\": 0.265,\n        \"antipump_threshold_2\": 0.133,\n        \"buy_btc_safe_1d\": -0.236,\n        \"buy_btc_safe\": -213,\n        \"buy_threshold\": 0.012,\n        ##\n        \"pump_limit\": 1000,\n        \"pump_pause_duration\": 192,\n        \"pump_period\": 14,\n        \"pump_recorver_price\": 1.1,\n        ##\n        \"buy_trend_above_senkou_level\": 1,\n        \"buy_trend_bullish_level\": 6,\n        \"tesla_enabled\": True,\n       # \"buy_fan_magnitude_shift_value\": 3,\n        \"buy_min_fan_magnitude_gain\": 1.0022, # NOTE: Good value (Win% ~70%), alot of trades\n        #\"buy_min_fan_magnitude_gain\": 1.008 # NOTE: Very save value (Win% ~90%), only the biggest moves 1.008,\n    }\n\n    sell_params = {\n        \"ProfitLoss1\": 0.005,\n        \"ProfitLoss2\": 0.021,\n        \"ProfitMargin1\": 0.018,\n        \"ProfitMargin2\": 0.051,\n        \"pHSL\": -0.08,\n        \"sell_trend_indicator\": \"trend_close_2h\",\n    }\n\n        # minimum conditions to match in buy\n    buy_minimum_conditions = IntParameter(\n        1, 2, default=1, space=\"buy\", optimize=False, load=True\n    )\n\n    position_adjustment_enable = True\n    max_dca_orders = 2\n    max_dca_multiplier = 1.25\n    dca_stake_multiplier = 1.25\n    \n    def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float,\n                            proposed_stake: float, min_stake: float, max_stake: float,\n                            **kwargs) -> float:\n        if (self.config['position_adjustment_enable'] == True) and (self.config['stake_amount'] == 'unlimited'):\n            return self.wallets.get_total_stake_amount() / self.config['max_open_trades'] / self.max_dca_multiplier\n        else:\n            return proposed_stake\n\n    def adjust_trade_position(self, trade: Trade, current_time: datetime,\n                              current_rate: float, current_profit: float, min_stake: float,\n                              max_stake: float, **kwargs):\n        \n        if current_profit > -0.05:\n            return None\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe)\n        last_candle = dataframe.iloc[-1].squeeze()\n        previous_candle = dataframe.iloc[-2].squeeze()\n        if last_candle['close'] < previous_candle['close']:\n            return None\n\n        filled_buys = trade.select_filled_orders('buy')\n        count_of_buys = len(filled_buys)\n\n        if 0 < count_of_buys <= self.max_dca_orders:\n            try:\n                stake_amount = filled_buys[0].cost\n                # This then calculates current safety order size\n                stake_amount = stake_amount * self.dca_stake_multiplier\n                return stake_amount\n            except Exception as exception:\n                return None\n\n        return None\n\n    # Pump protection\n    pump_period = IntParameter(\n        5, 24, default=buy_params['pump_period'], space='buy', optimize=False)\n    pump_limit = IntParameter(\n        100,10000, default=buy_params['pump_limit'], space='buy', optimize=True)\n    pump_recorver_price = DecimalParameter(\n        1.0, 1.3, default=buy_params['pump_recorver_price'], space='buy', optimize=True)\n    pump_pause_duration = IntParameter(\n        6, 500, default=buy_params['pump_pause_duration'], space='buy', optimize=True)\n\n##################################################################    \n    ## Slippage params\n    is_optimize_slip = False\n    max_slip = DecimalParameter(0.33, 0.80, default=0.33, decimals=3, optimize=is_optimize_slip , load=True)\n    buy_btc_safe = IntParameter(-300, 50, default=buy_params['buy_btc_safe'], optimize = True)\n    buy_btc_safe_1d = DecimalParameter(-0.5, -0.015, default=buy_params['buy_btc_safe_1d'], optimize=True)\n    antipump_threshold = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold'], space='buy', optimize=True)\n    antipump_threshold_2 = DecimalParameter(0, 0.4, default=buy_params['antipump_threshold_2'], space='buy', optimize=True)\n\n    buy_min_fan_magnitude_gain = DecimalParameter(70, 90, default=buy_params['buy_min_fan_magnitude_gain'], space='buy', optimize=False, load=True)    # Multi Offset\n    buy_threshold = DecimalParameter(0.003, 0.012, default=buy_params['buy_threshold'], optimize=True)  \n\n#######################################################################\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.215,\n        \"40\": 0.032,\n        \"87\": 0.016,\n        \"201\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.275  # value loaded from strategy\n\n    # Trailing stop:\n    trailing_stop = False\n    #trailing_stop_positive = 0.001\n    #trailing_stop_positive_offset = 0.016\n    #trailing_only_offset_is_reached = True\n\n    window_buy = IntParameter(60, 1000, default=500, space='buy', optimize=True)\n    bandwidth_buy = IntParameter(2, 15, default=8, space='buy', optimize=True)\n    mult_buy = DecimalParameter(0.5, 20.0, default=3, space='buy', optimize=True)\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    use_custom_stoploss = True\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    informative_timeframe = '1h'\n    inf_15m = '15m' #use for pump detection\n    timeframe_minutes = timeframe_to_minutes(timeframe)\n    # storage dict for custom info\n    custom_info = {}\n\n    startup_candle_count: int = 499\n   # startup_candle_count = 96\n    process_only_new_candles = True\n\n    timeperiods = [\n        # 50 // timeframe_minutes,\n        # 85 // timeframe_minutes,\n        180 // timeframe_minutes,\n        360 // timeframe_minutes,\n        420 // timeframe_minutes,\n        560 // timeframe_minutes,\n    ]\n\n    use_sell_signal = False\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = True\n\n    # trailing stoploss hyperopt parameters\n    pHSL = DecimalParameter(-0.15, -0.08, default=sell_params['pHSL'], decimals=3, space='sell', optimize=True)\n    ProfitMargin1 = DecimalParameter(0.009, 0.019, default=sell_params['ProfitMargin1'], decimals=3, space='sell', optimize=True)\n    ProfitLoss1 = DecimalParameter(0.005, 0.012, default=sell_params['ProfitLoss1'], decimals=3, space='sell', optimize=True)\n    ProfitMargin2 = DecimalParameter(0.033, 0.099, default=sell_params['ProfitMargin2'], decimals=3, space='sell', optimize=True)\n    ProfitLoss2 = DecimalParameter(0.010, 0.025, default=sell_params['ProfitLoss2'], decimals=3, space='sell', optimize=True)\n\n    plot_config = {\n        'main_plot': {\n            # fill area between senkou_a and senkou_b\n            'senkou_a': {\n                'color': 'green', #optional\n                'fill_to': 'senkou_b',\n                'fill_label': 'Ichimoku Cloud', #optional\n                'fill_color': 'rgba(255,76,46,0.2)', #optional\n            },\n            # plot senkou_b, too. Not only the area to it.\n            'senkou_b': {},\n\n        },\n        'subplots': {\n            'fan_magnitude': {\n                'fan_magnitude': {}\n            },\n            'fan_magnitude_gain': {\n                'fan_magnitude_gain': {}\n            }\n        }\n    }\n    \n    slippage_protection = {\n        'retries': 3,\n        'max_slippage': -0.02\n    }\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs):\n        if ((current_time - trade.open_date_utc).seconds / 60 > 1440):\n            return 'unclog'\n\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n        HSL = self.pHSL.value\n        if (current_profit > self.ProfitMargin2.value):\n            sl_profit = self.ProfitLoss2.value\n        elif (current_profit > self.ProfitMargin1.value):\n            sl_profit = self.ProfitLoss1.value + ((current_profit - self.ProfitMargin1.value) * (self.ProfitLoss2.value - self.ProfitLoss1.value) / (self.ProfitMargin2.value - self.ProfitMargin1.value))\n        else:\n            sl_profit = HSL\n\n        return sl_profit\n\n    def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,\n                           rate: float, time_in_force: str, sell_reason: str,\n                           current_time: datetime, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n        last_candle = dataframe.iloc[-1]\n        current_profit = trade.calc_profit_ratio(rate)\n\n        if 'tesla_' in trade.buy_tag and current_profit > 0.01:\n            return True\n\n        if (trade.buy_tag == 'telsa_'):\n            if (sell_reason in ['sell_signal'])or (sell_reason in ['roi']) or (sell_reason in ['trailing_stop_loss']):\n                        return False \n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50'] > last_candle['ema_100']) and (last_candle['rsi'] < 45): #*1.2\n                    return False\n\n        if (last_candle is not None):\n            if (sell_reason in ['sell_signal']):\n                if (last_candle['hma_50']*1.149 > last_candle['ema_100']) and (last_candle['close'] < last_candle['ema_100']*0.951): #*1.2\n                    return False\n\n        # slippage\n        try:\n            state = self.slippage_protection['__pair_retries']\n        except KeyError:\n            state = self.slippage_protection['__pair_retries'] = {}\n\n        candle = dataframe.iloc[-1].squeeze()\n\n        slippage = (rate / candle['close']) - 1\n        if slippage < self.slippage_protection['max_slippage']:\n            pair_retries = state.get(pair, 0)\n            if pair_retries < self.slippage_protection['retries']:\n                state[pair] = pair_retries + 1\n                return False\n\n        state[pair] = 0\n\n        return True\n\n    age_filter = 30\n\n    @informative('1d')\n    def populate_indicators_1d(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe['age_filter_ok'] = (dataframe['volume'].rolling(window=self.age_filter, min_periods=self.age_filter).min() > 0)\n        return dataframe   \n\n    def informative_pairs(self):\n        # get access to all pairs available in whitelist.\n        pairs = self.dp.current_whitelist()\n        # Assign tf to each pair so they can be downloaded and cached for strategy.\n        informative_pairs = [(pair, '1h') for pair in pairs]\n        informative_pairs = [(pair, '15m') for pair in pairs]\n        informative_pairs.extend([(pair, self.informative_timeframe) for pair in pairs])\n\n        informative_pairs += [(\"BTC/USDT\", \"1m\")]\n        informative_pairs += [(\"BTC/USDT\", \"5m\")]\n        informative_pairs += [(\"BTC/USDT\", \"1d\")]\n\n        return informative_pairs\n\n    def get_informative_indicators(self, metadata: dict):\n\n        dataframe = self.dp.get_pair_dataframe(\n            pair=metadata['pair'], timeframe=self.informative_timeframe)\n\n        return dataframe\n    def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        tik = time.perf_counter()\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.informative_timeframe)\n        # RSI\n        informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)\n        #Weekly average close price  \n        informative_1h['weekly_close_avg'] = informative_1h['close'].rolling(168).mean()\n\n        return informative_1h\n\n#######################################################################\n    # Informative indicator for pump detection \n\n    def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n        # Get the informative pair\n        informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_15m)\n        \n        informative_15m['max_flow_price'] = max_pump_detect_price_15m(informative_15m, period=self.pump_period.value, pause=self.pump_pause_duration.value)\n        informative_15m['flow_price'] = flow_price_15m(informative_15m, period=self.pump_period.value, pause=self.pump_pause_duration.value)\n        \n        return informative_15m\n#######################################################################\n\n    def top_percent_change(self, dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        df = dataframe.copy()\n        if length == 0:\n            return ((df['open'] - df['close']) / df['close'])\n        else:\n            return ((df['open'].rolling(length).max() - df['close']) / df['close'])\n\n\n    def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        ### BTC protection\n        if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:\n            btc_info_pair = f\"BTC/{self.config['stake_currency']}\"\n        else:\n            btc_info_pair = \"BTC/USDT\"\n\n        btc_df = self.dp.get_pair_dataframe(pair=btc_info_pair, timeframe=self.timeframe)\n        dataframe['btc_rsi'] = normalize(ta.RSI(btc_df, timeperiod=14), 0, 100)\n\n        ### BTC protection\n        dataframe['btc_5m']= self.dp.get_pair_dataframe('BTC/USDT', timeframe='5m')['close']\n        btc_1d = self.dp.get_pair_dataframe('BTC/USDT', timeframe='1d')[['date', 'close']].rename(columns={\"close\": \"btc\"}).shift(1)\n        dataframe = merge_informative_pair(dataframe, btc_1d, '5m', '1d', ffill=True)\n\n        # BTC info\n        informative = self.dp.get_pair_dataframe(pair=\"BTC/USDT\", timeframe=\"5m\")\n        informative_past = informative.copy().shift(1)  \n\n        # BTC 5m dump protection\n        informative_past_source = (informative_past['open'] + informative_past['close'] + informative_past['high'] + informative_past['low']) / 4        # Get BTC price\n        informative_threshold = informative_past_source * self.buy_threshold.value                                                                       # BTC dump n% in 5 min\n        informative_past_delta = informative_past['close'].shift(1) - informative_past['close']                                                          # should be positive if dump\n        informative_diff = informative_threshold - informative_past_delta                                                                                # Need be larger than 0\n        dataframe['btc_threshold'] = informative_threshold\n        dataframe['btc_diff'] = informative_diff\n\n        # BTC 1d dump protection\n        informative_past_1d = informative.copy().shift(288)\n        informative_past_source_1d = (informative_past_1d['open'] + informative_past_1d['close'] + informative_past_1d['high'] + informative_past_1d['low']) / 4\n        dataframe['btc_5m'] = informative_past_source\n        dataframe['btc_1d'] = informative_past_source_1d \n\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n\n        # strategy ClucMay72018\n        dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=30).mean()\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50) \n        dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)\n        dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        dataframe['ema55'] = ta.EMA(dataframe, timeperiod=55)\n        # Pump strength\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        dataframe['zema_30'] = ftt.zema(dataframe, period=30)\n        dataframe['zema_200'] = ftt.zema(dataframe, period=200)\n        dataframe['pump_strength'] = (dataframe['zema_30'] - dataframe['zema_200']) / dataframe['zema_30']\n        dataframe['pump_strength_2'] = (dataframe['ema_50'] - dataframe['ema_200']) / dataframe['ema_50']\n\n        heikinashi = qtpylib.heikinashi(dataframe)\n        heikinashi[\"volume\"] = dataframe[\"volume\"]\n        dataframe['open'] = heikinashi['open']\n        #dataframe['close'] = heikinashi['close']\n        dataframe['high'] = heikinashi['high']\n        dataframe['low'] = heikinashi['low']\n\n        dataframe['trend_close_5m'] = dataframe['close']\n        dataframe['trend_close_15m'] = ta.EMA(dataframe['close'], timeperiod=3)\n        dataframe['trend_close_30m'] = ta.EMA(dataframe['close'], timeperiod=6)\n        dataframe['trend_close_1h'] = ta.EMA(dataframe['close'], timeperiod=12)\n        dataframe['trend_close_2h'] = ta.EMA(dataframe['close'], timeperiod=24)\n        dataframe['trend_close_4h'] = ta.EMA(dataframe['close'], timeperiod=48)\n        dataframe['trend_close_6h'] = ta.EMA(dataframe['close'], timeperiod=72)\n        dataframe['trend_close_8h'] = ta.EMA(dataframe['close'], timeperiod=96)\n\n        dataframe['trend_open_5m'] = dataframe['open']\n        dataframe['trend_open_15m'] = ta.EMA(dataframe['open'], timeperiod=3)\n        dataframe['trend_open_30m'] = ta.EMA(dataframe['open'], timeperiod=6)\n        dataframe['trend_open_1h'] = ta.EMA(dataframe['open'], timeperiod=12)\n        dataframe['trend_open_2h'] = ta.EMA(dataframe['open'], timeperiod=24)\n        dataframe['trend_open_4h'] = ta.EMA(dataframe['open'], timeperiod=48)\n        dataframe['trend_open_6h'] = ta.EMA(dataframe['open'], timeperiod=72)\n        dataframe['trend_open_8h'] = ta.EMA(dataframe['open'], timeperiod=96)\n\n        dataframe['fan_magnitude'] = (dataframe['trend_close_1h'] / dataframe['trend_close_8h'])\n        dataframe['fan_magnitude_gain'] = dataframe['fan_magnitude'] / dataframe['fan_magnitude'].shift(1)\n\n        ichimoku = ftt.ichimoku(dataframe, conversion_line_period=20, base_line_periods=60, laggin_span=120, displacement=30)\n        dataframe['chikou_span'] = ichimoku['chikou_span']\n        dataframe['tenkan_sen'] = ichimoku['tenkan_sen']\n        dataframe['kijun_sen'] = ichimoku['kijun_sen']\n        dataframe['senkou_a'] = ichimoku['senkou_span_a']\n        dataframe['senkou_b'] = ichimoku['senkou_span_b']\n        dataframe['leading_senkou_span_a'] = ichimoku['leading_senkou_span_a']\n        dataframe['leading_senkou_span_b'] = ichimoku['leading_senkou_span_b']\n        dataframe['cloud_green'] = ichimoku['cloud_green']\n        dataframe['cloud_red'] = ichimoku['cloud_red']\n\n        dataframe['atr'] = ta.ATR(dataframe)\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        return dataframe\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # The indicators for the 1h informative timeframe\n        informative_1h = self.informative_1h_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.informative_timeframe, ffill=True)\n\n        # The indicators for the normal (5m) timeframe\n        dataframe = self.normal_tf_indicators(dataframe, metadata)\n\n        #Import 15m indicators    \n        informative_15m = self.informative_15m_indicators(dataframe, metadata)\n        dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.inf_15m, ffill=True)\n        drop_columns = [(s + \"_\" + self.inf_15m) for s in ['date']]\n        dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)\n        \n        #Pump protection\n        dataframe['weekly_close_avg_offset'] = self.pump_recorver_price.value * dataframe['weekly_close_avg_1h']\n        dataframe['price_test'] = dataframe['close'] > dataframe['weekly_close_avg_offset']\n        dataframe['pump_price_test'] = dataframe['max_flow_price_15m'] > self.pump_limit.value\n\n        # Check if a pump uccured during pump_pause_duration and coin didn't recovered its pre pump value\n        dataframe['pump_dump_alert'] = dataframe['price_test'] & dataframe['pump_price_test']\n        dataframe['buy_ok'] = np.where(dataframe['pump_dump_alert'], False, True)\n      \n        return dataframe\n\n    ## Confirm Entry\n    def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, **kwargs) -> bool:\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        max_slip = self.max_slip.value\n\n        if(len(dataframe) < 1):\n            return False\n\n        dataframe = dataframe.iloc[-1].squeeze()\n        if ((rate > dataframe['close'])) :\n\n            slippage = ( (rate / dataframe['close']) - 1 ) * 100\n\n            if slippage < max_slip:\n                return True\n            else:\n                return False\n\n        return True\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_protection = (\n            (pct_change(dataframe['btc_1d'], dataframe['btc_5m']).fillna(0) > self.buy_btc_safe_1d.value) &\n            (dataframe['pump_strength_2'] < self.antipump_threshold_2.value)&\n            (dataframe['buy_ok'])&\n            (dataframe['volume'] > 0)\n        )\n\n        if self.buy_params['tesla_enabled'] >= True:\n            tesla = (\n\n                (dataframe['rsi'] > dataframe['rsi_1h']) &\n                (dataframe['trend_close_8h'] > dataframe['trend_close_6h'])&\n                (dataframe['trend_close_15m'] > dataframe['trend_close_30m'])&\n                (dataframe['trend_open_5m'] > dataframe['trend_open_15m'])&\n                (dataframe['trend_close_1h']> dataframe['ema55'])&\n                (dataframe['ema21']> dataframe['trend_close_4h'])&\n                (dataframe['trend_open_1h'] > dataframe['trend_open_2h'])&\n                (dataframe['mfi'] < 70)&\n                (dataframe['fan_magnitude_gain'] >= self.buy_min_fan_magnitude_gain.value) &\n                (dataframe['fan_magnitude'] > 0.99)\n            )\n            conditions.append(tesla) \n            dataframe.loc[tesla, 'buy_tag'] += 'tesla_' \n\n        if conditions:\n            dataframe.loc[\n                is_protection &\n                reduce(lambda x, y: x & y, conditions),\n                'buy'] = 1\n\n        return dataframe\n\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        conditions = []\n\n        conditions.append(qtpylib.crossed_below(dataframe['trend_close_5m'], dataframe[self.sell_params['sell_trend_indicator']]))\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x & y, conditions),\n                'sell'] = 1\n\n        return dataframe\n        \n    def rollingNormalize(self, dataframe, name):\n        df = dataframe.copy()\n        df[name + '_nmin'] = df[name].rolling(window=1440 // self.timeframe_minutes).min()\n        df[name + '_nmax'] = df[name].rolling(window=1440 // self.timeframe_minutes).max()\n        return np.where(df[name + '_nmin'] == df[name + '_nmax'], 0, (2.0*(df[name]-df[name + '_nmin'])/(df[name + '_nmax']-df[name + '_nmin'])-1.0))\n\ndef normalize(data, min_value, max_value):\n    return (data - min_value) / (max_value - min_value)\n\n\ndef pct_change(a, b):\n    return (b - a) / a\n\n    # smoothed Heiken Ashi\ndef HA(dataframe, smoothing=None):\n    df = dataframe.copy()\n\n    df['HA_Close']=(df['open'] + df['high'] + df['low'] + df['close'])/4\n\n    df.reset_index(inplace=True)\n\n    ha_open = [ (df['open'][0] + df['close'][0]) / 2 ]\n    [ ha_open.append((ha_open[i] + df['HA_Close'].values[i]) / 2) for i in range(0, len(df)-1) ]\n    df['HA_Open'] = ha_open\n\n    df.set_index('index', inplace=True)\n\n    df['HA_High']=df[['HA_Open','HA_Close','high']].max(axis=1)\n    df['HA_Low']=df[['HA_Open','HA_Close','low']].min(axis=1)\n\n    if smoothing is not None:\n        sml = abs(int(smoothing))\n        if sml > 0:\n            df['Smooth_HA_O']=ta.EMA(df['HA_Open'], sml)\n            df['Smooth_HA_C']=ta.EMA(df['HA_Close'], sml)\n            df['Smooth_HA_H']=ta.EMA(df['HA_High'], sml)\n            df['Smooth_HA_L']=ta.EMA(df['HA_Low'], sml)\n            \n    return df\n\ndef pump_warning(dataframe, perc=15):\n    df = dataframe.copy()    \n    df[\"change\"] = df[\"high\"] - df[\"low\"]\n    df[\"test1\"] = (df[\"close\"] > df[\"open\"])\n    df[\"test2\"] = ((df[\"change\"]/df[\"low\"]) > (perc/100))\n    df[\"result\"] = (df[\"test1\"] & df[\"test2\"]).astype('int')\n    return df['result']"
  },
  {
    "path": "strategies/keltnerchannel/keltnerchannel.py",
    "content": "# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport pandas_ta as pta\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\n\n# These libs are for hyperopt\nfrom functools import reduce\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,IStrategy, IntParameter)\n\nclass keltnerchannel(IStrategy):\n    timeframe = \"6h\"\n    # Both stoploss and roi are set to 100 to prevent them to give a sell signal.\n    stoploss = -0.254\n    minimal_roi = {\"0\": 100}\n\n    plot_config = {\n        \"main_plot\": {\n            \"kc_upperband\" : {\"color\": \"purple\",'plotly': {'opacity': 0.4}},\n            \"kc_middleband\" : {\"color\": \"blue\"},\n            \"kc_lowerband\" : {\"color\": \"purple\",'plotly': {'opacity': 0.4}}\n        },\n        \"subplots\": {\n            \"RSI\": {\n                \"rsi\": {\"color\": \"orange\"},\n                \"hline\": {\"color\": \"grey\",\"plotly\": {\"opacity\": 0.4}}\n            },\n        },\n    }\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # Keltner Channel\n        keltner = qtpylib.keltner_channel(dataframe, window=20, atrs=1)\n        dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n\n        # RSI\n        dataframe[\"rsi\"] = ta.RSI(dataframe, timeperiod=14)\n\n        # Horizontal RSI line\n        hline = 55\n        dataframe['hline'] = hline\n\n        # Print stuff for debugging dataframe\n        # print(metadata)\n        # print(dataframe.tail(20))\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (qtpylib.crossed_above(dataframe['close'], dataframe['kc_upperband'])\n            & (dataframe[\"rsi\"] > dataframe['hline'])\n            ),\n\n            \"buy\",\n        ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (qtpylib.crossed_below(dataframe['close'], dataframe['kc_middleband'])),\n\n            \"sell\",\n        ] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/mabStra/mabStra.py",
    "content": "# Author: @Mablue (Masoud Azizi)\n# github: https://github.com/mablue/\n# IMPORTANT: DO NOT USE IT WITHOUT HYPEROPT:\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces all --strategy mabStra --config config.json -e 100\n\n# --- Do not remove these libs ---\nfrom freqtrade.strategy import IntParameter, DecimalParameter\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame\n# --------------------------------\n\n# Add your lib to import here\nimport talib.abstract as ta\n\n\nclass MabStra(IStrategy):\n\n    # #################### RESULTS PASTE PLACE ####################\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.598,\n        \"644\": 0.166,\n        \"3269\": 0.115,\n        \"7289\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.128\n    # Buy hypers\n    timeframe = '4h'\n\n    # #################### END OF RESULT PLACE ####################\n\n    # buy params\n    buy_mojo_ma_timeframe = IntParameter(2, 100, default=7, space='buy')\n    buy_fast_ma_timeframe = IntParameter(2, 100, default=14, space='buy')\n    buy_slow_ma_timeframe = IntParameter(2, 100, default=28, space='buy')\n    buy_div_max = DecimalParameter(\n        0, 2, decimals=4, default=2.25446, space='buy')\n    buy_div_min = DecimalParameter(\n        0, 2, decimals=4, default=0.29497, space='buy')\n    # sell params\n    sell_mojo_ma_timeframe = IntParameter(2, 100, default=7, space='sell')\n    sell_fast_ma_timeframe = IntParameter(2, 100, default=14, space='sell')\n    sell_slow_ma_timeframe = IntParameter(2, 100, default=28, space='sell')\n    sell_div_max = DecimalParameter(\n        0, 2, decimals=4, default=1.54593, space='sell')\n    sell_div_min = DecimalParameter(\n        0, 2, decimals=4, default=2.81436, space='sell')\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # SMA - ex Moving Average\n        dataframe['buy-mojoMA'] = ta.SMA(dataframe,\n                                         timeperiod=self.buy_mojo_ma_timeframe.value)\n        dataframe['buy-fastMA'] = ta.SMA(dataframe,\n                                         timeperiod=self.buy_fast_ma_timeframe.value)\n        dataframe['buy-slowMA'] = ta.SMA(dataframe,\n                                         timeperiod=self.buy_slow_ma_timeframe.value)\n        dataframe['sell-mojoMA'] = ta.SMA(dataframe,\n                                          timeperiod=self.sell_mojo_ma_timeframe.value)\n        dataframe['sell-fastMA'] = ta.SMA(dataframe,\n                                          timeperiod=self.sell_fast_ma_timeframe.value)\n        dataframe['sell-slowMA'] = ta.SMA(dataframe,\n                                          timeperiod=self.sell_slow_ma_timeframe.value)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['buy-mojoMA'].div(dataframe['buy-fastMA'])\n                    > self.buy_div_min.value) &\n                (dataframe['buy-mojoMA'].div(dataframe['buy-fastMA'])\n                    < self.buy_div_max.value) &\n                (dataframe['buy-fastMA'].div(dataframe['buy-slowMA'])\n                    > self.buy_div_min.value) &\n                (dataframe['buy-fastMA'].div(dataframe['buy-slowMA'])\n                    < self.buy_div_max.value)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (dataframe['sell-fastMA'].div(dataframe['sell-mojoMA'])\n                    > self.sell_div_min.value) &\n                (dataframe['sell-fastMA'].div(dataframe['sell-mojoMA'])\n                    < self.sell_div_max.value) &\n                (dataframe['sell-slowMA'].div(dataframe['sell-fastMA'])\n                    > self.sell_div_min.value) &\n                (dataframe['sell-slowMA'].div(dataframe['sell-fastMA'])\n                    < self.sell_div_max.value)\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/macd_recovery/macd_recovery.py",
    "content": "from freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\n\n__author__       = \"Robert Roman\"\n__copyright__    = \"Free For Use\"\n__license__      = \"MIT\"\n__version__      = \"1.0\"\n__maintainer__   = \"Robert Roman\"\n__email__        = \"robertroman7@gmail.com\"\n__BTC_donation__ = \"3FgFaG15yntZYSUzfEpxr5mDt1RArvcQrK\"\n\n# Optimized With Sortino Ratio and 2 years data\n\nclass macd_recovery(IStrategy):\n\n    ticker_interval = '5m'\n\n    # ROI table:\n    minimal_roi = {\n        \"0\": 0.03024,\n        \"296\": 0.02924,\n        \"596\": 0.02545,\n        \"840\": 0.02444,\n        \"966\": 0.02096,\n        \"1258\": 0.01709,\n        \"1411\": 0.01598,\n        \"1702\": 0.0122,\n        \"1893\": 0.00732,\n        \"2053\": 0.00493,\n        \"2113\": 0\n    }\n\n    # Stoploss:\n    stoploss = -0.04032\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n      \n        # EMA200\n        dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200)\n        \n        #RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        \n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'].rolling(8).min() < 41) &\n                    (dataframe['close'] > dataframe['ema200']) &\n                    (qtpylib.crossed_above(dataframe['macd'], dataframe['macdsignal']))\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                    (dataframe['rsi'].rolling(8).max() > 93) &\n                    (dataframe['macd'] > 0) &\n                    (qtpylib.crossed_below(dataframe['macd'], dataframe['macdsignal']))\n            ),\n            'sell'] = 1\n\n        return dataframe"
  },
  {
    "path": "strategies/mark_strat/mark_strat.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass mark_strat(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"0\": 0.03653,\n        \"7\": 0.01223,\n        \"16\": 0.00756,\n        \"29\": 0\n    }\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.23936\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = True\n    trailing_stop_positive = 0.13595\n    trailing_stop_positive_offset = 0.17493\n    # Optimal ticker interval for the strategy.\n    \n    ticker_interval = '1m'\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # Momentum Indicators\n        # ------------------------------------\n        dataframe['rsi'] = ta.RSI(dataframe)\n        # # Stochastic RSI\n        stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        dataframe['fastk_rsi'] = stoch_rsi['fastk']\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        # dataframe['macdsignal'] = macd['macdsignal']\n        # dataframe['macdhist'] = macd['macdhist']\n         # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n        # Overlap Studies\n        # ------------------------------------\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n        return dataframe\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                ((dataframe['close'] < dataframe['bb_lowerband'])) &\n                (dataframe['volume'] > 0)\n            ),\n            'buy'] = 1\n        return dataframe\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['rsi'] > 90) &\n                ((dataframe['close'] > dataframe['bb_middleband'])) &\n                (dataframe['volume'] > 0)\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/mark_strat_opt/mark_strat_opt.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\nfrom freqtrade.strategy.interface import IStrategy\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\nclass mark_strat_opt (IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    # minimal_roi = {\n    #     \"0\": 0.50503, \n    #     \"304\": 0.13111, \n    #     \"669\": 0.03614, \n    #     \"1039\": 0\n    #     }\n    minimal_roi = {\n        \"0\": 0.06965, \n        \"8\": 0.01125, \n        \"19\": 0.00498, \n        \"34\": 0\n        }\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.20206\n# {   'trailing_only_offset_is_reached': False,\n#     'trailing_stop': True,\n#     'trailing_stop_positive': 0.0916,\n#     'trailing_stop_positive_offset': 0.11514}\n    # Trailing stoploss\n    trailing_stop = True\n    trailing_only_offset_is_reached = False\n    trailing_stop_positive = 0.07573\n    trailing_stop_positive_offset = 0.09805  \n    # Optimal ticker interval for the strategy.\n    ticker_interval = '1m'\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 20\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        # Momentum Indicators\n        # ------------------------------------\n        dataframe['adx'] = ta.ADX(dataframe)\n        dataframe['sar'] = ta.SAR(dataframe)\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        # Bollinger Bands 1 STD\n        bollinger1 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=1)\n        dataframe['bb_lowerband1'] = bollinger1['lower']\n        # dataframe['bb_middleband1'] = bollinger1['mid']\n        # dataframe['bb_upperband1'] = bollinger1['upper']\n        # bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        # dataframe['bb_lowerband2'] = bollinger2['lower']\n        # dataframe['bb_middleband2'] = bollinger2['mid']\n        # dataframe['bb_upperband2'] = bollinger2['upper']\n        # bollinger3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)\n        # dataframe['bb_lowerband3'] = bollinger3['lower']\n        # dataframe['bb_middleband3'] = bollinger3['mid']\n        # dataframe['bb_upperband3'] = bollinger3['upper']\n        # Bollinger Bands 4 STD\n        bollinger4 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=4)\n        dataframe['bb_lowerband4'] = bollinger4['lower']\n        # dataframe['bb_middleband4'] = bollinger4['mid']\n        # dataframe['bb_upperband4'] = bollinger4['upper']\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        return dataframe\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['adx'] > 49) &\n                (dataframe['fastd'] < 30) &\n                (dataframe['mfi'] < 23) &\n                (dataframe['rsi'] < 34) &\n                (dataframe['close'] < dataframe['bb_lowerband4'])\n            ),\n            'buy'] = 1\n        return dataframe\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (dataframe['adx'] < 95) &\n                (dataframe['fastd'] > 70) &\n                (dataframe['rsi'] > 94) &\n                (qtpylib.crossed_above(dataframe['sar'], dataframe['close']))\n            ),\n            'sell'] = 1\n        return dataframe"
  },
  {
    "path": "strategies/quantumfirst/quantumfirst.py",
    "content": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Sat Aug 29 15:18:55 2020\n\n@author: alex\n\"\"\"\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy # noqa\n\n\nclass quantumfirst(IStrategy):\n    \"\"\"\n    Strategy 005\n    author@: Gerald Lonlas\n    github@: https://github.com/freqtrade/freqtrade-strategies\n\n    How to use it?\n    > python3 ./freqtrade/main.py -s Strategy005\n    \"\"\"\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\"\n    minimal_roi = {\n        \"1440\": 0.01,\n        \"80\": 0.02,\n        \"40\": 0.03,\n        \"20\": 0.04,\n        \"0\":  0.05\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.10\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '5m'\n\n    # trailing stoploss\n    trailing_stop = False\n    trailing_stop_positive = 0.01\n    trailing_stop_positive_offset = 0.02\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = False\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = False\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        \"\"\"\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n\n        # Minus Directional Indicator / Movement\n        dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # Inverse Fisher transform on RSI, values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        rsi = 0.1 * (dataframe['rsi'] - 50)\n        dataframe['fisher_rsi'] = (numpy.exp(2 * rsi) - 1) / (numpy.exp(2 * rsi) + 1)\n        # Inverse Fisher transform on RSI normalized, value [0.0, 100.0] (https://goo.gl/2JGGoy)\n        dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # Stoch fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # SAR Parabol\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # SMA - Simple Moving Average\n        dataframe['sma'] = ta.SMA(dataframe, timeperiod=40)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            # Prod\n            (\n                (dataframe['close'] > 0.00000200) &\n                (dataframe['volume'] > dataframe['volume'].rolling(200).mean() * 4) &\n                (dataframe['close'] < dataframe['sma']) &\n                (dataframe['fastd'] > dataframe['fastk']) &\n                (dataframe['rsi'] > 0) &\n                (dataframe['fastd'] > 0) &\n                # (dataframe['fisher_rsi'] < -0.94)\n                (dataframe['fisher_rsi_norma'] < 38.900000000000006)\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            # Prod\n            (\n                (qtpylib.crossed_above(dataframe['rsi'], 50)) &\n                (dataframe['macd'] < 0) &\n                (dataframe['minus_di'] > 0)\n            ) |\n            (\n                (dataframe['sar'] > dataframe['close']) &\n                (dataframe['fisher_rsi'] > 0.3)\n            ),\n\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/redditMA/redditMA.py",
    "content": "\"\"\"\n3. sma ema with complicated support\n4. sma ema with simple support\n4-0.2. sma ema with simple support with 0.2 SL\n5. sma wma with simple support\n6. sma wma with VWAP simple support\n\"\"\"\n# --- Do not remove these libs ---\nfrom freqtrade.strategy.interface import IStrategy\nfrom typing import Dict, List\nfrom functools import reduce\nfrom pandas import DataFrame\n# --------------------------------\n\nfrom finta import TA as F\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np # noqa\n\n\nclass redditMA(IStrategy):\n    minimal_roi = {\n        \"0\": 0.5,\n        \"30\": 0.3,\n        \"60\": 0.125,\n        \"120\": 0.06,\n        \"180\": 0.01\n    }\n\n    # Optimal stoploss designed for the strategy\n    # This attribute will be overridden if the config file contains \"stoploss\"\n    stoploss = -0.5\n\n    # Optimal ticker interval for the strategy\n    ticker_interval = '15m'\n\n    # trailing stoploss\n    trailing_stop = False\n\n    # run \"populate_indicators\" only for new candle\n    process_only_new_candles = True\n\n    # Experimental settings (configuration will overide these if set)\n    use_sell_signal = True\n    sell_profit_only = True\n    ignore_roi_if_buy_signal = True\n\n    # Optional order type mapping\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    startup_candle_count = 34\n\n    def informative_pairs(self):\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe[\"SLOWMA\"] = F.EMA(dataframe, 13)\n        dataframe[\"FASTMA\"] = F.EMA(dataframe, 34)\n        \n        # dataframe = self.mods(dataframe)\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[qtpylib.crossed_above(dataframe['FASTMA'], dataframe['SLOWMA']) ,'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[qtpylib.crossed_below(dataframe['FASTMA'], dataframe['SLOWMA']) ,'sell'] = 1\n        \n        return dataframe"
  },
  {
    "path": "strategies/stoploss/stoploss.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy.interface import IStrategy\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\nclass stoploss(IStrategy):\n    \"\"\"\n    This is a strategy template to get you started.\n    More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,\n    populate_sell_trend, hyperopt_space, buy_strategy_generator\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Optimal timeframe for the strategy.\n    timeframe = '5m'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n    \n    plot_config = {\n        # Main plot indicators (Moving averages, ...)\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            # Subplots - each dict defines one additional plot\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n        \n        # Momentum Indicators\n        # ------------------------------------\n\n        # ADX\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # # Plus Directional Indicator / Movement\n        # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)\n        # dataframe['plus_di'] = ta.PLUS_DI(dataframe)\n\n        # # Minus Directional Indicator / Movement\n        # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)\n        # dataframe['minus_di'] = ta.MINUS_DI(dataframe)\n\n        # # Aroon, Aroon Oscillator\n        # aroon = ta.AROON(dataframe)\n        # dataframe['aroonup'] = aroon['aroonup']\n        # dataframe['aroondown'] = aroon['aroondown']\n        # dataframe['aroonosc'] = ta.AROONOSC(dataframe)\n\n        # # Awesome Oscillator\n        # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)\n\n        # # Keltner Channel\n        # keltner = qtpylib.keltner_channel(dataframe)\n        # dataframe[\"kc_upperband\"] = keltner[\"upper\"]\n        # dataframe[\"kc_lowerband\"] = keltner[\"lower\"]\n        # dataframe[\"kc_middleband\"] = keltner[\"mid\"]\n        # dataframe[\"kc_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"kc_lowerband\"]) /\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"])\n        # )\n        # dataframe[\"kc_width\"] = (\n        #     (dataframe[\"kc_upperband\"] - dataframe[\"kc_lowerband\"]) / dataframe[\"kc_middleband\"]\n        # )\n\n        # # Ultimate Oscillator\n        # dataframe['uo'] = ta.ULTOSC(dataframe)\n\n        # # Commodity Channel Index: values [Oversold:-100, Overbought:100]\n        # dataframe['cci'] = ta.CCI(dataframe)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n        # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)\n        # rsi = 0.1 * (dataframe['rsi'] - 50)\n        # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)\n\n        # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)\n        # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)\n\n        # # Stochastic Slow\n        # stoch = ta.STOCH(dataframe)\n        # dataframe['slowd'] = stoch['slowd']\n        # dataframe['slowk'] = stoch['slowk']\n\n        # Stochastic Fast\n        stoch_fast = ta.STOCHF(dataframe)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n\n        # # Stochastic RSI\n        # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.\n        # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.\n        # stoch_rsi = ta.STOCHRSI(dataframe)\n        # dataframe['fastd_rsi'] = stoch_rsi['fastd']\n        # dataframe['fastk_rsi'] = stoch_rsi['fastk']\n\n        # MACD\n        macd = ta.MACD(dataframe)\n        dataframe['macd'] = macd['macd']\n        dataframe['macdsignal'] = macd['macdsignal']\n        dataframe['macdhist'] = macd['macdhist']\n\n        # MFI\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # # ROC\n        # dataframe['roc'] = ta.ROC(dataframe)\n\n        # Overlap Studies\n        # ------------------------------------\n\n        # Bollinger Bands\n        bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband'] = bollinger['lower']\n        dataframe['bb_middleband'] = bollinger['mid']\n        dataframe['bb_upperband'] = bollinger['upper']\n        dataframe[\"bb_percent\"] = (\n            (dataframe[\"close\"] - dataframe[\"bb_lowerband\"]) /\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"])\n        )\n        dataframe[\"bb_width\"] = (\n            (dataframe[\"bb_upperband\"] - dataframe[\"bb_lowerband\"]) / dataframe[\"bb_middleband\"]\n        )\n\n        # Bollinger Bands - Weighted (EMA based instead of SMA)\n        # weighted_bollinger = qtpylib.weighted_bollinger_bands(\n        #     qtpylib.typical_price(dataframe), window=20, stds=2\n        # )\n        # dataframe[\"wbb_upperband\"] = weighted_bollinger[\"upper\"]\n        # dataframe[\"wbb_lowerband\"] = weighted_bollinger[\"lower\"]\n        # dataframe[\"wbb_middleband\"] = weighted_bollinger[\"mid\"]\n        # dataframe[\"wbb_percent\"] = (\n        #     (dataframe[\"close\"] - dataframe[\"wbb_lowerband\"]) /\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"])\n        # )\n        # dataframe[\"wbb_width\"] = (\n        #     (dataframe[\"wbb_upperband\"] - dataframe[\"wbb_lowerband\"]) / dataframe[\"wbb_middleband\"]\n        # )\n\n        # # EMA - Exponential Moving Average\n        # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)\n        # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)\n        # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)\n        # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)\n        # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)\n        # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)\n\n        # # SMA - Simple Moving Average\n        # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)\n        # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)\n        # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)\n        # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)\n        # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)\n        # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)\n\n        # Parabolic SAR\n        dataframe['sar'] = ta.SAR(dataframe)\n\n        # TEMA - Triple Exponential Moving Average\n        dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)\n\n        # Cycle Indicator\n        # ------------------------------------\n        # Hilbert Transform Indicator - SineWave\n        hilbert = ta.HT_SINE(dataframe)\n        dataframe['htsine'] = hilbert['sine']\n        dataframe['htleadsine'] = hilbert['leadsine']\n\n        # Pattern Recognition - Bullish candlestick patterns\n        # ------------------------------------\n        # # Hammer: values [0, 100]\n        # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)\n        # # Inverted Hammer: values [0, 100]\n        # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)\n        # # Dragonfly Doji: values [0, 100]\n        # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)\n        # # Piercing Line: values [0, 100]\n        # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]\n        # # Morningstar: values [0, 100]\n        # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]\n        # # Three White Soldiers: values [0, 100]\n        # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]\n\n        # Pattern Recognition - Bearish candlestick patterns\n        # ------------------------------------\n        # # Hanging Man: values [0, 100]\n        # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)\n        # # Shooting Star: values [0, 100]\n        # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)\n        # # Gravestone Doji: values [0, 100]\n        # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)\n        # # Dark Cloud Cover: values [0, 100]\n        # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)\n        # # Evening Doji Star: values [0, 100]\n        # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)\n        # # Evening Star: values [0, 100]\n        # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)\n\n        # Pattern Recognition - Bullish/Bearish candlestick patterns\n        # ------------------------------------\n        # # Three Line Strike: values [0, -100, 100]\n        # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)\n        # # Spinning Top: values [0, -100, 100]\n        # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]\n        # # Engulfing: values [0, -100, 100]\n        # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]\n        # # Harami: values [0, -100, 100]\n        # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]\n        # # Three Outside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]\n        # # Three Inside Up/Down: values [0, -100, 100]\n        # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]\n\n        # # Chart type\n        # # ------------------------------------\n        # # Heikin Ashi Strategy\n        # heikinashi = qtpylib.heikinashi(dataframe)\n        # dataframe['ha_open'] = heikinashi['open']\n        # dataframe['ha_close'] = heikinashi['close']\n        # dataframe['ha_high'] = heikinashi['high']\n        # dataframe['ha_low'] = heikinashi['low']\n\n        # Retrieve best bid and best ask from the orderbook\n        # ------------------------------------\n        \"\"\"\n        # first check if dataprovider is available\n        if self.dp:\n            if self.dp.runmode in ('live', 'dry_run'):\n                ob = self.dp.orderbook(metadata['pair'], 1)\n                dataframe['best_bid'] = ob['bids'][0][0]\n                dataframe['best_ask'] = ob['asks'][0][0]\n        \"\"\"\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['rsi'], 30)) &  # Signal: RSI crosses above 30\n                (dataframe['tema'] <= dataframe['bb_middleband']) &  # Guard: tema below BB middle\n                (dataframe['tema'] > dataframe['tema'].shift(1)) &  # Guard: tema is raising\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['rsi'], 70)) &  # Signal: RSI crosses above 70\n                (dataframe['tema'] > dataframe['bb_middleband']) &  # Guard: tema above BB middle\n                (dataframe['tema'] < dataframe['tema'].shift(1)) &  # Guard: tema is falling\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n    "
  },
  {
    "path": "strategies/stratfib/stratfib.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n# flake8: noqa: F401\n# isort: skip_file\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom pandas import DataFrame\n\nfrom freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,\n                                IStrategy, IntParameter)\n\n# --------------------------------\n# Add your lib to import here\nimport talib.abstract as ta\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\n\n\n# This class is a sample. Feel free to customize it.\nclass stratfib(IStrategy):\n    \"\"\"\n    This is a sample strategy to inspire you.\n    More information in https://www.freqtrade.io/en/latest/strategy-customization/\n\n    You can:\n        :return: a Dataframe with all mandatory indicators for the strategies\n    - Rename the class name (Do not forget to update class_name)\n    - Add any methods you want to build your strategy\n    - Add any lib you need to build your strategy\n\n    You must keep:\n    - the lib in the section \"Do not remove these libs\"\n    - the methods: populate_indicators, populate_buy_trend, populate_sell_trend\n    You should keep:\n    - timeframe, minimal_roi, stoploss, trailing_*\n    \"\"\"\n    # Strategy interface version - allow new iterations of the strategy interface.\n    # Check the documentation or the Sample strategy to get the latest version.\n    INTERFACE_VERSION = 2\n\n    # Minimal ROI designed for the strategy.\n    # This attribute will be overridden if the config file contains \"minimal_roi\".\n    minimal_roi = {\n        \"60\": 0.01,\n        \"30\": 0.02,\n        \"0\": 0.04\n    }\n\n    # Optimal stoploss designed for the strategy.\n    # This attribute will be overridden if the config file contains \"stoploss\".\n    stoploss = -0.10\n\n    # Trailing stoploss\n    trailing_stop = False\n    # trailing_only_offset_is_reached = False\n    # trailing_stop_positive = 0.01\n    # trailing_stop_positive_offset = 0.0  # Disabled / not configured\n\n    # Hyperoptable parameters\n    buy_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)\n    sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True)\n\n    # Optimal timeframe for the strategy.\n    timeframe = '1h'\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = False\n\n    # These values can be overridden in the \"ask_strategy\" section in the config.\n    use_sell_signal = True\n    sell_profit_only = False\n    ignore_roi_if_buy_signal = False\n\n    # Number of candles the strategy requires before producing valid signals\n    startup_candle_count: int = 30\n\n    # Optional order type mapping.\n    order_types = {\n        'buy': 'limit',\n        'sell': 'limit',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    # Optional order time in force.\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc'\n    }\n\n    plot_config = {\n        'main_plot': {\n            'tema': {},\n            'sar': {'color': 'white'},\n        },\n        'subplots': {\n            \"MACD\": {\n                'macd': {'color': 'blue'},\n                'macdsignal': {'color': 'orange'},\n            },\n            \"RSI\": {\n                'rsi': {'color': 'red'},\n            }\n        }\n    }\n\n    def informative_pairs(self):\n        \"\"\"\n        Define additional, informative pair/interval combinations to be cached from the exchange.\n        These pair/interval combinations are non-tradeable, unless they are part\n        of the whitelist as well.\n        For more information, please consult the documentation\n        :return: List of tuples in the format (pair, interval)\n            Sample: return [(\"ETH/USDT\", \"5m\"),\n                            (\"BTC/USDT\", \"15m\"),\n                            ]\n        \"\"\"\n        return []\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Adds several different TA indicators to the given DataFrame\n\n        Performance Note: For the best performance be frugal on the number of indicators\n        you are using. Let uncomment only the indicator you are using in your strategies\n        or your hyperopt configuration, otherwise you will waste your memory and CPU usage.\n        :param dataframe: Dataframe with data from the exchange\n        :param metadata: Additional information, like the currently traded pair\n        :return: a Dataframe with all mandatory indicators for the strategies\n        \"\"\"\n\n        dataframe['dema3'] = ta.DEMA(dataframe['close'], timeperiod=3)\n        dataframe['dema5'] = ta.DEMA(dataframe['close'], timeperiod=5)\n        dataframe['dema8'] = ta.DEMA(dataframe['close'], timeperiod=8)\n        dataframe['dema13'] = ta.DEMA(dataframe['close'], timeperiod=13)\n        dataframe['dema21'] = ta.DEMA(dataframe['close'], timeperiod=21)\n        dataframe['dema34'] = ta.DEMA(dataframe['close'], timeperiod=34)\n        dataframe['dema55'] = ta.DEMA(dataframe['close'], timeperiod=55)\n        dataframe['dema89'] = ta.DEMA(dataframe['close'], timeperiod=89)\n\n\n        dataframe['rsi'] = ta.RSI(dataframe)\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the buy signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with buy column\n        \"\"\"\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 30\n                (qtpylib.crossed_above(dataframe['rsi'], self.buy_rsi.value)) &\n                (dataframe['dema8'] > dataframe['dema21']) &\n                (dataframe['dema8'] > dataframe['dema89']) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        \"\"\"\n        Based on TA indicators, populates the sell signal for the given dataframe\n        :param dataframe: DataFrame populated with indicators\n        :param metadata: Additional information, like the currently traded pair\n        :return: DataFrame with sell column\n        \"\"\"\n        dataframe.loc[\n            (\n                # Signal: RSI crosses above 70\n                (qtpylib.crossed_above(dataframe['rsi'], self.sell_rsi.value)) &\n                (dataframe['dema8'] < dataframe['dema21']) &\n                (dataframe['dema8'] < dataframe['dema89']) &\n                (dataframe['volume'] > 0)  # Make sure Volume is not 0\n            ),\n            'sell'] = 1\n        return dataframe\n"
  },
  {
    "path": "strategies/strato/strato.py",
    "content": "# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement\n\nimport talib.abstract as ta\nfrom pandas import DataFrame\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nfrom freqtrade.strategy.interface import IStrategy\n\nclass strato(IStrategy):\n\n    INTERFACE_VERSION = 2\n\n    minimal_roi = {\n        \"0\": 0.012\n    }\n\n    stoploss = -0.1\n\n    timeframe = '1m'\n\n    order_types = {\n        'buy': 'market',\n        'sell': 'market',\n        'stoploss': 'market',\n        'stoploss_on_exchange': False\n    }\n\n    startup_candle_count: int = 20\n\n    order_time_in_force = {\n        'buy': 'gtc',\n        'sell': 'gtc',\n    }\n\n    def informative_pairs(self):\n\n        return []\n\n    def get_ticker_indicator(self):\n        return int(self.timeframe[:-1])\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        p = 14\n        d = 3\n        k = 3\n\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        srsi  = (dataframe['rsi'] - dataframe['rsi'].rolling(p).min()) / (dataframe['rsi'].rolling(p).max() - dataframe['rsi'].rolling(p).min())\n        dataframe['k'] = srsi.rolling(k).mean() * 100\n        dataframe['d'] = dataframe['k'].rolling(d).mean()\n\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n        (\n                (dataframe['k'] < 18) &\n                (dataframe['k'] >= dataframe['d'])\n                \n\t    ),\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        dataframe.loc[\n            (\n                (dataframe['k'] > 80) &\n                (dataframe['d'] >= dataframe['k'])\n            ),\n            'sell'] = 1\n        return dataframe\n\n\n\n\n"
  },
  {
    "path": "strategies/true_lambo/true_lambo.py",
    "content": "# --- Do not remove these libs ---\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport numpy as np\nimport talib.abstract as ta\nimport pandas_ta as pta\n\nfrom freqtrade.persistence import Trade\nfrom freqtrade.strategy.interface import IStrategy\nfrom pandas import DataFrame, Series, DatetimeIndex, merge\nfrom datetime import datetime, timedelta\nfrom freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter, stoploss_from_open\nfrom functools import reduce\nfrom technical.indicators import RMI, zema\n\n# --------------------------------\ndef ha_typical_price(bars):\n    res = (bars['ha_high'] + bars['ha_low'] + bars['ha_close']) / 3.\n    return Series(index=bars.index, data=res)\n\ndef EWO(dataframe, ema_length=5, ema2_length=35):\n    df = dataframe.copy()\n    ema1 = ta.EMA(df, timeperiod=ema_length)\n    ema2 = ta.EMA(df, timeperiod=ema2_length)\n    emadif = (ema1 - ema2) / df['low'] * 100\n    return emadif\n\n# VWAP bands\ndef VWAPB(dataframe, window_size=20, num_of_std=1):\n    df = dataframe.copy()\n    df['vwap'] = qtpylib.rolling_vwap(df,window=window_size)\n    rolling_std = df['vwap'].rolling(window=window_size).std()\n    df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)\n    df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)\n    return df['vwap_low'], df['vwap'], df['vwap_high']\n\ndef top_percent_change(dataframe: DataFrame, length: int) -> float:\n        \"\"\"\n        Percentage change of the current close from the range maximum Open price\n        :param dataframe: DataFrame The original OHLC dataframe\n        :param length: int The length to look back\n        \"\"\"\n        if length == 0:\n            return (dataframe['open'] - dataframe['close']) / dataframe['close']\n        else:\n            return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']\n\n# Williams %R\ndef williams_r(dataframe: DataFrame, period: int = 14) -> Series:\n    \"\"\"Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low\n        of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.\n        Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,\n        of its recent trading range.\n        The oscillator is on a negative scale, from âˆ’100 (lowest) up to 0 (highest).\n    \"\"\"\n\n    highest_high = dataframe[\"high\"].rolling(center=False, window=period).max()\n    lowest_low = dataframe[\"low\"].rolling(center=False, window=period).min()\n\n    WR = Series(\n        (highest_high - dataframe[\"close\"]) / (highest_high - lowest_low),\n        name=f\"{period} Williams %R\",\n        )\n\n    return WR * -100\n\nclass true_lambo(IStrategy):\n\n    '''\n    @ jilv220\n\n    Based on BB_RPB_3c.\n\n    The discovery is that the pump protection is only needed for EWO level 2 (4 ~ 8)\n    And the dump protection is only needed for EWO level 5 (< -8)\n\n    Higher parameter delta is needed for EWO level 4 (-4 ~ -8)\n\n    Vwap and Cluc can handle rest of the market pretty well\n\n    '''\n\n    ##########################################################################\n\n    # Hyperopt result area\n\n    # buy space\n    buy_params = {\n        ##\n        \"buy_pump_2_factor\": 1.125,\n        ##\n        \"buy_crash_4_tpct_0\": 0.141,\n        \"buy_crash_4_tpct_3\": 0.031,\n        \"buy_crash_4_tpct_9\": 0.091,\n        ##\n        \"buy_adx\": 20,\n        \"buy_fastd\": 20,\n        \"buy_fastk\": 22,\n        \"buy_ema_cofi\": 0.98,\n        \"buy_ewo_high\": 4.179,\n        ##\n        \"buy_gumbo_ema\": 1.121,\n        \"buy_gumbo_ewo_low\": -9.442,\n        \"buy_gumbo_cti\": -0.374,\n        \"buy_gumbo_r14\": -51.971,\n        \"buy_gumbo_tpct_0\": 0.067,\n        \"buy_gumbo_tpct_3\": 0.0,\n        \"buy_gumbo_tpct_9\": 0.016,\n        ##\n        \"buy_clucha_bbdelta_close\": 0.03734,\n        \"buy_clucha_bbdelta_close_2\": 0.0391,\n        \"buy_clucha_bbdelta_close_3\": 0.03943,\n        \"buy_clucha_bbdelta_close_4\": 0.04202,\n        ##\n        \"buy_clucha_bbdelta_tail\": 0.78624,\n        \"buy_clucha_bbdelta_tail_2\": 1.05718,\n        \"buy_clucha_bbdelta_tail_3\": 0.77701,\n        \"buy_clucha_bbdelta_tail_4\": 0.418,\n        ##\n        \"buy_clucha_closedelta_close\": 0.01382,\n        \"buy_clucha_closedelta_close_2\": 0.01092,\n        \"buy_clucha_closedelta_close_3\": 0.00935,\n        \"buy_clucha_closedelta_close_4\": 0.01234,\n        ##\n        \"buy_clucha_rocr_1h\": 0.70818,\n        \"buy_clucha_rocr_1h_2\": 0.15848,\n        \"buy_clucha_rocr_1h_3\": 0.88989,\n        \"buy_clucha_rocr_1h_4\": 0.99234,\n        ##\n        \"buy_vwap_closedelta\": 19.889,\n        \"buy_vwap_closedelta_2\": 20.099,\n        \"buy_vwap_closedelta_3\": 27.526,\n        \"buy_vwap_closedelta_4\": 22.26,\n        \"buy_vwap_closedelta_5\": 23.227,\n        ##\n        \"buy_vwap_cti\": -0.258,\n        \"buy_vwap_cti_2\": -0.748,\n        \"buy_vwap_cti_3\": -0.227,\n        \"buy_vwap_cti_4\": -0.763,\n        \"buy_vwap_cti_5\": -0.021,\n        ##\n        \"buy_vwap_width\": 0.266,\n        \"buy_vwap_width_2\": 3.212,\n        \"buy_vwap_width_3\": 0.47,\n        \"buy_vwap_width_4\": 9.76,\n        \"buy_vwap_width_5\": 5.374,\n        ##\n        \"buy_lambo2_ema\": 0.986,\n        \"buy_lambo2_rsi14\": 32,\n        \"buy_lambo2_rsi4\": 30,\n        ##\n        \"buy_V_bb_width\": 0.03,\n        \"buy_V_bb_width_2\": 0.08,\n        \"buy_V_bb_width_3\": 0.097,\n        \"buy_V_bb_width_4\": 0.054,\n        \"buy_V_bb_width_5\": 0.063,\n        ##\n        \"buy_V_cti\": -0.872,\n        \"buy_V_cti_2\": -0.842,\n        \"buy_V_cti_3\": -0.888,\n        \"buy_V_cti_4\": -0.57,\n        \"buy_V_cti_5\": -0.086,\n        ##\n        \"buy_V_mfi\": 35.342,\n        \"buy_V_mfi_2\": 24.775,\n        \"buy_V_mfi_3\": 17.053,\n        \"buy_V_mfi_4\": 13.907,\n        \"buy_V_mfi_5\": 38.158,\n        ##\n        \"buy_V_r14\": -67.209,\n        \"buy_V_r14_2\": -6.723,\n        \"buy_V_r14_3\": -68.059,\n        \"buy_V_r14_4\": -88.943,\n        \"buy_V_r14_5\": -41.493,\n    }\n\n    # sell space\n    sell_params = {\n        ##\n        \"base_nb_candles_sell\": 23,\n        \"high_offset\": 0.87,\n        \"high_offset_2\": 1.166,\n        ##\n        \"high_offset\": 0.963,\n        \"high_offset_2\": 1.391,\n        \"pHSL\": -0.083,\n        \"pPF_1\": 0.011,\n        \"pPF_2\": 0.048,\n        \"pSL_1\": 0.02,\n        \"pSL_2\": 0.041,\n    }\n\n    # ROI\n    minimal_roi = {\n        \"0\": 0.092,\n        \"29\": 0.042,\n        \"85\": 0.028,\n        \"128\": 0.005\n    }\n\n    # Optimal timeframe for the strategy\n    timeframe = '5m'\n    inf_1h = '1h'\n\n    # Disabled\n    stoploss = -0.99\n\n    # Run \"populate_indicators()\" only for new candle.\n    process_only_new_candles = True\n\n    # Custom stoploss\n    use_custom_stoploss = True\n    use_sell_signal = True\n    startup_candle_count: int = 400\n\n    ############################################################################\n\n    ## Buy params\n\n    is_optimize_cofi = False\n    buy_ema_cofi = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_cofi)\n    buy_fastk = IntParameter(20, 45, default=20, optimize = is_optimize_cofi)\n    buy_fastd = IntParameter(20, 45, default=20, optimize = is_optimize_cofi)\n    buy_adx = IntParameter(20, 45, default=30, optimize = is_optimize_cofi)\n    buy_ewo_high = DecimalParameter(-12, 12, default=3.553, optimize = is_optimize_cofi)\n\n    is_optimize_clucha = False\n    buy_clucha_bbdelta_close = DecimalParameter(0.0005, 0.042, default=0.034, decimals=5, optimize = is_optimize_clucha)\n    buy_clucha_bbdelta_tail = DecimalParameter(0.7, 1.1, default=0.95, decimals=5, optimize = is_optimize_clucha)\n    buy_clucha_closedelta_close = DecimalParameter(0.0005, 0.025, default=0.019, decimals=5, optimize = is_optimize_clucha)\n    buy_clucha_rocr_1h = DecimalParameter(0.001, 1.0, default=0.131, decimals=5, optimize = is_optimize_clucha)\n\n    is_optimize_clucha_2 = False\n    buy_clucha_bbdelta_close_2 = DecimalParameter(0.0005, 0.042, default=0.034, decimals=5, optimize = is_optimize_clucha_2)\n    buy_clucha_bbdelta_tail_2 = DecimalParameter(0.7, 1.1, default=0.95, decimals=5, optimize = is_optimize_clucha_2)\n    buy_clucha_closedelta_close_2 = DecimalParameter(0.0005, 0.025, default=0.019, decimals=5, optimize = is_optimize_clucha_2)\n    buy_clucha_rocr_1h_2 = DecimalParameter(0.001, 1.0, default=0.131, decimals=5, optimize = is_optimize_clucha_2)\n\n    is_optimize_clucha_3 = False\n    buy_clucha_bbdelta_close_3 = DecimalParameter(0.0005, 0.042, default=0.034, decimals=5, optimize = is_optimize_clucha_3)\n    buy_clucha_bbdelta_tail_3 = DecimalParameter(0.7, 1.1, default=0.95, decimals=5, optimize = is_optimize_clucha_3)\n    buy_clucha_closedelta_close_3 = DecimalParameter(0.0005, 0.025, default=0.019, decimals=5, optimize = is_optimize_clucha_3)\n    buy_clucha_rocr_1h_3 = DecimalParameter(0.001, 1.0, default=0.131, decimals=5, optimize = is_optimize_clucha_3)\n\n    is_optimize_clucha_4 = True\n    buy_clucha_bbdelta_close_4 = DecimalParameter(0.0005, 0.06, default=0.034, decimals=5, optimize = is_optimize_clucha_4)\n    buy_clucha_bbdelta_tail_4 = DecimalParameter(0.35, 1.1, default=0.95, decimals=5, optimize = is_optimize_clucha_4)\n    buy_clucha_closedelta_close_4 = DecimalParameter(0.0005, 0.025, default=0.019, decimals=5, optimize = is_optimize_clucha_4)\n    buy_clucha_rocr_1h_4 = DecimalParameter(0.001, 1.0, default=0.131, decimals=5, optimize = is_optimize_clucha_4)\n\n    is_optimize_gumbo = False\n    buy_gumbo_ema = DecimalParameter(0.9, 1.2, default=0.97 , optimize = is_optimize_gumbo)\n    buy_gumbo_ewo_low = DecimalParameter(-12.0, 5, default=-5.585, optimize = is_optimize_gumbo)\n    buy_gumbo_cti = DecimalParameter(-0.9, -0.0, default=-0.5 , optimize = is_optimize_gumbo)\n    buy_gumbo_r14 = DecimalParameter(-100, -44, default=-60 , optimize = is_optimize_gumbo)\n\n    is_optimize_gumbo_protection = False\n    buy_gumbo_tpct_0 = DecimalParameter(0.0, 0.25, default=0.131, decimals=2, optimize = is_optimize_gumbo_protection)\n    buy_gumbo_tpct_3 = DecimalParameter(0.0, 0.25, default=0.131, decimals=2, optimize = is_optimize_gumbo_protection)\n    buy_gumbo_tpct_9 = DecimalParameter(0.0, 0.25, default=0.131, decimals=2, optimize = is_optimize_gumbo_protection)\n\n    is_optimize_vwap = False\n    buy_vwap_width = DecimalParameter(0.05, 10.0, default=0.80 , optimize = is_optimize_vwap)\n    buy_vwap_closedelta = DecimalParameter(10.0, 30.0, default=15.0, optimize = is_optimize_vwap)\n    buy_vwap_cti = DecimalParameter(-0.9, -0.0, default=-0.6 , optimize = is_optimize_vwap)\n\n    is_optimize_vwap_2 = False\n    buy_vwap_width_2 = DecimalParameter(0.05, 10.0, default=0.80 , optimize = is_optimize_vwap_2)\n    buy_vwap_closedelta_2 = DecimalParameter(10.0, 30.0, default=15.0, optimize = is_optimize_vwap_2)\n    buy_vwap_cti_2 = DecimalParameter(-0.9, -0.0, default=-0.6 , optimize = is_optimize_vwap_2)\n\n    is_optimize_vwap_3 = False\n    buy_vwap_width_3 = DecimalParameter(0.05, 10.0, default=0.80 , optimize = is_optimize_vwap_3)\n    buy_vwap_closedelta_3 = DecimalParameter(10.0, 30.0, default=15.0, optimize = is_optimize_vwap_3)\n    buy_vwap_cti_3 = DecimalParameter(-0.9, -0.0, default=-0.6 , optimize = is_optimize_vwap_3)\n\n    is_optimize_vwap_4 = True\n    buy_vwap_width_4 = DecimalParameter(0.05, 10.0, default=0.80 , optimize = is_optimize_vwap_4)\n    buy_vwap_closedelta_4 = DecimalParameter(10.0, 30.0, default=15.0, optimize = is_optimize_vwap_4)\n    buy_vwap_cti_4 = DecimalParameter(-0.9, -0.0, default=-0.6 , optimize = is_optimize_vwap_4)\n\n    is_optimize_lambo_2 = False\n    buy_lambo2_ema = DecimalParameter(0.85, 1.15, default=0.942 , optimize = is_optimize_lambo_2)\n    buy_lambo2_rsi4 = IntParameter(15, 45, default=45, optimize = is_optimize_lambo_2)\n    buy_lambo2_rsi14 = IntParameter(15, 45, default=45, optimize = is_optimize_lambo_2)\n\n    is_optimize_V = False\n    buy_V_bb_width = DecimalParameter(0.01, 0.1, default=0.01 , optimize = is_optimize_V)\n    buy_V_cti = DecimalParameter(-0.95, -0.5, default=-0.6 , optimize = is_optimize_V)\n    buy_V_r14 = DecimalParameter(-100, 0, default=-60 , optimize = is_optimize_V)\n    buy_V_mfi = DecimalParameter(10, 40, default=30 , optimize = is_optimize_V)\n\n    is_optimize_V_2 = False\n    buy_V_bb_width_2 = DecimalParameter(0.01, 0.1, default=0.01 , optimize = is_optimize_V_2)\n    buy_V_cti_2 = DecimalParameter(-0.95, -0.5, default=-0.6 , optimize = is_optimize_V_2)\n    buy_V_r14_2 = DecimalParameter(-100, 0, default=-60 , optimize = is_optimize_V_2)\n    buy_V_mfi_2 = DecimalParameter(10, 40, default=30 , optimize = is_optimize_V_2)\n\n    is_optimize_V_4 = False\n    buy_V_bb_width_4 = DecimalParameter(0.01, 0.1, default=0.01 , optimize = is_optimize_V_4)\n    buy_V_cti_4 = DecimalParameter(-0.95, -0.0, default=-0.6 , optimize = is_optimize_V_4)\n    buy_V_r14_4 = DecimalParameter(-100, 0, default=-60 , optimize = is_optimize_V_4)\n    buy_V_mfi_4 = DecimalParameter(10, 40, default=30 , optimize = is_optimize_V_4)\n\n    is_optimize_V_5 = False\n    buy_V_bb_width_5 = DecimalParameter(0.01, 0.1, default=0.01 , optimize = is_optimize_V_5)\n    buy_V_cti_5 = DecimalParameter(-0.95, -0.0, default=-0.6 , optimize = is_optimize_V_5)\n    buy_V_r14_5 = DecimalParameter(-100, 0, default=-60 , optimize = is_optimize_V_5)\n    buy_V_mfi_5 = DecimalParameter(10, 40, default=30 , optimize = is_optimize_V_5)\n    buy_V_diff_5 = DecimalParameter(0.10, 0.20, default=0.10 , optimize = is_optimize_V_5)\n\n    is_optimize_pump_2 = False\n    buy_pump_2_factor = DecimalParameter(1.0, 1.20, default= 1.1 , optimize = is_optimize_pump_2)\n\n    is_optimize_crash_4 = False\n    buy_crash_4_tpct_0 = DecimalParameter(0.02, 0.04, default=0.02, decimals=3, optimize = is_optimize_crash_4)\n    buy_crash_4_tpct_3 = DecimalParameter(0.05, 0.10, default=0.05, decimals=2, optimize = is_optimize_crash_4)\n    buy_crash_4_tpct_9 = DecimalParameter(0.13, 0.32, default=0.13, decimals=2, optimize = is_optimize_crash_4)\n\n    ## Sell params\n    base_nb_candles_sell = IntParameter(5, 80, default=sell_params['base_nb_candles_sell'], space='sell', optimize=False)\n    high_offset          = DecimalParameter(0.85, 1.1, default=sell_params['high_offset'], space='sell', optimize=True)\n    high_offset_2        = DecimalParameter(0.85, 1.5, default=sell_params['high_offset_2'], space='sell', optimize=True)\n\n    ## Trailing params\n\n    # hard stoploss profit\n    pHSL = DecimalParameter(-0.10, -0.040, default=-0.08, decimals=3, space='sell', load=True, optimize=True)\n    # profit threshold 1, trigger point, SL_1 is used\n    pPF_1 = DecimalParameter(0.008, 0.020, default=0.016, decimals=3, space='sell', load=True, optimize=True)\n    pSL_1 = DecimalParameter(0.008, 0.020, default=0.011, decimals=3, space='sell', load=True, optimize=True)\n\n    # profit threshold 2, SL_2 is used\n    pPF_2 = DecimalParameter(0.040, 0.100, default=0.080, decimals=3, space='sell', load=True, optimize=True)\n    pSL_2 = DecimalParameter(0.020, 0.070, default=0.040, decimals=3, space='sell', load=True, optimize=True)\n\n    ############################################################################\n\n    def informative_pairs(self):\n\n        pairs = self.dp.current_whitelist()\n        informative_pairs = [(pair, '1h') for pair in pairs]\n\n        return informative_pairs\n\n    ## Custom Trailing stoploss ( credit to Perkmeister for this custom stoploss to help the strategy ride a green candle )\n    def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,\n                        current_rate: float, current_profit: float, **kwargs) -> float:\n\n        # hard stoploss profit\n        HSL = self.pHSL.value\n        PF_1 = self.pPF_1.value\n        SL_1 = self.pSL_1.value\n        PF_2 = self.pPF_2.value\n        SL_2 = self.pSL_2.value\n\n        # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated\n        # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value\n        # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used.\n\n        if (current_profit > PF_2):\n            sl_profit = SL_2 + (current_profit - PF_2)\n        elif (current_profit > PF_1):\n            sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1))\n        else:\n            sl_profit = HSL\n\n        # Only for hyperopt invalid return\n        if (sl_profit >= current_profit):\n            return -0.99\n\n        return stoploss_from_open(sl_profit, current_profit)\n\n    def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,\n                    current_profit: float, **kwargs):\n\n        dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)\n\n        last_candle = dataframe.iloc[-1]\n        #previous_candle_1 = dataframe.iloc[-2]\n        #previous_candle_2 = dataframe.iloc[-3]\n\n        max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)\n        max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)\n\n        buy_tag = 'empty'\n        if hasattr(trade, 'buy_tag') and trade.buy_tag is not None:\n            buy_tag = trade.buy_tag\n        buy_tags = buy_tag.split()\n\n        # sell vwap (bear, conservative sell)\n        if last_candle['ema_vwap_diff_50'] > 0.02:\n            if current_profit >= 0.005:\n                if (last_candle['close'] > last_candle['vwap_middleband'] * 0.99) and (last_candle['rsi'] > 41):\n                    return f\"sell_profit_vwap( {buy_tag})\"\n\n        return None\n\n    ############################################################################\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        assert self.dp, \"DataProvider is required for multiple timeframes.\"\n\n        # Bollinger bands (hyperopt hard to implement)\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)\n        dataframe['bb_lowerband2'] = bollinger2['lower']\n        dataframe['bb_middleband2'] = bollinger2['mid']\n        dataframe['bb_upperband2'] = bollinger2['upper']\n        dataframe['bb_width'] = ((dataframe['bb_upperband2'] - dataframe['bb_lowerband2']) / dataframe['bb_middleband2'])\n\n        # BinH\n        dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()\n\n        # SMA\n        dataframe['sma_9'] = ta.SMA(dataframe, timeperiod=9)\n\n        # CTI\n        dataframe['cti'] = pta.cti(dataframe[\"close\"], length=20)\n\n        # EMA\n        dataframe['ema_5'] = ta.EMA(dataframe, timeperiod=5)\n        dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)\n        dataframe['ema_14'] = ta.EMA(dataframe, timeperiod=14)\n        dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)\n        dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)\n        dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)\n        dataframe['hma_50'] = qtpylib.hull_moving_average(dataframe['close'], window=50)\n\n        # RSI\n        dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)\n        dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4)\n        dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20)\n\n        dataframe['rsi_6'] = ta.RSI(dataframe, timeperiod=6)\n        dataframe['rsi_8'] = ta.RSI(dataframe, timeperiod=8)\n        dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)\n        dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)\n\n        # Elliot\n        dataframe['EWO'] = EWO(dataframe, 50, 200)\n\n        # Cofi\n        stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)\n        dataframe['fastd'] = stoch_fast['fastd']\n        dataframe['fastk'] = stoch_fast['fastk']\n        dataframe['adx'] = ta.ADX(dataframe)\n\n        # Heiken Ashi\n        heikinashi = qtpylib.heikinashi(dataframe)\n        dataframe['ha_open'] = heikinashi['open']\n        dataframe['ha_close'] = heikinashi['close']\n        dataframe['ha_high'] = heikinashi['high']\n        dataframe['ha_low'] = heikinashi['low']\n\n        ## BB 40\n        bollinger2_40 = qtpylib.bollinger_bands(ha_typical_price(dataframe), window=40, stds=2)\n        dataframe['bb_lowerband2_40'] = bollinger2_40['lower']\n        dataframe['bb_middleband2_40'] = bollinger2_40['mid']\n        dataframe['bb_upperband2_40'] = bollinger2_40['upper']\n\n        # ClucHA\n        dataframe['bb_delta_cluc'] = (dataframe['bb_middleband2_40'] - dataframe['bb_lowerband2_40']).abs()\n        dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()\n        dataframe['tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()\n        dataframe['ema_slow'] = ta.EMA(dataframe['ha_close'], timeperiod=50)\n        dataframe['rocr'] = ta.ROCR(dataframe['ha_close'], timeperiod=28)\n\n        # Williams %R\n        dataframe['r_14'] = williams_r(dataframe, period=14)\n\n        # T3 Average\n        dataframe['T3'] = T3(dataframe)\n\n        # VWAP\n        vwap_low, vwap, vwap_high = VWAPB(dataframe, 20, 1)\n        dataframe['vwap_upperband'] = vwap_high\n        dataframe['vwap_middleband'] = vwap\n        dataframe['vwap_lowerband'] = vwap_low\n        dataframe['vwap_width'] = ( (dataframe['vwap_upperband'] - dataframe['vwap_lowerband']) / dataframe['vwap_middleband'] ) * 100\n\n        # Avg\n        dataframe['average'] = (dataframe['close'] + dataframe['open'] + dataframe['high'] + dataframe['low']) / 4\n\n        dataframe['cci'] = ta.CCI(dataframe)\n        dataframe['mfi'] = ta.MFI(dataframe)\n\n        # Diff\n        dataframe['ema_vwap_diff_50'] = ( ( dataframe['ema_50'] - dataframe['vwap_lowerband'] ) / dataframe['ema_50'] )\n\n        # Crash protection\n        dataframe['tpct_0'] = top_percent_change(dataframe , 0)\n        dataframe['tpct_3'] = top_percent_change(dataframe , 3)\n        dataframe['tpct_9'] = top_percent_change(dataframe , 9)\n        #dataframe['tpct_24'] = top_percent_change(dataframe , 24)\n        #dataframe['tpct_42'] = top_percent_change(dataframe , 42)\n\n        # Calculate all ma_sell values\n        for val in self.base_nb_candles_sell.range:\n            dataframe[f'ma_sell_{val}'] = ta.EMA(dataframe, timeperiod=val)\n\n        ############################################################################\n\n        # 1h tf\n        inf_tf = '1h'\n        informative = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=inf_tf)\n\n        # Heikin Ashi\n        inf_heikinashi = qtpylib.heikinashi(informative)\n        informative['ha_close'] = inf_heikinashi['close']\n        informative['rocr'] = ta.ROCR(informative['ha_close'], timeperiod=168)\n\n        # Bollinger bands\n        bollinger2 = qtpylib.bollinger_bands(qtpylib.typical_price(informative), window=20, stds=2)\n        informative['bb_lowerband2'] = bollinger2['lower']\n        informative['bb_middleband2'] = bollinger2['mid']\n        informative['bb_upperband2'] = bollinger2['upper']\n        informative['bb_width'] = ((informative['bb_upperband2'] - informative['bb_lowerband2']) / informative['bb_middleband2'])\n\n        # T3 Average\n        informative['T3'] = T3(informative)\n\n        # RSI\n        informative['rsi'] = ta.RSI(informative, timeperiod=14)\n\n        # EMA\n        informative['ema_200'] = ta.EMA(informative, timeperiod=200)\n\n        dataframe = merge_informative_pair(dataframe, informative, self.timeframe, inf_tf, ffill=True)\n\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n\n        conditions = []\n        dataframe.loc[:, 'buy_tag'] = ''\n\n        is_pump_2 = (\n                (dataframe['close'].rolling(48).max() >= (dataframe['close'] * self.buy_pump_2_factor.value ))\n            )\n\n        is_crash_4 = (\n                (dataframe['tpct_0'] < self.buy_crash_4_tpct_0.value) &\n                (dataframe['tpct_3'] < self.buy_crash_4_tpct_3.value) &\n                (dataframe['tpct_9'] < self.buy_crash_4_tpct_9.value)\n            )\n\n        is_cofi = (\n                (dataframe['open'] < dataframe['ema_8'] * self.buy_ema_cofi.value) &\n                (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) &\n                (dataframe['fastk'] < self.buy_fastk.value) &\n                (dataframe['fastd'] < self.buy_fastd.value) &\n                (dataframe['adx'] > self.buy_adx.value) &\n                (dataframe['EWO'] > self.buy_ewo_high.value)\n            )\n\n        is_gumbo = (                                                                        # Modified from gumbo1, creadit goes to original author @raph92\n                (dataframe['bb_middleband2_1h'] >= dataframe['T3_1h']) &\n                (dataframe['T3'] <= dataframe['ema_8'] * self.buy_gumbo_ema.value) &\n                (dataframe['cti'] < self.buy_gumbo_cti.value) &\n                (dataframe['r_14'] < self.buy_gumbo_r14.value) &\n                (dataframe['EWO'] < self.buy_gumbo_ewo_low.value) &\n\n                # Crash Protection\n                (dataframe['tpct_0'] < self.buy_gumbo_tpct_0.value) &\n                (dataframe['tpct_3'] < self.buy_gumbo_tpct_3.value) &\n                (dataframe['tpct_9'] < self.buy_gumbo_tpct_9.value)\n            )\n\n        is_clucHA = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                ) &\n                (dataframe['EWO'] > 8)\n            )\n\n        is_clucHA_2 = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h_2.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close_2.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close_2.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail_2.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                ) &\n                (dataframe['EWO'] > 4) &\n                (dataframe['EWO'] < 8) &\n                (is_pump_2)\n            )\n\n        is_clucHA_3 = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h_3.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close_3.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close_3.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail_3.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                ) &\n                (dataframe['EWO'] < 4) &\n                (dataframe['EWO'] > -2.5)\n            )\n\n        is_clucHA_4 = (\n                (dataframe['rocr_1h'] > self.buy_clucha_rocr_1h_4.value ) &\n                (\n                        (dataframe['bb_lowerband2_40'].shift() > 0) &\n                        (dataframe['bb_delta_cluc'] > dataframe['ha_close'] * self.buy_clucha_bbdelta_close_4.value) &\n                        (dataframe['ha_closedelta'] > dataframe['ha_close'] * self.buy_clucha_closedelta_close_4.value) &\n                        (dataframe['tail'] < dataframe['bb_delta_cluc'] * self.buy_clucha_bbdelta_tail_4.value) &\n                        (dataframe['ha_close'] < dataframe['bb_lowerband2_40'].shift()) &\n                        (dataframe['ha_close'] < dataframe['ha_close'].shift())\n                ) &\n                (dataframe['EWO'] < -4) &\n                (dataframe['EWO'] > -8)\n                #&\n                #(is_crash_4)\n            )\n\n        is_vwap = (\n                (dataframe['close'] < dataframe['vwap_lowerband']) &\n                (dataframe['vwap_width'] > self.buy_vwap_width.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_vwap_closedelta.value / 1000 ) &\n                (dataframe['cti'] < self.buy_vwap_cti.value) &\n                (dataframe['EWO'] > 8)\n            )\n\n        is_vwap_2 = (\n                (dataframe['close'] < dataframe['vwap_lowerband']) &\n                (dataframe['vwap_width'] > self.buy_vwap_width_2.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_vwap_closedelta_2.value / 1000 ) &\n                (dataframe['cti'] < self.buy_vwap_cti_2.value) &\n                (dataframe['EWO'] > 4) &\n                (dataframe['EWO'] < 8) &\n                (is_pump_2)\n            )\n\n        is_vwap_3 = (\n                (dataframe['close'] < dataframe['vwap_lowerband']) &\n                (dataframe['vwap_width'] > self.buy_vwap_width_3.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_vwap_closedelta_3.value / 1000 ) &\n                (dataframe['cti'] < self.buy_vwap_cti_3.value) &\n                (dataframe['EWO'] < 4) &\n                (dataframe['EWO'] > -2.5)\n            )\n\n        is_vwap_4 = (\n                (dataframe['close'] < dataframe['vwap_lowerband']) &\n                (dataframe['vwap_width'] > self.buy_vwap_width_4.value) &\n                (dataframe['closedelta'] > dataframe['close'] * self.buy_vwap_closedelta_4.value / 1000 ) &\n                (dataframe['cti'] < self.buy_vwap_cti_4.value) &\n                (dataframe['EWO'] < -4) &\n                (dataframe['EWO'] > -8)\n                #&\n                #(is_crash_4)\n            )\n\n        is_lambo_2 = (\n                (dataframe['close'] < dataframe['ema_14'] * self.buy_lambo2_ema.value) &\n                (dataframe['rsi_fast'] < self.buy_lambo2_rsi4.value) &\n                (dataframe['rsi'] < self.buy_lambo2_rsi14.value) &\n                (dataframe['EWO'] > 4) &\n                (dataframe['EWO'] < 8) &\n                (is_pump_2)\n            )\n\n        is_V = (\n                (dataframe['bb_width'] > self.buy_V_bb_width.value) &\n                (dataframe['cti'] < self.buy_V_cti.value) &\n                (dataframe['r_14'] < self.buy_V_r14.value) &\n                (dataframe['mfi'] < self.buy_V_mfi.value) &\n                (dataframe['EWO'] > 8)\n            )\n\n        is_V_2 = (\n                (dataframe['bb_width'] > self.buy_V_bb_width_2.value) &\n                (dataframe['cti'] < self.buy_V_cti_2.value) &\n                (dataframe['r_14'] < self.buy_V_r14_2.value) &\n                (dataframe['mfi'] < self.buy_V_mfi_2.value) &\n                (dataframe['EWO'] > 4) &\n                (dataframe['EWO'] < 8) &\n                (is_pump_2)\n            )\n\n        is_V_5 = (\n                (dataframe['bb_width'] > self.buy_V_bb_width_5.value) &\n                (dataframe['cti'] < self.buy_V_cti_5.value) &\n                (dataframe['r_14'] < self.buy_V_r14_5.value) &\n                (dataframe['mfi'] < self.buy_V_mfi_5.value) &\n                # Really Bear, don't engage until dump over\n                (dataframe['ema_vwap_diff_50'] > 0.215) &\n                (dataframe['EWO'] < -10)\n            )\n\n        is_additional_check = (\n                (dataframe['rsi_84'] < 60) &\n                (dataframe['rsi_112'] < 60) &\n                (dataframe['volume'] > 0)\n            )\n\n        # condition append\n\n        ## Non EWO\n        conditions.append(is_cofi)                                                   # ~3.21 90.8%\n        dataframe.loc[is_cofi, 'buy_tag'] += 'cofi '\n\n        # EWO > 8\n        conditions.append(is_vwap)                                                   # ~67.3%\n        dataframe.loc[is_vwap, 'buy_tag'] += 'vwap '\n\n        conditions.append(is_V)                                                      # ~67.9%\n        dataframe.loc[is_V, 'buy_tag'] += 'V '\n\n        # EWO 4 ~ 8\n        conditions.append(is_lambo_2)                                                # ~67.7%\n        dataframe.loc[is_lambo_2, 'buy_tag'] += 'lambo_2 '\n\n        conditions.append(is_clucHA_2)                                               # ~68.2%\n        dataframe.loc[is_clucHA_2, 'buy_tag'] += 'cluc_2 '\n\n        conditions.append(is_vwap_2)                                                 # ~67.3%\n        dataframe.loc[is_vwap_2, 'buy_tag'] += 'vwap_2 '\n\n        conditions.append(is_V_2)                                                    # ~67.9%\n        dataframe.loc[is_V_2, 'buy_tag'] += 'V_2 '\n\n        # EWO -2.5 ~ 4\n        conditions.append(is_clucHA_3)                                               # ~68.2%\n        dataframe.loc[is_clucHA_3, 'buy_tag'] += 'cluc_3 '\n\n        conditions.append(is_vwap_3)                                                 # ~67.3%\n        dataframe.loc[is_vwap_3, 'buy_tag'] += 'vwap_3 '\n\n        # EWO -8 ~ -4\n        conditions.append(is_clucHA_4)                                               # ~68.2%\n        dataframe.loc[is_clucHA_4, 'buy_tag'] += 'cluc_4 '\n\n        conditions.append(is_vwap_4)                                                 # ~67.3%\n        dataframe.loc[is_vwap_4, 'buy_tag'] += 'vwap_4 '\n\n        ## EWO < -8\n        conditions.append(is_gumbo)                                                  # ~2.63 / 90.6% / 41.49%      F   (263 %)\n        dataframe.loc[is_gumbo, 'buy_tag'] += 'gumbo '\n\n        conditions.append(is_V_5)                                                    # ~67.9%\n        dataframe.loc[is_V_5, 'buy_tag'] += 'V_5 '\n\n        if conditions:\n            dataframe.loc[\n                            is_additional_check\n                            &\n                            reduce(lambda x, y: x | y, conditions)\n\n                        , 'buy' ] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        conditions = []\n\n        conditions.append(\n            (                   \n                (dataframe['close'] > dataframe['sma_9']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset_2.value)) &\n                (dataframe['rsi'] > 50) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n\n            )\n            |\n            (\n                (dataframe['sma_9'] > (dataframe['sma_9'].shift(1) + dataframe['sma_9'].shift(1) * 0.005 )) &\n                (dataframe['close'] < dataframe['hma_50']) &\n                (dataframe['close'] > (dataframe[f'ma_sell_{self.base_nb_candles_sell.value}'] * self.high_offset.value)) &\n                (dataframe['volume'] > 0) &\n                (dataframe['rsi_fast'] > dataframe['rsi_slow'])\n            )    \n        )\n\n        if conditions:\n            dataframe.loc[\n                reduce(lambda x, y: x | y, conditions),\n                'sell'\n            ] = 1\n\n        return dataframe\n\ndef T3(dataframe, length=5):\n    \"\"\"\n    T3 Average by HPotter on Tradingview\n    https://www.tradingview.com/script/qzoC9H1I-T3-Average/\n    \"\"\"\n    df = dataframe.copy()\n\n    df['xe1'] = ta.EMA(df['close'], timeperiod=length)\n    df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)\n    df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)\n    df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)\n    df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)\n    df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)\n    b = 0.7\n    c1 = -b * b * b\n    c2 = 3 * b * b + 3 * b * b * b\n    c3 = -6 * b * b - 3 * b - 3 * b * b * b\n    c4 = 1 + 3 * b + b * b * b + 3 * b * b\n    df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']\n\n    return df['T3Average']\n"
  },
  {
    "path": "strategies/wtc/wtc.py",
    "content": "# WTC Strategy: WTC(World Trade Center Tabriz)\n# is the biggest skyscraper of Tabriz, city of Iran\n# (What you want?it not enough for you?that's just it!)\n# No, no, I'm kidding. It's also mean Wave Trend with Crosses\n# algo by LazyBare(in TradingView) that I reduce it\n# signals noise with dividing it to Stoch-RSI indicator.\n# Also thanks from discord: @aurax for his/him\n# request to making this strategy.\n# hope you enjoy and get profit\n# Author: @Mablue (Masoud Azizi)\n# IMPORTANT: install sklearn befoure you run this strategy:\n# pip install sklearn\n# github: https://github.com/mablue/\n# freqtrade hyperopt --hyperopt-loss SharpeHyperOptLoss --spaces buy sell --strategy wtc\n\nimport freqtrade.vendor.qtpylib.indicators as qtpylib\nimport talib.abstract as ta\nfrom freqtrade.strategy import DecimalParameter\nfrom freqtrade.strategy import IStrategy\nfrom pandas import DataFrame\n#\n# --- Do not remove these libs ---\nimport numpy as np  # noqa\nimport pandas as pd  # noqa\nfrom sklearn import preprocessing\n\n# --------------------------------\n# Add your lib to import here\n\n\nclass wtc(IStrategy):\n    ################################ SETTINGS ################################\n    # 61 trades. 16/0/45 Wins/Draws/Losses.\n    # * Avg profit: 132.53%.\n    # Median profit: -12.97%.\n    # Total profit: 0.80921449 BTC ( 809.21Σ%).\n    # Avg duration 4 days, 7:47:00 min.\n    # Objective: -15.73417\n\n    # Config:\n    # \"max_open_trades\": 10,\n    # \"stake_currency\": \"BTC\",\n    # \"stake_amount\": 0.01,\n    # \"tradable_balance_ratio\": 0.99,\n    # \"timeframe\": \"30m\",\n    # \"dry_run_wallet\": 0.1,\n\n    # Buy hyperspace params:\n    buy_params = {\n        \"buy_max\": 0.9609,\n        \"buy_max0\": 0.8633,\n        \"buy_max1\": 0.9133,\n        \"buy_min\": 0.0019,\n        \"buy_min0\": 0.0102,\n        \"buy_min1\": 0.6864,\n    }\n\n    # Sell hyperspace params:\n    sell_params = {\n        \"sell_max\": -0.7979,\n        \"sell_max0\": 0.82,\n        \"sell_max1\": 0.9821,\n        \"sell_min\": -0.5377,\n        \"sell_min0\": 0.0628,\n        \"sell_min1\": 0.4461,\n    }\n    minimal_roi = {\n        \"0\": 0.30873,\n        \"569\": 0.16689,\n        \"3211\": 0.06473,\n        \"7617\": 0\n    }\n    stoploss = -0.128\n    ############################## END SETTINGS ##############################\n    timeframe = '30m'\n\n    buy_max = DecimalParameter(-1, 1, decimals=4, default=0.4393, space='buy')\n    buy_min = DecimalParameter(-1, 1, decimals=4, default=-0.4676, space='buy')\n    sell_max = DecimalParameter(-1, 1, decimals=4,\n                                default=-0.9512, space='sell')\n    sell_min = DecimalParameter(-1, 1, decimals=4,\n                                default=0.6519, space='sell')\n\n    buy_max0 = DecimalParameter(0, 1, decimals=4, default=0.4393, space='buy')\n    buy_min0 = DecimalParameter(0, 1, decimals=4, default=-0.4676, space='buy')\n    sell_max0 = DecimalParameter(\n        0, 1, decimals=4, default=-0.9512, space='sell')\n    sell_min0 = DecimalParameter(\n        0, 1, decimals=4, default=0.6519, space='sell')\n\n    buy_max1 = DecimalParameter(0, 1, decimals=4, default=0.4393, space='buy')\n    buy_min1 = DecimalParameter(0, 1, decimals=4, default=-0.4676, space='buy')\n    sell_max1 = DecimalParameter(\n        0, 1, decimals=4, default=-0.9512, space='sell')\n    sell_min1 = DecimalParameter(\n        0, 1, decimals=4, default=0.6519, space='sell')\n\n    def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n\n        # WAVETREND\n        try:\n            ap = (dataframe['high']+dataframe['low'] + dataframe['close'])/3\n\n            esa = ta.EMA(ap, 10)\n\n            d = ta.EMA((ap - esa).abs(), 10)\n            ci = (ap - esa).div(0.0015 * d)\n            tci = ta.EMA(ci, 21)\n\n            wt1 = tci\n            wt2 = ta.SMA(np.nan_to_num(wt1), 4)\n\n            dataframe['wt1'], dataframe['wt2'] = wt1, wt2\n\n            stoch = ta.STOCH(dataframe, 14)\n            slowk = stoch['slowk']\n            dataframe['slowk'] = slowk\n            # print(dataframe.iloc[:, 6:].keys())\n            x = dataframe.iloc[:, 6:].values  # returns a numpy array\n            min_max_scaler = preprocessing.MinMaxScaler()\n            x_scaled = min_max_scaler.fit_transform(x)\n            dataframe.iloc[:, 6:] = pd.DataFrame(x_scaled)\n            # print('wt:\\t', dataframe['wt'].min(), dataframe['wt'].max())\n            # print('stoch:\\t', dataframe['stoch'].min(), dataframe['stoch'].max())\n            dataframe['def'] = dataframe['slowk']-dataframe['wt1']\n            # print('def:\\t', dataframe['def'].min(), \"\\t\", dataframe['def'].max())\n        except:\n            dataframe['wt1'], dataframe['wt2'], dataframe['def'], dataframe['slowk'] = 0, 10, 100, 1000\n        return dataframe\n\n    def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        dataframe.loc[\n            (\n                (qtpylib.crossed_above(dataframe['wt1'], dataframe['wt2']))\n                & (dataframe['wt1'].between(self.buy_min0.value, self.buy_max0.value))\n                & (dataframe['slowk'].between(self.buy_min1.value, self.buy_max1.value))\n                & (dataframe['def'].between(self.buy_min.value, self.buy_max.value))\n\n            ),\n\n            'buy'] = 1\n\n        return dataframe\n\n    def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:\n        # print(dataframe['slowk']/dataframe['wt1'])\n        dataframe.loc[\n            (\n                (qtpylib.crossed_below(dataframe['wt1'], dataframe['wt2']))\n                & (dataframe['wt1'].between(self.sell_min0.value, self.sell_max0.value))\n                & (dataframe['slowk'].between(self.sell_min1.value, self.sell_max1.value))\n                & (dataframe['def'].between(self.sell_min.value, self.sell_max.value))\n\n            ),\n            'sell'] = 1\n        return dataframe\n"
  }
]